Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all,
in my project there is aq requirement to play latest format videos like mp4,avi,wmv,3gp etc. so i require a video player. which video player should i use and how? i want if any one opens a webpage video should be played in the player which i selected. please help me ...i am facing this problem since a long time...so please give a best solution...
thanks in advance...
Posted

1 solution

Hi,
in asp.net a Literal control will help u to play video and Audio
just drag it in your page and in aspx.cs page
write following code
HTML
string myobj = "";

       myobj += "<video width='462'  controls='controls' data-setup='{}'>";
       myobj += "<source src='http://www.yourdomain.com/videos/Video.mp4' type='video/ogg' />";

       myobj += "Your browser does not support video";

       myobj += "</object>";
       myobj += "</video>";

       Literal1.Text = myobj;

Note- video path must be same as above

for audio replace script by Following
HTML
<audio controls="controls">
  <source src="song.ogg" type="audio/ogg" />
  <source src="song.mp3" type="audio/mpeg" />
  Your browser does not support the audio element.
</audio>


Hope this help u
best Luck
Happy Coding :)
 
Share this answer
 
v2
Comments
betu.009 23-May-12 9:12am    
thanks for answer..i tried it it shows video player but not playing...it giving error like "No video with supported format and MME type found..i gave src='http://localhost:50075/upload/v1.avi'
Nilesh Patil Kolhapur 24-May-12 2:12am    
Mp4 and webcam files supported only

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