ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Exoplayer Crash if we stop the wifi in the mid of movie

Open sachinbhanot opened this issue 12 years ago • 4 comments

How to handle the crash or exception? where to handle it?

11-26 21:47:02.948: E/ExoPlayerImplInternal(13168): Internal track renderer error. 11-26 21:47:02.948: W/System.err(13168): com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://vod.hdi.cdn.ril.com/vod/definst/smil:hdivod/4/283/and_0_lokgqq8o.smil/media_b232000_464.ts?uid=239&action=&srv=hdivod3&sid=&cid=0_lokgqq8o 11-26 21:47:02.948: W/System.err(13168): at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:413) 11-26 21:47:02.948: W/System.err(13168): at com.google.android.exoplayer.MediaCodecAudioTrackRenderer.doSomeWork(MediaCodecAudioTrackRenderer.java:279) 11-26 21:47:02.956: W/System.err(13168): at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:404) 11-26 21:47:02.956: W/System.err(13168): at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:209) 11-26 21:47:02.956: W/System.err(13168): at android.os.Handler.dispatchMessage(Handler.java:95) 11-26 21:47:02.956: W/System.err(13168): at android.os.Looper.loop(Looper.java:137) 11-26 21:47:02.956: W/System.err(13168): at android.os.HandlerThread.run(HandlerThread.java:60) 11-26 21:47:02.964: W/System.err(13168): at com.google.android.exoplayer.ExoPlayerImplInternal$1.run(ExoPlayerImplInternal.java:110) 11-26 21:47:02.964: W/System.err(13168): Caused by: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://vod.hdi.cdn.ril.com/vod/definst/smil:hdivod/4/283/and_0_lokgqq8o.smil/media_b232000_464.ts?uid=239&action=&srv=hdivod3&sid=&cid=0_lokgqq8o 11-26 21:47:02.964: W/System.err(13168): at com.google.android.exoplayer.upstream.HttpDataSource.open(HttpDataSource.java:236) 11-26 21:47:02.964: W/System.err(13168): at com.google.android.exoplayer.upstream.DataSourceStream.load(DataSourceStream.java:223) 11-26 21:47:02.964: W/System.err(13168): at com.google.android.exoplayer.hls.HlsChunk.load(HlsChunk.java:173) 11-26 21:47:02.972: W/System.err(13168): at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:206) 11-26 21:47:02.972: W/System.err(13168): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) 11-26 21:47:02.972: W/System.err(13168): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 11-26 21:47:02.972: W/System.err(13168): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 11-26 21:47:02.979: W/System.err(13168): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 11-26 21:47:02.979: W/System.err(13168): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 11-26 21:47:02.979: W/System.err(13168): at java.lang.Thread.run(Thread.java:856) 11-26 21:47:02.979: W/System.err(13168): Caused by: java.net.UnknownHostException: Unable to resolve host "vod.hdi.cdn.ril.com": No address associated with hostname 11-26 21:47:02.987: W/System.err(13168): at java.net.InetAddress.lookupHostByName(InetAddress.java:394) 11-26 21:47:02.995: W/System.err(13168): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236) 11-26 21:47:02.995: W/System.err(13168): at java.net.InetAddress.getAllByName(InetAddress.java:214) 11-26 21:47:02.995: W/System.err(13168): at libcore.net.http.HttpConnection.(HttpConnection.java:70) 11-26 21:47:02.995: W/System.err(13168): at libcore.net.http.HttpConnection.(HttpConnection.java:50) 11-26 21:47:02.995: W/System.err(13168): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpEngine.connect(HttpEngine.java:310) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289) 11-26 21:47:03.003: W/System.err(13168): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239) 11-26 21:47:03.011: W/System.err(13168): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80) 11-26 21:47:03.011: W/System.err(13168): at com.google.android.exoplayer.upstream.HttpDataSource.makeConnection(HttpDataSource.java:386) 11-26 21:47:03.011: W/System.err(13168): at com.google.android.exoplayer.upstream.HttpDataSource.open(HttpDataSource.java:234) 11-26 21:47:03.011: W/System.err(13168): ... 9 more 11-26 21:47:03.065: E/EventJioLogger(13168): playerFailed [31.44] 11-26 21:47:03.065: D/EventJioLogger(13168): state [31.44, true, I] 11-26 21:47:03.065: D/EventJioLogger(13168): state [31.44, false, I] 11-26 21:47:03.253: E/SpannableStringBuilder(13168): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 11-26 21:47:03.253: E/SpannableStringBuilder(13168): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length 11-26 21:47:03.268: W/SurfaceView(13168): CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false

sachinbhanot avatar Nov 26 '14 16:11 sachinbhanot

This isn't a crash. It's logging, and does not kill your process. If playback subsequently fails then ExoPlayer.Listener.onPlayerError will be called with an exception that wraps the internal exception that caused the playback to fail.

ojw28 avatar Nov 26 '14 16:11 ojw28

If the video will stop.and I turn on the WiFi. Then how to play the video again in same poistion On 26 Nov 2014 22:21, "ojw28" [email protected] wrote:

This isn't a crash. It's logging, and does not kill your process. If playback subsequently fails then ExoPlayer.Listener.onPlayerError will be called with an exception that wraps the internal exception that caused the playback to fail.

— Reply to this email directly or view it on GitHub https://github.com/google/ExoPlayer/issues/173#issuecomment-64675624.

sachinbhanot avatar Nov 26 '14 17:11 sachinbhanot

The demo app has a retry button that appears that allows you to resume from the same position, so just replicate the logic of what tapping that button does.

If you want to automatically wire it up to a WiFi connection being established, then you should have your application monitor network connectivity and respond accordingly: http://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html

ojw28 avatar Nov 26 '14 17:11 ojw28

OK thanks alot..it helps alot On 26 Nov 2014 23:08, "ojw28" [email protected] wrote:

The demo app has a retry button that appears that allows you to resume from the same position, so just replicate the logic of what tapping that button does.

If you want to automatically wire it up to a WiFi connection being established, then you should have your application monitor network connectivity and respond accordingly: http://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html

— Reply to this email directly or view it on GitHub https://github.com/google/ExoPlayer/issues/173#issuecomment-64682852.

sachinbhanot avatar Nov 26 '14 17:11 sachinbhanot