Page 1 of 1

activeX 0.8.6 get/setVariable

Posted: 27 Dec 2006 19:32
by divx118
Is the get/setVariable dropped in the new activeX?
I use the following but it doesn't work.
var vlc = document.getElementById("vlc")
var x = vlc.getVariable("key-fullscreen");
vlc.setVariable("key-pressed", x)
I am rewriting my VLC plugin for MCE and it would be great to handle some hotkey functions from javascript.
If it doesn't work anymore I will find some other way.

Maurice :)

Posted: 28 Dec 2006 01:48
by Tappen
The ActiveX control still supports the IVLCControl interface, it's just that the IVLCControl2 interface is now the default you get when you create the object. I'm not sure how you'd get Javascript to do the QueryInterface on the ActiveX object to give you the old interface to call though, sorry.

Posted: 28 Dec 2006 18:40
by divx118
Thanks for the reply,

Would it be possible to use both interfaces at the same time or do i have to stick to one?
I will see if i get the old interface to work in javascript.

Maurice :)

Posted: 29 Dec 2006 17:54
by divx118
The ActiveX control still supports the IVLCControl interface, it's just that the IVLCControl2 interface is now the default you get when you create the object. I'm not sure how you'd get Javascript to do the QueryInterface on the ActiveX object to give you the old interface to call though, sorry.
I did some testing, but I think it will not work if you want the old interface on the new object.
What I did find out that you can use the getVariable() if you create a new activeXobject like the following.
var vlcOld=new ActiveXObject("VideoLAN.VLCPlugin.1");
function getVariableVLC(parString)
try {
var x = vlcOld.getVariable(parString);
return x;
}
catch (e)
{
alert(e+" : "+e.description)
getVariableVLC(parString)
}
You will see that the second time the correct value will return. At least that was the case on my machine. Maybe it will be of some use to someone.
I will see if i find some other way to call my needed vlc-functions, because i don't want to use the old object it is sometimes a little unstable.

Maurice :)

Posted: 31 Dec 2006 05:53
by Tappen
I found this on the M$ website:
The Default Interface

Every public member (any member not marked as private or friend) of a class is part of that class's default interface.

Important things to note about default interfaces:

1. The default interface of a class is the only interface that scripting languages can access.
2. The default interface of a class is the only one that can be late bound to. If you assign a reference of your object to a variable that is a variant or object (for example, Dim x as Object) and class a method off that variable, late binding is used.

Points 1 and 2 are actually stating the same thing (because VBScript and JavaScript languages use variants and only support late binding).

Public members of a class are members of the default interface. The default interface supports early and late binding by consumers of the class.

http://msdn.microsoft.com/library/defau ... dvbcom.asp
So no, you can't get the old interface from the new object with Javascript. They'll have to add the functions to the new interface.

Posted: 31 Dec 2006 10:53
by divx118
:) Thanks Tappen for the answer.

Maurice

getVariable

Posted: 02 May 2007 14:53
by nayanvora
Hi there,

Is there any way that i can get the list of title , chapters, tracks etc details using getVariable from any dvd ?

or how can i use getVariable to get the data from currently running dvd ?

nayan_vora@yahoo.com