TypeConflict when registering a VLC event

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
shatterator
New Cone
New Cone
Posts: 5
Joined: 11 May 2010 14:33

TypeConflict when registering a VLC event

Postby shatterator » 21 May 2010 11:15

Hi,

I'm trying to catch some events raised by VLC. I've read the doc and implemented the sample code but it won't work as it should. For some reason I'm getting a JavaScript Type conflict error at vlc.attachEvent (event, handler);.

Here is a part of my code:

Code: Select all

function doGo(targetURL) { var vlc = document.getElementById("vlc"); var options = new Array(":start-time=0", ":vout-filter=deinterlace", ":deinterlace-mode=linear", ":input-fast-seek"); vlc.playlist.clear(); vlc.playlist.add(targetURL, null, options); vlc.playlist.play(); setTimeout("initSliders()",100); registerVLCEvent('MediaPlayerPlaying', initPlayer()); }; function registerVLCEvent(event, handler) { var vlc = document.getElementById("vlc"); if (vlc) { if (vlc.attachEvent) { // Microsoft vlc.attachEvent (event, handler); } else if (vlc.addEventListener) { // Mozilla: DOM level 2 vlc.addEventListener (event, handler, false); } else { // DOM level 0 eval("vlc.on" + event + " = handler"); } } };
Has anyone else had this problem before and solved it? Or am I doing something wrong? Thanks for helping...

shatterator
New Cone
New Cone
Posts: 5
Joined: 11 May 2010 14:33

Re: TypeConflict when registering a VLC event

Postby shatterator » 25 May 2010 10:48

Does none of you had this problem or has any suggestions how to solve it. Or tell me what I'm doing wrong?

kenig
Blank Cone
Blank Cone
Posts: 12
Joined: 14 Oct 2009 16:27

Re: TypeConflict when registering a VLC event

Postby kenig » 14 Dec 2010 11:14

Try removing the brackets when calling registerVLCEvent:
registerVLCEvent('MediaPlayerPlaying', initPlayer);
instead of registerVLCEvent('MediaPlayerPlaying', initPlayer());


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 13 guests