Skip to content
This repository has been archived by the owner on Dec 11, 2017. It is now read-only.

2.1.4 throws exception: Cannot read property 'duration' of null w/Chrome browser #25

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

createSound(Sound.MIME_TYPE_AUDIO_WAV_PCM, soundUrl); or 
createSound(Sound.MIME_TYPE_AUDIO_MPEG_MP3, soundUrl); 

throws exception ==> com.google.gwt.core.client.JavaScriptException: 
(TypeError): Cannot read property 'duration' of null 

Environment: 
-- GWT 2.4.0, latest. 
-- gwt-voices 2.1.4. 
-- User Agent (Google Chrome v 15.0.874.120 m) 
-- Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like 
Gecko) Chrome/15.0.874.120 Safari/535.2

Does not happen with IE9. 

See also: 
http://groups.google.com/group/gwt-voices/browse_thread/thread/f3e82b21f486a897

Original issue reported on code.google.com by r...@simplesmartads.com on 16 Nov 2011 at 10:13

@GoogleCodeExporter
Copy link
Author

I'm not able to reproduce this on Chrome Stable 15.0.874.106 (Official Build 
107270) on OSX

Can you include the file you're trying to play?

Original comment by fredsa on 25 Nov 2011 at 5:53

  • Changed state: NeedInfo

@GoogleCodeExporter
Copy link
Author

Is there any solution for this. I am also facing the same issue
<Code>
SoundController soundController = new SoundController();
sound = 
SoundController.createSound(Sound.MIME_TYPE_AUDIO_MPEG,GWT.getHostPageBaseURL()+
"DataSourceServlet?FilePath=C:/Users/Rubini/Desktop/songs/7 Am Arivu/7 Am 
Arivu/Yamma Yamma - TamilWire.com.mp3");
                                //soundController.setPreferredSoundType(WebAudioSound.class);
                //soundController.setPreferredSoundType(Html5Sound.class);
                //soundController.setPreferredSoundType(NativeSound.class);
                //soundController.setPreferredSoundType(FlashSound.class);
 sound.play();
</Code>


throws exception ==> com.google.gwt.core.client.JavaScriptException: 
(TypeError): Cannot read property 'duration' of null 

Environment: 
-- GWT 2.4.0, latest. 
-- gwt-voices 2.1.4. 
-- User Agent (Google Chrome v 15.0.874.121 m) 
-- Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like 
Gecko) Chrome/15.0.874.120 Safari/535.2

Original comment by rubiniku...@gmail.com on 2 Dec 2011 at 11:20

@GoogleCodeExporter
Copy link
Author

Same happened to me on Chrome/15.0.874.121 on Windows 7 and OS X Lion 10.7.2

Original comment by tomasdep...@gmail.com on 5 Dec 2011 at 10:21

@GoogleCodeExporter
Copy link
Author

I add the stacktrace. But the environment is the same.
19:32:26.235 [ERROR] [wanako] Uncaught exception escaped

com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, 
see full set in UmbrellaException#getCauses
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    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:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
    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:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:680)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot 
read property 'duration' of null
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeBoolean(ModuleSpace.java:184)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeBoolean(JavaScriptHost.java:35)
    at com.allen_sauer.gwt.voices.client.WebAudioSound.play(WebAudioSound.java)
    at com.wanako.gwt.client.presenters.SongPlayerPresenter.onGoToMainPage(SongPlayerPresenter.java:33)
    at com.mvp4g.client.Mvp4gModuleImpl$3$1.execute(Mvp4gModuleImpl.java:103)
    at com.mvp4g.client.history.NavigationEventCommand.fireEvent(NavigationEventCommand.java:38)
    at com.mvp4g.client.history.PlaceService.confirmEvent(PlaceService.java:308)
    at com.mvp4g.client.Mvp4gModuleImpl$3.confirmNavigation(Mvp4gModuleImpl.java:132)
    at com.mvp4g.client.Mvp4gModuleImpl$3.goToMainPage(Mvp4gModuleImpl.java:97)
    at com.wanako.gwt.client.presenters.LoginPresenter.onLogin(LoginPresenter.java:44)
    at com.wanako.gwt.client.views.LoginView.onLoginClick(LoginView.java:64)
    at com.wanako.gwt.client.views.LoginView_LoginViewUiBinderImpl$1.onClick(LoginView_LoginViewUiBinderImpl.java:47)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    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:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
    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:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:680)

Original comment by tomasdep...@gmail.com on 5 Dec 2011 at 10:38

@GoogleCodeExporter
Copy link
Author

There are some Web Audio API fixes in the 2.1.5 release which will hopefully 
resolve this issue. I'd be interested in hearing your findings.

Original comment by fredsa@google.com on 9 Dec 2011 at 12:42

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

In particular 2.1.5 fixes two Web Audio API (which affects Chrome) issues:

1. immediately calling `sound.play()` after creating the sound `Sound sound = 
soundController.createSound()` would throw an exception

2. If the sound file URL was invalid or the retrieval of the audio file failed, 
the calling `sound.play()` would throw an exception

Original comment by fredsa on 9 Dec 2011 at 5:07

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant