dynamic embed vlc in ff

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
karlar
Blank Cone
Blank Cone
Posts: 73
Joined: 12 Jun 2006 12:25

dynamic embed vlc in ff

Postby karlar » 22 Dec 2006 13:35

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>

ZoRRo75
New Cone
New Cone
Posts: 1
Joined: 08 Mar 2007 00:41

Postby ZoRRo75 » 08 Mar 2007 00:43

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 ;)


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 1 guest