0

i'm trying my damndest to get a video to .show() by doing just that and start playing with the sendEvent('play') method to the player (originally loaded with a false autostart) but nothing seems to be working. from what i understand, it's pretty straightforward. can anyone shed some light? i really need this working, as this page is supposed to drop in a few hours. thanks in advance.

fyi, i am also using a state listener, but that's not doing the trick and it doesn't look like a state gets published when it's first loaded. i'm thinking i need to do a short delay and then sendEvent?

0

1 Answer 1

1

I think this is related to the fact that your Flash player isn't visible. You'll need to call $(player).show() and wait for the playerReady callback. This will look something like:

<embed id='player' name='player' src='player.swf' width='470' height='320' bgcolor='#000000' allowscriptaccess='always' allowfullscreen='true' flashvars='file=video.mp4' />

<script type="text/javascript">
$('#player').show();

function playerReady(obj) {
    var player = document.getElementById(obj['id']).play();
    player.setModelListener('STATE', stateCallback);
}

function stateCallback(evt){
    //TODO: Your code here
}
</script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.