문제

I am trying to stream live videos in internet explorer so for that I have used object tag in html using active plugin that is supported in IE.

Problem I'm facing is with the function that I have used to stream that gives the error: Unable to get value of the property 'add': object is null or undefined at [ var id=players[0].playlist.add(url,opts); ]

Following is my code:

 <script type="text/javascript">
    function playvideo()
       {
       var players=document.getElementsByName("vlc");
           var opts = new Array("");
       url="https://www.youtube.com/watch?v=3u1fu6f8Hto";
    var id=players[0].playlist.add(url,opts);
    players[0].playlist.playItem(id);
        }
  </script>

      <OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
   width="640" height="480" name="vlc" events="True">
         <param name="Src" value="https://www.youtube.com/watch?v=3u1fu6f8Hto" />
         <param name="ShowDisplay" value="True"  />
         <param name="AutoLoop" value="False" />
         <param name="AutoPlay" value="False" />
       </OBJECT>

The url used is just a dummy one the actual one has to be rtsp streaming

Can anybody please help me out what else can I use instead of add function because I guess that isn't supported.

도움이 되었습니까?

해결책

You could try this way. Hope it should helpful for you.

<!DOCTYPE html>
 <html>
  <body>
    <iframe width="420" height="345" src="http://www.youtube.com/embed/3u1fu6f8Hto">    
    </iframe>
 </body>
</html>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top