Page 1 of 1

dynamic embed vlc in ff

Posted: 22 Dec 2006 13:35
by karlar
It seems like it is not possible with ff to dynamic embed the vlc plugin on a page and and control it afterwards.

have tried following script that works in IE but give following error in ff
Error: player.playlist has no properties

Code: Select all

<HTML> <script> function createvlc() { var player_object; if(document.all) { player_object = document.createElement("OBJECT"); player_object.classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"; player_object.codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0"; } else { player_object = document.createElement("embed") player_object.type="application/x-vlc-plugin"; player_object.progid="VideoLAN.VLCPlugin.2"; player_object.name = "vlc"; } player_object.id="vlc" document.getElementById("body").appendChild(player_object); } function play() { var url = "rtsp://www.optimalstream.net/vlcpl/subscriber/Kaare_A_Larsen-1168471117/cnbc" var player = document.getElementById("vlc"); var item_id = player.playlist.add(url); player.playlist.playItem(item_id); } </script> <BODY id="body" onload="createvlc()" onclick="play()" > </BODY> </HTML>

Posted: 08 Mar 2007 00:43
by ZoRRo75
i've done it with this simple piece of JS code :

Code: Select all

document.getElementById("DIV_PLAYER").innerHTML = '<html:embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" name="PREVIEW" id="PREVIEW" autoplay="no" loop="yes" width="320" height="240" />';

et voila ;)