|
34 | 34 | import com.google.android.exoplayer2.source.ExtractorMediaSource; |
35 | 35 | import com.google.android.exoplayer2.source.MediaSource; |
36 | 36 | import com.google.android.exoplayer2.source.MergingMediaSource; |
| 37 | +import com.google.android.exoplayer2.source.ProgressiveMediaSource; |
37 | 38 | import com.google.android.exoplayer2.source.SingleSampleMediaSource; |
38 | 39 | import com.google.android.exoplayer2.source.TrackGroupArray; |
39 | 40 | import com.google.android.exoplayer2.source.dash.DashMediaSource; |
@@ -210,7 +211,7 @@ private MediaSource getMediaSource(Uri uri, com.google.android.exoplayer2.upstre |
210 | 211 | case C.TYPE_OTHER: |
211 | 212 | default: |
212 | 213 | // This is the MediaSource representing the media to be played. |
213 | | - return new ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(uri); |
| 214 | + return new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(uri); |
214 | 215 | } |
215 | 216 | } |
216 | 217 |
|
@@ -482,17 +483,23 @@ public void onPlayerError(ExoPlaybackException error) { |
482 | 483 | submitErrorEvent(OnErrorEventListener.ERROR_EVENT_UNKNOWN, null); |
483 | 484 | return; |
484 | 485 | } |
485 | | - PLog.e(TAG,error.getMessage()==null?"":error.getMessage()); |
| 486 | + String errorMessage = error.getMessage()==null?"":error.getMessage(); |
| 487 | + Throwable cause = error.getCause(); |
| 488 | + String causeMessage = cause!=null?cause.getMessage():""; |
| 489 | + PLog.e(TAG,errorMessage + ", causeMessage = " + causeMessage); |
| 490 | + Bundle bundle = BundlePool.obtain(); |
| 491 | + bundle.putString("errorMessage", errorMessage); |
| 492 | + bundle.putString("causeMessage", causeMessage); |
486 | 493 | int type = error.type; |
487 | 494 | switch (type){ |
488 | 495 | case ExoPlaybackException.TYPE_SOURCE: |
489 | | - submitErrorEvent(OnErrorEventListener.ERROR_EVENT_IO, null); |
| 496 | + submitErrorEvent(OnErrorEventListener.ERROR_EVENT_IO, bundle); |
490 | 497 | break; |
491 | 498 | case ExoPlaybackException.TYPE_RENDERER: |
492 | | - submitErrorEvent(OnErrorEventListener.ERROR_EVENT_COMMON, null); |
| 499 | + submitErrorEvent(OnErrorEventListener.ERROR_EVENT_COMMON, bundle); |
493 | 500 | break; |
494 | 501 | case ExoPlaybackException.TYPE_UNEXPECTED: |
495 | | - submitErrorEvent(OnErrorEventListener.ERROR_EVENT_UNKNOWN, null); |
| 502 | + submitErrorEvent(OnErrorEventListener.ERROR_EVENT_UNKNOWN, bundle); |
496 | 503 | break; |
497 | 504 | } |
498 | 505 | } |
|
0 commit comments