Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on ASP.Net application which will provide the Video gallery. I ll have video link on my database. I need to embed those video on my page dynamically (it may from youtube,yahoo,DailyMothion or any other site..).

I have worked as followed by Embedded Video , but it will allow only to play you tube videos, other videos are not playing.

HTML
<object width="480" height="385">
<param name="movie"
   value="http://www.youtube.com/v/ITswHbJPHhQ?fs=1&hl=en_US&rel=0"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/ITswHbJPHhQ?fs=1&hl=en_US&rel=0"
   type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="480" height="385"></embed></object>



Please suggest me to achieve
Posted

1 solution

Sounds like you're looking for oEmbed[^] - so long as the site supports an oEmbed API, you can pass it a link to a video and it will return the markup required to display that video.

There's a jQuery wrapper[^] which will convert a list of links into embedded players:
HTML
<div><a href="http://www.youtube.com/v/ITswHbJPHhQ?fs=1&hl=en_US&rel=0" class="oembed">YouTube Video</a></div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="jquery.oembed.js"></script>
<script>
$(function() {
    $("a.oembed").oembed();
});
</script>


Alternatively, you could use a server-side solution such as OptionStrict.oEmbed[^] to generate the markup on the server.
 
Share this answer
 

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