Com.google.android.exoplayer2.source.unrecognizedinputformatexception:
I need to reproduce a live show with exoplayer in format .mpd. But i get this error: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the availabl
Solution 1:
.mpd is commonly pointing to a DASH manifest which is an adaptive format. The manifest lists media representations of different qualities with which the player can adapt to given bandwidth conditions.
To play a DASH manifest (.mpd) you create a DASH specific media source.
Use a DashMediaSource
instead of an ExtractorsMediaSource
:
// meter bandwidth with media files (video/audio)DefaultHttpDataSourceFactorymediaDataSourceFactory=newDefaultHttpDataSourceFactory(
Util.getUserAgent(this, "stackoverflow"), BANDWIDTH_METER);
// do not meter bandwidth for manifest loadingDefaultHttpDataSourceFactorymanifestDataSourceFactory=newDefaultHttpDataSourceFactory(
Util.getUserAgent(this, "stackoverflow"));
// create the media source for DASHMediaSourcemediaSource=newDashMediaSource.Factory(
newDefaultDashChunkSource.Factory(mediaDataSourceFactory),
manifestDataSourceFactory)
.createMediaSource(uri, null, null);
// prepare the player
player.setPlayWhenReady(true);
player.prepare(mediaSource);
Post a Comment for "Com.google.android.exoplayer2.source.unrecognizedinputformatexception:"