New Unified APIs for ActiveX and Mozilla plugins for 0.8.6

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

New Unified APIs for ActiveX and Mozilla plugins for 0.8.6

Postby Quovodis » 13 Dec 2006 11:17

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 )

zvona
Blank Cone
Blank Cone
Posts: 11
Joined: 30 Oct 2006 10:32
Location: Helsinki

Postby zvona » 13 Dec 2006 14:16

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
Zvona

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 13 Dec 2006 14:39

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

zvona
Blank Cone
Blank Cone
Posts: 11
Joined: 30 Oct 2006 10:32
Location: Helsinki

Postby zvona » 13 Dec 2006 14:51

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>
Zvona

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 13 Dec 2006 14:57

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...

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 13 Dec 2006 15:12

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 !

chairman
New Cone
New Cone
Posts: 4
Joined: 27 Feb 2006 19:47

mozilla plugin turning filters on/off

Postby chairman » 13 Dec 2006 19:30

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.

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 14 Dec 2006 10:14

no, you can't, this is on the TODO list for 0.9.0

chairman
New Cone
New Cone
Posts: 4
Joined: 27 Feb 2006 19:47

Postby chairman » 14 Dec 2006 16:30

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

Cooldream
Blank Cone
Blank Cone
Posts: 12
Joined: 08 Sep 2006 09:55

Postby Cooldream » 16 Dec 2006 00:10

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.

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 18 Dec 2006 10:37

this is likely to happen for 0.9.0, but code patches are always welcome if you want these to happen earlier in trunk

Tappen
Cone that earned his stripes
Cone that earned his stripes
Posts: 150
Joined: 30 Oct 2006 07:55

Postby Tappen » 18 Dec 2006 19:30

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.

siger
Blank Cone
Blank Cone
Posts: 16
Joined: 04 Nov 2006 19:09
VLC version: 0.8.6
Operating System: windows
Location: France
Contact:

Postby siger » 23 Dec 2006 13:41

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 ?

ecastsw
New Cone
New Cone
Posts: 7
Joined: 18 Dec 2006 22:47

0.8.6 Mozilla plugin unstable?

Postby ecastsw » 25 Dec 2006 22:14

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.

siger
Blank Cone
Blank Cone
Posts: 16
Joined: 04 Nov 2006 19:09
VLC version: 0.8.6
Operating System: windows
Location: France
Contact:

Postby siger » 25 Dec 2006 22:25

i also want to come back to the 0.8.5 version because there was the firefox plugin but i don't find it.

Spellcoder
Blank Cone
Blank Cone
Posts: 57
Joined: 19 Apr 2006 12:21
Location: Hengelo // The Netherlands
Contact:

Postby Spellcoder » 26 Dec 2006 00:21

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/

ecastsw
New Cone
New Cone
Posts: 7
Joined: 18 Dec 2006 22:47

Agreed.. Found out some more details...

Postby ecastsw » 26 Dec 2006 09:29

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...

ecastsw
New Cone
New Cone
Posts: 7
Joined: 18 Dec 2006 22:47

Postby ecastsw » 26 Dec 2006 09:32

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.

remmeier
New Cone
New Cone
Posts: 6
Joined: 26 Dec 2006 20:15

problems in java

Postby remmeier » 26 Dec 2006 20:33

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

zvona
Blank Cone
Blank Cone
Posts: 11
Joined: 30 Oct 2006 10:32
Location: Helsinki

Postby zvona » 27 Dec 2006 12:04

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.
Zvona

Allclone
New Cone
New Cone
Posts: 9
Joined: 13 Nov 2005 22:59
Location: Kazoo
Contact:

Postby Allclone » 27 Dec 2006 15:21

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.

ecastsw
New Cone
New Cone
Posts: 7
Joined: 18 Dec 2006 22:47

Postby ecastsw » 30 Dec 2006 07:28

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...

Allclone
New Cone
New Cone
Posts: 9
Joined: 13 Nov 2005 22:59
Location: Kazoo
Contact:

Postby Allclone » 30 Dec 2006 07:50

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.

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Postby divx118 » 30 Dec 2006 14:11

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)

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 02 Jan 2007 16:45

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


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 6 guests