Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Actually in my asp.net web form i am using HTML5 video player in one site i seen a example i just copy pasted it is working but when i downloaded that video from that link i kept that video in my c drive and given src=path it is not playing here below is my code


Below code is working

XML
<video id="video1" width="420">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
    Your browser does not support HTML5 video.
  </video>



Below code is not working

XML
<video id="video1" width="420">
    <source src="https://uat.priorusmed.com/PtImages/Sravi-klokesh/small.mp4" type="video/mp4">
    Your browser does not support HTML5 video.
  </video>



is there any problem in my code..
Posted
Updated 15-Mar-14 1:49am
v5

1 solution

Here you can use either absolute or relative urls only.

Possible values:

An absolute URL - points to another web site (like src="http://www.example.com/small.mp4")

A relative URL - points to a file within a web site (like src="small.mp4")

When you add video into your web site,you can use it as below:
XML
<video width='300' height='200' controls>
    <source src="/PtImages/Sravi-klokesh/Priorus-1394794109.mp4" type="video/mp4"/>
    <p>Fallback code if video isn't supported</p>/
    </video>
 
Share this answer
 
v3
Comments
ntitish 15-Mar-14 1:54am    
how can it get the video from the computer if i given simply src="small.mp4" the video is not in my project outside the project..
Sampath Lokuge 15-Mar-14 1:55am    
You have to add it into your project.Otherwise it will not work.
ntitish 15-Mar-14 1:58am    
ok sir even in my project also i am saving in folder like this i am saving in the project

PtImages/Sravi-klokesh/Priorus-1394794109.mp4

then how to give src
Sampath Lokuge 15-Mar-14 2:00am    
Is above folder located under the Web site root ?
ntitish 15-Mar-14 2:03am    
yes sir for example i am giving one link which is related to my project

source src="https://uat.priorusmed.com/PtImages/Sravi-klokesh/small.mp4" /

when i use that URL out side the video is playing but when attached to src it is not playing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900