动态地将其他站点视频嵌入到ASP.Net中 [英] Embed other site videos into ASP.Net dynamically
问题描述
我正在开发ASP.Net应用程序,它将提供视频库。我的数据库上有视频链接。我需要动态地将这些视频嵌入我的页面(可能来自youtube,yahoo,DailyMothion或任何其他网站......)。
我的工作跟随嵌入式视频,但它只允许播放管视频,其他视频无法播放。
< pre lang =HTML> < object width = 480 < span class =code-attribute> height = 385 >
< param name = movie
value = http://www.youtube.com/v/ITswHbJPHhQ?fs = 1& hl = en_US& rel = 0 > < / param >
< < span class =code-leadattribute> param name = allowFullScreen value = true > < / param >
< param name = allowscriptaccess value = 始终 > < / param >
< embed src = http://www.youtube.com/v/ITswHbJPHhQ?fs=1&hl=en_US&rel=0
type = application / x-shockwave-flash allow script access = 始终
allowfullscreen = true width = 480 < span class =code-attribute> height = 385 > < /嵌入 > < / object >
请建议我实现
听起来你正在寻找 oEmbed [ ^ ] - 只要网站支持oEmbed API,您就可以通过它是视频的链接,它将返回显示该视频所需的标记。
有一个jQuery包装器 [ ^ ]将链接列表转换为嵌入式播放器:
< < span class =code-leadattribute> div > < a href = http://www.youtube.com/v/ITswHbJPHhQ?fs= 1& hl = en_US& rel = 0 class = oembed > YouTube视频< / a > < / div >
< script src = // ajax.googleapis.com/ajax/libs/jque ry / 1.3.2 / jquery.min.js > < / script >
< script src = jquery.oembed.js > < / script >
< script >
( function (){
( a.oembed)。透过oEmbed();
});
< / script >
或者,您可以使用服务器端解决方案,例如如 OptionStrict.oEmbed [ ^ ]在服务器上生成标记。
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.
<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
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:
<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.
这篇关于动态地将其他站点视频嵌入到ASP.Net中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!