VLC embedded to HTML in IE8?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

VLC embedded to HTML in IE8?

Postby jjjj » 09 Sep 2010 22:36

Hi!

It looks like to be a rocket science to get embedded VLC to work in Windows7/IE8. What's wrong with the following code?

Code: Select all

<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Videos</title> </head> <body> <object type="application/x-vlc-plugin" id="vlcplayer" width="720px" height="540px" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"> <param name="MRL" value="Video1.flv" /> <param name="volume" value="100" /> <param name="autoplay" value="false" /> <param name="loop" value="false" /> <param name="fullscreen" value="true" /> </object> <ol> <li><a href="javascript:;" onclick='player();'>Click a vid!</a></li> </ol> <script type="text/javascript" language="javascript"> function player() { var vlc = document.getElementById("vlcplayer"); vlc.playlist.play(); } </script> </body> </html>
The result is simply: "'playlist' is null or not an object". Notice, that I have removed pluginspace/version/events from object parameters, because of XHTML Transitional doesn't allow them, also embedded-tag can't be used. That index.html and video files are located in the same directory. Any change to get that work? Thanks in advance!

BrunoBozic
New Cone
New Cone
Posts: 3
Joined: 10 Sep 2010 14:08

Re: VLC embedded to HTML in IE8?

Postby BrunoBozic » 10 Sep 2010 14:09

Same problem! VLCs docs SUCK at the moment.

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC embedded to HTML in IE8?

Postby Ilasir » 10 Sep 2010 16:16

I'm not quite sure what your probllem is. Perhaps you should try loading the videos into the playlist...

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 12 Sep 2010 21:58

Hi!

Adding this line didn't solve the problem:

vlc.playlist.add("Video1.flv");

So the js-code is now:

<script type="text/javascript" language="javascript">
function player() {
var vlc = document.getElementById("vlcplayer");
vlc.playlist.add("Video1.flv");
vlc.playlist.play();
}
</script>

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC embedded to HTML in IE8?

Postby Ilasir » 13 Sep 2010 21:17

try "vlc.playlist.playItem(0)"

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 13 Sep 2010 21:30

Tried - still doesn't work. I also tried to save a playlist from the player and tried to play that.
The object code:

<div id="player">
<object type="application/x-vlc-plugin"
id="vlcplayer"
width="720px"
height="540px"
classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921">
<param name="MRL" value="test.xspf" />
<param name="volume" value="100" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="true" />
</object>
</div>

And the javascript:

<script type="text/javascript" language="javascript">
function player() {
var vlc = document.getElementById("vlcplayer");
vlc.playlist.playItem(0);
}
</script>

If I don't tell the pluginspace etc. in object parameters, how on earth it will be found :D? And how to do that right in XHTML/IE8?

JosHuybrighs
New Cone
New Cone
Posts: 7
Joined: 04 Sep 2010 20:27

Re: VLC embedded to HTML in IE8?

Postby JosHuybrighs » 14 Sep 2010 17:55

Hi,

Not 100% sure but if you say "vlc.playlist is NULL or not an object" then its seems that the activeX plugin is not installed on your machine.
You probably know but you have to enable this when you install VLC on the PC (there is a checkbox somewhere in a window that appears during the installation).

cctvcam
Blank Cone
Blank Cone
Posts: 29
Joined: 20 Jul 2010 15:29

Re: VLC embedded to HTML in IE8?

Postby cctvcam » 15 Sep 2010 11:18

Hi,

I agree the docs aren't great, but I have had what you are trying to do working using the following code.

Code: Select all

var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp", ":no-video-title-show"); try { var id = vlc.playlist.add("rtsp://xxx.xxx.xxx.xxx:554/mpeg4/media.amp", 'camera', options); vlc.playlist.playItem(id); } catch (ex) { alert(ex); }
I think you problem is that you are not specificing the full url/path to your file. I don't think vlc will work with a relative path, but I could be wrong. Also you could always use the param autoplay value="true" to test your media path before you battle with javascript. Hope this helps.

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 15 Sep 2010 19:15

Hi!

Thanks for your replies! However, still the same message... 'playlist' is null or not an object. The weird thing is that when loading a page the first time IE8 asks to allow blocked contect (activex) and I assume that the object should be ok (yes, I allow it). Obviously it isn't. So, the object & js code are now:

Code: Select all

<div id="player"> <object type="application/x-vlc-plugin" id="vlcplayer" width="720px" height="540px" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"> <param name="MRL" value="an_absolute_path_to_my_vlc_generated_playlist\test.xspf" /> <param name="volume" value="100" /> <param name="autoplay" value="true" /> <param name="loop" value="false" /> <param name="fullscreen" value="true" /> </object> </div> <a href="javascript:;" onclick='player();'>Click a vid!</a> <script type="text/javascript" language="javascript"> function player() { var vlc = document.getElementById("vlcplayer"); var options = new Array(":aspect-ratio=4:3", "--rtsp-tcp", ":no-video-title-show"); try { var id = vlc.playlist.add("an_absolute_path_to_the_video_file\Vid1.flv", 'camera', options); vlc.playlist.playItem(id); } catch (ex) { alert(ex); } } </script>
This IS a rocket science!

My actual goal is to create a stand alone DVD including a bunch of vids, an autorun file and an HTML-file, which works as a navigation tree. If a player executable/activex/etc. could be also included that'd be great - then there is no need for an Internet connection. But first things first - how to get that work in IE8?

JosHuybrighs
New Cone
New Cone
Posts: 7
Joined: 04 Sep 2010 20:27

Re: VLC embedded to HTML in IE8?

Postby JosHuybrighs » 16 Sep 2010 10:28

As I replied earlier, I don't think you have the correct ActiveX plugin installed on your machine. The usual way how to get it installed and registered in the Windows registry is to do this by manually installing the whole VLC package. This is at least the way how to do it for the latest versions of the plugin. There used to be an earlier method where the whole package and its plugin could be downloaded through a .cab file but that method doesn't exist anymore.
During installation of VLC, make sure that the ActiveX checkbox is 'checked'. Do the same for the Mozilla checkbox if you also want to allow Firefox (although you then have to embed the plugin in the HTML file using <EMBED...> tags.

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 16 Sep 2010 21:22

Ok, thanks, have to try that. Though it feels a little bit stupid because of I have installed 1.1.4. So to do that I have to uninstall and then re-install it. I'll report here how it went.

*uninstall*
*install, check that ActiveX plugin and Mozilla plugins are checked*

Testing, some coding, testing... hooka-hey, it works!

I can confirm, repeat: I can confirm that the following code works in 32bit Windows7 + IE8, and also follows XHTML 1.0 Transitional. Here we go:

Code: Select all

<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Myvids</title> <link href="main.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="player"> <object type="application/x-vlc-plugin" id="vlcplayer" width="720px" height="540px" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"> <param name="volume" value="100" /> <param name="autoplay" value="true" /> <param name="loop" value="false" /> <param name="fullscreen" value="true" /> </object> </div> <h1>My vids</h1> <ol> <li><a href="javascript:;" onclick='player();'>Click a vid!</a></li> </ol> <script type="text/javascript" language="javascript"> function player() { var vlc = document.getElementById("vlcplayer"); try { var id = vlc.playlist.add("Vid1.flv"); vlc.playlist.playItem(id); } catch (ex) { alert(ex); } } </script> </body> </html>
Thank you for your help!

The next step: has anybody made that standalone DVD, including the player on DVD, or is that just impossible?

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 20 Sep 2010 21:14

An update: I updated to IE9 beta and the player can't be seen anymore... the sounds still work, as well as control buttons, but the actual player and so the vid is missing. Hmmm.

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC embedded to HTML in IE8?

Postby Ilasir » 21 Sep 2010 06:20

It's not surprising that a beta version would have some bugs, though I can't say there isn't a problem with vlc or your code.

jjjj
New Cone
New Cone
Posts: 8
Joined: 09 Sep 2010 22:25

Re: VLC embedded to HTML in IE8?

Postby jjjj » 21 Sep 2010 20:46

Yep, there seems to be some... I'll open a new thread about that =).

mare
New Cone
New Cone
Posts: 2
Joined: 26 Aug 2010 23:42

Re: VLC embedded to HTML in IE8?

Postby mare » 29 Sep 2010 13:28

Embedding VLC in HTML in Iexplore is not rocket science, it's - I M P O S S I B L E.
I tried everything, and I failed.

I also tried registering "VLC" protocol, so that I can at least run VLC from url (like, "vlc://http://www.avifile.com/1.avi"), but the problem I'm facing now with this poor solution is, cmd is launching "C:\Program Files\VideoLan\vlc.exe" "%1", and in this case it turns out to be:

"C:\Program Files\VideoLan\vlc.exe" "vlc://http://www.avifile.com/1.avi",

instead just "http://..."

I'm trying to understand how custom protocols run links... any ideas?

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC embedded to HTML in IE8?

Postby Ilasir » 01 Oct 2010 04:48

Embedding VLC in HTML in Iexplore is not rocket science, it's - I M P O S S I B L E.
I tried everything, and I failed.

That's crap. Depending on what version of vlc and ie you use, it's very simple. Up until IE8 and vlc 1.0.5, it's cake to get a player with the exact same features as any other web player out there.


http://vlcwebcontrolpanel.wordpress.com ... rol-panel/

Check it out.

1.1.x series sucks right now, but the older ones are fine.

mare
New Cone
New Cone
Posts: 2
Joined: 26 Aug 2010 23:42

Re: VLC embedded to HTML in IE8?

Postby mare » 01 Oct 2010 08:51

IE8 and vlc 1.0.5 works fine, you say?

So you're saying, if I build a site with embedded vlc player, I should suggest users to use IE8 and downgrade vlc?
Maybe that will work for some of you guys, but it's not an option for me, my site will not have that type of dedicated visitors...

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: VLC embedded to HTML in IE8?

Postby Ilasir » 03 Oct 2010 02:58

That's a fair point. But there's not much you can do about it, because the plug-ins are basically unsupported features. You might be able to take a route similar to mysoogal, and package the plugin as a separate downloadable control.

http://www.33t.co.cc/?page_id=2

mysoogal
Blank Cone
Blank Cone
Posts: 82
Joined: 28 Oct 2008 12:39

Re: VLC embedded to HTML in IE8?

Postby mysoogal » 15 Oct 2010 02:34

updated the plugin can be downloaded here
http://www.33t.co.cc/?p=85

its a exe installer and only 2mb :mrgreen: supports only theroa but if you want every format supported download vlc 1.0.5 and remove my plugin

and it even works in ie9 :mrgreen:

Image


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 2 guests