javascript 跨浏览器嵌入 VLC 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12157210/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cross-browser embed VLC plugin
提问by mmmaaak
I have embedded vlc plugin for Google Chrome this way:
我以这种方式为 Google Chrome 嵌入了 vlc 插件:
<embed
type='application/x-vlc-plugin'
pluginspage='http://www.videolan.org'
version='VideoLAN.VLCPlugin.2'
width='800'
height='600'
id='vlc'
loop='yes'
autoplay='yes'
target='rtsp://127.0.0.1:8554/realtime_1db07ff1-c5f9-4597-abf6-0d442454d06c'>
</embed>
But this approach doesn't work with Internet Explorer.
但是这种方法不适用于 Internet Explorer。
Are any universal methods available to embed this player in all browsers?
是否有任何通用方法可以将此播放器嵌入所有浏览器?
回答by mac
I posted examples for both IE and Mozilla on the VideoLan forum a while ago here.
我贴在VideoLAN的论坛前一阵子两个IE和Mozilla的例子在这里。
I wrote myself a switch that distinguishes between IE and "the rest" and embeds either one control for IE, or another one for Mozilla and Chrome.
我给自己写了一个开关来区分 IE 和“其他”,并嵌入一个用于 IE 的控件,或者另一个用于 Mozilla 和 Chrome 的控件。
In your particular case, the code for IE should work like this:
在您的特定情况下,IE 的代码应该像这样工作:
<object
classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"
id="vlc"
name="vlc"
class="vlcPlayer"
events="True">
<param name="Src" value="rtsp://127.0.0.1:8554/realtime_1db07ff1-c5f9-4597-abf6-0d442454d06c" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="True" />
<param name="AutoPlay" value="True" />
</object>
You can find further information in the VideoLan Wiki here.
您可以在此处的 VideoLan Wiki 中找到更多信息。
The VLC cab file unfortunately isn't available in this location anymore btw. The post I referenced above is part of a whole thread in the VLC forum about why it's not being provided anymore.
不幸的是,该位置不再提供 VLC cab 文件顺便说一句。我上面引用的帖子是 VLC 论坛中关于为什么不再提供它的整个主题的一部分。