Page 1 of 1

TypeConflict when registering a VLC event

Posted: 21 May 2010 11:15
by shatterator
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...

Re: TypeConflict when registering a VLC event

Posted: 25 May 2010 10:48
by shatterator
Does none of you had this problem or has any suggestions how to solve it. Or tell me what I'm doing wrong?

Re: TypeConflict when registering a VLC event

Posted: 14 Dec 2010 11:14
by kenig
Try removing the brackets when calling registerVLCEvent:
registerVLCEvent('MediaPlayerPlaying', initPlayer);
instead of registerVLCEvent('MediaPlayerPlaying', initPlayer());