com.bramosystems.oss.player.core.client.ui.QuickTimePlayer.playMedia

49 views
Skip to first unread message

Robo

unread,
May 10, 2011, 12:42:08 AM5/10/11
to bst-player
17:54:15.196 [ERROR][ctemediaplayer] Uncaught exception escaped

com.google.gwt.core.client.JavaScriptException: (TypeError): this.Play
is not a function
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript
(BrowserChannelServer.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke
(ModuleSpaceOOPHM.java:132)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative
(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid
(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid
(JavaScriptHost.java:107)
at com.bramosystems.oss.player.core.client.impl.QuickTimePlayerImple
$.play$(QuickTimePlayerImple.java)
at
com.bramosystems.oss.player.core.client.ui.QuickTimePlayer.playMedia
(QuickTimePlayer.java:327)
at com.mydomain.packagename.client.CTEMediaPlayer.playMediaList
(CTEMediaPlayer.java:568)
at com.mydomain.packagename.client.CTEMediaPlayer.access$12
(CTEMediaPlayer.java:539)
at com.mydomain.packagename.client.CTEMediaPlayer$3.onSuccess
(CTEMediaPlayer.java:411)
at com.mydomain.packagename.client.CTEMediaPlayer$3.onSuccess
(CTEMediaPlayer.java:1)
at
com.google.gwt.gdata.client.impl.CallbackHelper.handleSuccessCallback
(CallbackHelper.java:61
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke (MethodAdaptor.java:
103)
at com.google.gwt.dev.shell.MethodDispatch.invoke
(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke
(OophmSessionHandler.java:167)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages
(BrowserChannelServer.java:281)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection
(BrowserChannelServer.java:531)
at com.google.gwt.dev.shell.BrowserChannelServer.run
(BrowserChannelServer.java:352)
at java.lang.Thread.run (Thread.java:680)

========== Code Starts Below =====>>>

private void playMediaItem() {
VerticalPanel mainPanel = new VerticalPanel();
Widget player = null;
try {
// create the player per example code found at:
// NOTE: URL/mymediafile.mov file verified to run in Firefox
quicktime plugin
player = new QuickTimePlayer( "www.example.com/mymediafile.mov",
false, "400px", "500px");
} catch(LoadException e) {
// catch loading exception and alert user
Window.alert("An error occured while loading");
} catch(PluginVersionException e) {
// catch plugin version exception and alert user, possibly
providing a link
// to the plugin download page.
player = new HTML(".. some nice message telling the user to
download plugin first ..");
} catch(PluginNotFoundException e) {
// catch PluginNotFoundException and tell user to download
plugin, possibly providing
// a link to the plugin download page.
player = new HTML(".. another kind of message telling the user
to download plugin..");
}
mainPanel.insert(player, 1); // place in main panel of display
// NOTE: player.playMedia() below causes above mentioned
exception; when commented out no exception
try {
// ((QuickTimePlayer) player).playMedia();
((AbstractMediaPlayer) player).playMedia();
Window.alert("playMediaList after playMedia() ");
} catch (PlayException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Window.alert("PlayException in playMediaList: " + e.getMessage());
}
}

Sikiru Braheem

unread,
May 10, 2011, 6:07:51 AM5/10/11
to bst-p...@googlegroups.com
Hi,

Calling playMedia() immediately after adding player to panel will always
throw exceptions because it takes some time before the media plugin is
ready. so you can either:
- use autoplay as true when creating the player, or
- register a PlayerState handler on the player and then call playMedia()
after the PlayerStateEvent.State.Ready is called.

Hope that helps
Regards.

Robert Owens

unread,
May 10, 2011, 2:54:05 PM5/10/11
to bst-p...@googlegroups.com
Sikiru,

Thanks for your reply. I had this all working before, but after Apple updated their Java that cause problems for many Google Java API users and I updated to new GWT, App Engine and your media player APIs then the media play was no longer working. I am attempting to find why and am implementing the simplest example I can find to work it out. I will try changing to auto play to see if that runs. Other wise I get no error messages, the window opens, it says media has loaded and no play control buttons or movie appear. I will post again if I can't get working. Thank you very much. Robo

--
You received this message because you are subscribed to the Google Groups "bst-player" group.
To post to this group, send an email to bst-p...@googlegroups.com.
To unsubscribe from this group, send email to bst-player+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bst-player?hl=en-GB.


Robert Owens

unread,
May 10, 2011, 10:20:22 PM5/10/11
to bst-p...@googlegroups.com
Hi,

Please see if you can suggest what is keeping me from seeing mov file from playing/displaying And no player control buttons, like play. No errors, warning or other on hosted dev mode console when this runs.

Code:

    private void initPlayer() {

        VerticalPanel mainPanel = new VerticalPanel();
        player = null;
       
        try {
             // get any player that can playback media
             player = PlayerUtil.getPlayer(Plugin.Auto,
                        "http://www.my_url.com/mn/SaltonSequence.mov",
                        true, "400px", "500px");

             mainPanel.insert(player, 1);    // place in main panel of display
        } catch(LoadException e) {
             // catch loading exception and alert user
             Window.alert("An error occured while loading");
        } catch (PluginVersionException e) {
             // catch PluginVersionException, thrown if required plugin version is not found
            mainPanel.insert(PlayerUtil.getMissingPluginNotice(e.getPlugin()), 1);
        } catch(PluginNotFoundException e) {
             // catch PluginNotFoundException, thrown if no plugin is not found
            mainPanel.insert(PlayerUtil.getMissingPluginNotice(e.getPlugin()), 1);
        }
        player.setTitle("TEST PLAY");

        mainPanel.insert(player, 1);    // place in main panel of display
    }

On an there is a little error-typo in http://oss.bramosystems.com/bst-player/getting-started.html for PlayerUtil class example. See
PluginVersionException ex VERSES e.getPlugin()

Context:
} catch (PluginVersionException ex) {
     // catch PluginVersionException, thrown if required plugin version is not found
     panel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin()));
} catch(PluginNotFoundException e) {
Thank you very much for your time and prompt response.
R
Reply all
Reply to author
Forward
0 new messages