Hi. I don't know any javascript and am building an ajax app with gwt
to play youtube videos.

In gwt, have a class that loads the movie in an embedded player, using
this method:

        public static native void initializePlayer(String movieID, String
divID,
                        int width, int height) /*-{
          $wnd.initializePlayer(movieID, divID, width, height);
        }-*/;

I also added the next method, to be called by the youtube player when
an event occurs

        public static void playerStateChange(int newState) {
                System.out.println("Player in a new state" + newState);
        }

(non-static would be much better, but at least this should work).

I have a js file with methods copied from
http://code.google.com/apis/youtube/chromeless_example_1.html. The
only method I added is the following, according to explanations on the
gwt-Developer's Guide:

function onytplayerStateChange(newState) {
        alert("Player's new state: " + newState);
        @jukebox.client.JukeboxUI::playerStateChange(I)(newState);
}

When trying to run this in HostedMode, an error is thrown:
com.google.gwt.core.client.JavaScriptException: (TypeError): Value
undefined (result of expression $wnd.initializePlayer) is not object.

The initializePlayer js method is working fine if I comment out the
@jukebo.... line in the listener.

What generates this error? How can I avoid it? Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to