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");
}
}
};