Skip to content

ExoPlayer crash with IMAloader onTimelineChanged Assertions.checkArgument #5831

@amjadmasri

Description

@amjadmasri

[REQUIRED] Issue description

Our app just recently released and we found in the Firebase Crashalytics an increasing number of crashes which I included below
we are using an HlsMediaSource for the content then adding the AdsMediaSourceand for the ads and
here is the code of how we are initializing the player:

ImaAdsLoader.Builder builder = new ImaAdsLoader.Builder(this);
 
imaAdsLoader=builder.setImaSdkSettings(ImaSdkFactory.getInstance().createImaSdkSettings()).buildForAdTag(Uri.parse(adVMAP));

DefaultDataSourceFactory defaultDataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, getResources().getString(R.string.app_name)));

 MediaSource mediaSource = new 
 HlsMediaSource.Factory(defaultDataSourceFactory).createMediaSource(Uri.parse(episodeLink));

     AdsMediaSource adsMediaSource = new AdsMediaSource(mediaSource, defaultDataSourceFactory, imaAdsLoader, playerView.getOverlayFrameLayout());

     player.addListener(this);

     boolean haveStartPosition = startPosition != C.INDEX_UNSET;
     if (haveStartPosition) {
         player.seekTo(startPosition);
     }

     player.prepare(adsMediaSource,!haveStartPosition,false);
     player.setPlayWhenReady(true);

[REQUIRED] Reproduction steps

we couldn't reproduce the issue , we only see the crashes on the crashlytics console.

[REQUIRED] Link to test content

[REQUIRED] A full bug report captured from the device

Fatal Exception: java.lang.IllegalArgumentException
       at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
       at com.google.android.exoplayer2.ext.ima.ImaAdsLoader.onTimelineChanged(ImaAdsLoader.java:912)
       at com.google.android.exoplayer2.ExoPlayerImpl$PlaybackInfoUpdate.notifyListeners(ExoPlayerImpl.java:780)
       at com.google.android.exoplayer2.ExoPlayerImpl.updatePlaybackInfo(ExoPlayerImpl.java:717)
       at com.google.android.exoplayer2.ExoPlayerImpl.handlePlaybackInfo(ExoPlayerImpl.java:648)
       at com.google.android.exoplayer2.ExoPlayerImpl.handleEvent(ExoPlayerImpl.java:593)
       at com.google.android.exoplayer2.ExoPlayerImpl$1.handleMessage(ExoPlayerImpl.java:125)
       at android.os.Handler.dispatchMessage(Handler.java:105)
       at android.os.Looper.loop(Looper.java:156)
       at android.app.ActivityThread.main(ActivityThread.java:6577)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:986)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

[REQUIRED] Version of ExoPlayer being used

2.9.4

[REQUIRED] Device(s) and version(s) of Android being used

Samsung galaxy S6
HTC Desire 820s
HUAWEI MediaPad T3 7

android 6, 7 and 8

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions