繁体   English   中英

无法在IE9和更早版本中使用VLC ActiveX插件播放视频

[英]Unable to play video with VLC activeX plugin in IE9 and earlier

我正在尝试在IE9和更早版本中播放视频。 为此,我使用activeX插件加载VLC Media Player(这是我的基本要求)。

当我尝试执行代码时,抛出了错误:

Unable to get value of the property 'playlist': object is null or undefined 

我的代码如下:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
           <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
           <title>VLC API</title>
           <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
           <script>
                 $(document).ready(function(){  
                      play();
                       displayPlugins();
                     $(function(){ 
            $("#vlc").css({ "width": "400px", "height": "300px" });
                  });
                           });
                  function play()
                 {
                    var vlc=document.getElementById("vlc");
                           alert("play video");
                    var url="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
             var options=new Array(":aspect-ratio=4:3","-rtsp-tcp");
             var id= vlc.playlist.add(url,"",options);
             vlc.playlist.playItem(id);
         }


         function displayPlugins()
           {
              alert("plugins");
        var player="<object type='application/x-vlc-plugin' id='vlc' width='300' height='225' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921' codebase='http://activex.microsoft.com/controls/vb5/comdlg32.cab'></object>";
         $("#video_holder").html(player);
     }
      </script>

  </head>

<body>
      <div id="video_holder" style="border:1px solid #00FF33; height:350px;"></div>
</body>

有人可以帮我解决我的问题吗?

您正在执行:

var vlc=document.getElementById("vlc");

但是在HTML上,

<div id="video_holder" style="border:1px solid #00FF33; height:350px;"></div>

因此,理论上您想要:

var vlc=document.getElementById("video_holder");

之后,您可能会有更多问题,但从这里开始。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM