Page 1 of 4

New Unified APIs for ActiveX and Mozilla plugins for 0.8.6

Posted: 13 Dec 2006 11:17
by Quovodis
Some people may already know about it, but i've been quite busy reworking the APIs for the plugins. These were originally expected for the big 0.9.0 release. But since it would not come for a long time, we decided to give you a preview of things to come regarding the plugins on 0.9.0.
Both the plugins are backward compatible with their old APIs, so anything you designed for 0.8.5 should also work for 0.8.6.
To use the new plugins APIs, you will need to supply a special embed tag to the mozilla plugin in the form of 'progid="VideLAN.VLCPlugin.2". As for the ActiveX plugin, a new class ID must be used: {9BE31822-FDAD-461B-AD51-BE1D1C159921}

the documentation is a bit sketchy at the moment, but you can always look at the new mozilla plugin APIs at

http://www.videolan.org/doc/play-howto/ ... l#id293992

which also covers ActiveX on Internet Explorer as the APIs are now unified :)

During the development of the plugins, i've also written a unified test page, which should give you a good view of the plugins ability on Internet Explorer, Firefox, Opera and Safari and these were tested on Windows, Linux and MacOS X. The test page is located at:

http://people.videolan.org/~damienf/plugin-0.8.6.html

Feel free to reuse the source of this page in your own projects.

For those who are using the ActiveX plugin on VB, .NET. etc... I unfortunately didn't update the APIs on the ActiveX wiki, and this is unlikely to happen before 2007.
Therfore, I invite you to look at the Javascript APIs for Mozilla at the above links (same APIs different language); I you can't dig Javascript, then you can also have a look at the IDL header for those APIs:

http://trac.videolan.org/vlc/browser/ta ... /axvlc.idl

Since I am mostly the only developer for those plugins, I need a lot of help regarding testing, so help me making a great 0.9.0 release and get the bugs rolling ( http://trac.videolan.org )

Posted: 13 Dec 2006 14:16
by zvona
Thank you for the resources.

I noticed at least following functions I'm using caused errors in 0.8.6:
Moz
oVLC.play();
oVLC.stop();
oVLC.clear_playlist();
oVLC.add_item(MRL);

ActiveX
oVLC.addTarget(MRL, options);


Therefore I'm currently making following check:

Code: Select all

if (typeof oVLC.playlist != "undefined") // do things for 0.8.5.1> Plugin else // do things for 0.8.5.1< Plugin

Posted: 13 Dec 2006 14:39
by Quovodis
zvona,

I don't understand what you mean, the old apis should still work with 0.8.6, you need to explicitly set the following to use the new APIs
<EMBED pluginspage="http://www.videolan.org"
type="application/x-vlc-plugin"
progid="VideoLAN.VLCPlugin.2"
width="640"
height="480"
name="vlc">
does the following page works for you:

http://people.videolan.org/~dionoea/vlc ... height=180

Posted: 13 Dec 2006 14:51
by zvona
Quovodis,

your example works on 0.8.6. but will cause Mozilla 0.8.5. to crash and won't work on ActiveX 0.8.5. at all.

Perhaps I'm having something wrong on implementation of VLC-player (note MRL is coming thru script):

Code: Select all

<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" id="vlcIE" events="True"> <param name="MRL" value="" /> <param name="ShowDisplay" value="True" /> <param name="AutoLoop" value="False" /> <param name="AutoPlay" value="true" /> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" progid="VideoLAN.VLCPlugin.2" name="vlcMoz" id="vlcMoz" autoplay="true" loop="yes" hidden="no" /> </object>

Posted: 13 Dec 2006 14:57
by Quovodis
ok, i know what you mean, may be you should try the following:

Code: Select all

if (typeof oVLC.VersionInfo == "undefined") // do things for 0.8.5 and before else if (oVLC.VersionInfo.indexOf("0.8.6") != -1 ) // do things for 0.8.6 else (oVLC.VersionInfo.indexOf("0.9.0") != -1 ) // do things for 0.9.0, etc...

Posted: 13 Dec 2006 15:12
by Quovodis
for activex, you can try the following

Code: Select all

// VLC detection. for(var i=2; i>0; i--){ vlcVersion = 0; try{ var oVLC = new ActiveXObject("VideoLAN.VLCPlugin." + i); vlcVersion = i; return; } catch(e){ } }
if i == 1, you got the old APIs
if i == 2, you got the new APIs
if i == 0, you got no VLC at all !

mozilla plugin turning filters on/off

Posted: 13 Dec 2006 19:30
by chairman
Hi

I have asked the question before, but I didn't get a answer, not even a NO, it's not possible so I will ask again.

Is it possible to turn on/off a filter while a movie is playing with javascript.

For example turn on a logo., and off again, have some overlayed text and remove it again.

The thing is that I want to make a ajax page that shows a movie and when somethings happens I want to do things with a movie.

Posted: 14 Dec 2006 10:14
by Quovodis
no, you can't, this is on the TODO list for 0.9.0

Posted: 14 Dec 2006 16:30
by chairman
no, you can't, this is on the TODO list for 0.9.0
I'm looking forward to the new feature! I hope it will appear in cvs soon :)

Posted: 16 Dec 2006 00:10
by Cooldream
Hello,
Thanks for your development...
That new ActiveX seem to be good with VB.
It would be two very interest function :
To have vlc.video.crop in complement of vlc.video.aspectRatio
To be able to change audio track without stop playing.

Posted: 18 Dec 2006 10:37
by Quovodis
this is likely to happen for 0.9.0, but code patches are always welcome if you want these to happen earlier in trunk

Posted: 18 Dec 2006 19:30
by Tappen
I'd like to add this code but it's too difficult to develop for Vlc on Windows. It was easy enough to add even using C# and .Net interop.

Posted: 23 Dec 2006 13:41
by siger
i don't understand anything about the firefox plugin for windoxs. i don't find the folder of the files for the plugin and the plugin don't work in firefox. i'm fed up with window media player on the web.

How is it possible to ahve the vlc plugin. Will it be avalaible soon ?

0.8.6 Mozilla plugin unstable?

Posted: 25 Dec 2006 22:14
by ecastsw
I have the mozilla plugin playing a mpg file. While its still playing hit the reload button and if it restarts hit the reload button again...

After couple tries, it starts to hog CPU and then finally go into a hung state...

Any ideas? Go back to 0.8.5?

Also can you please let me know if streaming is supposed to work from the plugin? Its not working for me. Just a yes/no answer on whether this is supported would be acceptable.

Thanks in advance.
Cheers.

Posted: 25 Dec 2006 22:25
by siger
i also want to come back to the 0.8.5 version because there was the firefox plugin but i don't find it.

Posted: 26 Dec 2006 00:21
by Spellcoder
ecastsw: The problem you describe is probably the one I reported in this ticket:
Ticket #908: Firefox crashes when reloading page while VLC plugin plays video

On the iMac version it (reloading while playing a video) almost allways causes a crash, on Windows I seem to have a 30% chance on a lockup or crash/exit. Firefox seems to be affected most, but Safari and Opera also crash. For me going back to 0.8.5 is not an option though, I need the new possibilities in the 0.8.6 plugin.

Maybe stopping the video on the unload event would help to prevent the lockup? (havn't tried that yet)
Something like: <body onunload='document.getElementById('vlc').playlist.stop()'>

Siger: I usually copy the Mozilla plugin from the non-installer version (.zip or .7z) . Under the map mozilla there's the npvlc.dll file which you need to copy to the Firefox/plugins map.
To get the 0.8.6 plugin working you also need to either have VLC fully installed or have copied libvlc.dll and all files from the vlc/plugins map to the firefox/plugins map.
You can find the non-installer versions here:
http://downloads.videolan.org/pub/vlc/0.8.6/

Agreed.. Found out some more details...

Posted: 26 Dec 2006 09:29
by ecastsw
Thanks for your response:

Now I can consistently get it to freeze/crash:

All you have to do is to create two browser tabs and load a plugin on each of them and then reload one of the tabs while the mpg is still playing...

Posted: 26 Dec 2006 09:32
by ecastsw
Stopping on unload sounds like a great idea. Let me try that...

In the meantime: Do you have an answer for me on streaming via the plugin?

Today, I tried the activeX as well and it doesn't seem to be streaming or saving to local disk.

problems in java

Posted: 26 Dec 2006 20:33
by remmeier
There seems to be a problem when it is used with Java/SWT and Windows:

frame = new OleFrame(parent, SWT.NONE);
OleControlSite controlSite = new OleControlSite(frame, SWT.NONE, "VideoLAN.VLCPlugin.1");
controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE | OLE.OLEIVERB_HIDE);

doVerb(...) shows a modal console window saying that content is stored in
vlc-help.txt. After closing the console the complete application exits.
It works fine with 0.8.5, but not with 0.8.6. Using "VideoLAN.VLCPlugin.2" does not help either. Any ideas?

By the way I also tried to use JVLC. However, the version from June crashes the complete system after a few minutes :-( There seem to be some improvements (e.g. on crash bug fixed), but there is no new release. I tried to compile it myself, but it seems to be way beyond my
c++ & linux skills... Does anybody has a working build? In this case I would require neither SWT nor ActiveX :-)

Thanks, Remo

Posted: 27 Dec 2006 12:04
by zvona
Maybe stopping the video on the unload event would help to prevent the lockup? (havn't tried that yet)
Something like: <body onunload='document.getElementById('vlc').playlist.stop()'>
I've implemented this idea in other way: I don't append the VLC object into document until the whole document and it's other objects are properly initiated. This reduced the amount of crashes both in IE and FF in cases where document is refreshed.

Posted: 27 Dec 2006 15:21
by Allclone
Thanks for all the updates, Just started to play with the java script and create something I can use on all my platforms, which are the top 3, and its going great.

One odd question and I'm not sure if it should be handled inside the plug-in or externally, is there a way to list content in the current vlc.playlist? I know there is the itemCount but that will only tell me how many are in the list.

Thanks so much to you and the VideoLAN team, its always being improved, and I love being able to use one application on all my platforms, Thank You.

Posted: 30 Dec 2006 07:28
by ecastsw
I do remember seeing a getPlayListItem, however could not find a function that is exposed...

I am sure its there, need to dig some more. I will let you know if I figure it out.

In the meantime: I have been managing my own playlist object and keep it in sync based on play, next previous.. button clicks...

Posted: 30 Dec 2006 07:50
by Allclone
I would love to hear back with what ever you find, I two was thinking about creating a java based mirrored list that would keep track of the playlist outside the plugin, as a way to manipulate the list later. What is yours written in? And if nothing turns up in the plugin itself or is not added to the API later. Could you share with me what you have I'm always looking to improve code/scripts?

I too in my free time will look threw some of the code and documentation to see if I can find anything.

Thanks.

Posted: 30 Dec 2006 14:11
by divx118
Correct me if i am wrong but it is not there in the new activeX only in the old 0.8.5 .
I think we just have to wait until an update or like ecastsw keep track of the playing item ourselfs.

It would also be great if the get/setVariable returns in the new activeX

By the way i love the new activeX it works great and is very stable.
My thanks to the developer Quovodis for the good work on this :D

Maurice 8)

Posted: 02 Jan 2007 16:45
by Quovodis
There seems to be a problem when it is used with Java/SWT and Windows:

frame = new OleFrame(parent, SWT.NONE);
OleControlSite controlSite = new OleControlSite(frame, SWT.NONE, "VideoLAN.VLCPlugin.1");
controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE | OLE.OLEIVERB_HIDE);

doVerb(...) shows a modal console window saying that content is stored in
vlc-help.txt. After closing the console the complete application exits.
It works fine with 0.8.5, but not with 0.8.6. Using "VideoLAN.VLCPlugin.2" does not help either. Any ideas?
this sounds like a bug in the VLC plugin, i've heard of other related issues. Unfortunately, I haven't been able to reproduce this problem, so i'm guessing this problem is specific to your machine. Can you give me some details about your locale, VLC install path, app working directory, etc..

ideally, you should try to enable logging on VLC preferences panel and post the result.

to use message logging:

input a file name:
Preferences -> Advanced -> Logging: Log filename

enable logger (With advanced options)
Preferences -> Interface : Log to file

Save and restart your SWT app