Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Local addModelListener problem

5 replies [Last post]

I've read a few threads here and found that someone else was having a similar problem, with playerReady not working locally.

I can't find any reference to whether addModelListener should work locally.

I'm using

player = document.getElementById('playerID');
player.addModelListener("STATE", "stateListener");

My code is fine, it runs on a webserver okay, but unfortunately that's not how I want to use the script.
Locally it just gives me the error "player.addModelListener is not a function"

Is there any workaround for this, or any alternative of adding a listener in a script run locally?
Thanks!

Due to Adobe Flash Player security restrictions, browser JavaScript sandboxing, etc., the JavaScript API isn't functional offline.

I cant get playerReady() to fire OR get addModelListener to work. addModelListener 'is not a function'.

I'm so goddamned frustrated with this POS. ALL I WANT IS TO CHECK IF THE DAMNED THING IS PLAYING OR NOT.

You'll need to wait for playerReady before you can add the listener, ie

try {
var myReady = playerReady;
} catch (err){
}

playerReady = function(obj) {
// Insert your code here
player = document.getElementById('playerID');
player.addModelListener("STATE", "stateListener");
try {
myReady(obj);
} catch (err){
}
}

So if I want to create a playlist in JS but 'offline' (my users run this from a CD directly) then do I have any options left? I am tearing my hair out.

You're fine if you run everything from a CD. Flash's security model just doesn't allow you to mix and match network and disk access.