We have this video player that offers the ability to catch events that it
throws in different situations. I have an example snippet of javascript
from the player. I'm struggling to set it up and wondering if anyone can
tell me why its failing?
Here is the working javascript example from the player team:
<script type="text/javascript">
var flowplayer = new Object();
flowplayer.fireEvent = function(objectID, event, obj1, obj2, obj3, obj4) {
if (event == "onLoad") {
alert("player has loaded");
} else if (event == "onPause") {
alert("paused at:" + document.getElementById("embedded_player").fp_getTime
());
} else if (event == "onCuepoint") {
alert("cuepoint: " + obj2 + ", timestamp: " + obj3);
} else if (event == "onPluginEvent" && obj1 == "bwcheck") {
alert("plugin event: " + obj2 +", URL: " + obj3["url"]+", width: " + obj3[
"width"]);
}
}
</script>
Here is my native call that is failing:
- The exception is indicating that player is null. I have similar calls
that are working but in all cases that it works the player var is set
inside the function. Can I create a function inside of a function?
private native void nativePlayerEventFiring(VideoDetailsDesktopView ud) /*-{
var player = $wnd.document.getElementById("embedded_player");
player.fireEvent = function(objectID, event, obj1, obj2, obj3, obj4) {
if (event == "onStart") {
[email protected]::setPlaying();
} else if (event == "onFinish" || event == "onStop") {
[email protected]::setStopped();
}
};
}-*/;
I wish I knew more javascript! Thanks in advanced for any help.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.