Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exoplayer IMA Extention will throw a VIDEO_PLAY_ERROR when attempting to call Exoplayer$seekTo() while ad is playing. #3309

Closed
ntkachov opened this issue Sep 28, 2017 · 4 comments
Assignees

Comments

@ntkachov
Copy link

ntkachov commented Sep 28, 2017

Issue description

Exoplayer IMA Extention will throw a VIDEO_PLAY_ERROR when attempting to call Exoplayer$seekTo() while ad is playing.

Reproduction steps

Once player state changes to STATE_READY and playWhenReady is set to true, we can call seekTo and causes the playback of the ad to stop playing.

Ideally, calling seekTo() while an ad is playing would either buffer the seek position for the video that will play after the ad, or simply be ignored.

Link to test content

I've reproduced the issue in this repo (cloned from Exoplayer on 9/27)

https://github.com/ntkachov/ExoPlayer/blob/dev-v2-r2.5.3/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java#L486

The primary difference between the above file and this project's PlayerActivity.java is in Lines 486-488 which I have copied here with context.

  @Override
  public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
    if(playbackState == Player.STATE_READY) {
        player.seekTo(1000);
    }
    if (playbackState == Player.STATE_ENDED) {
      showControls();
    }
    updateButtonVisibilities();
  }

Adding lines 486-488 in the linked file above will cause exoplayer to start playing the ad and then skip directly to the video. The Logcat prints that an "Ad load error" occured.

  W/ImaAdsMediaSource: Ad load error
  java.io.IOException: Ad error: com.google.obf.gk@c3a5729
  at com.google.android.exoplayer2.ext.ima.ImaAdsLoader.onAdError(ImaAdsLoader.java:416)
  at com.google.obf.he.a(IMASDK:8)
  at com.google.obf.gy.a(IMASDK:60)
  at com.google.obf.gy.a(IMASDK:95)
  at com.google.obf.gq.a(IMASDK:71)
  at com.google.obf.hj.f(IMASDK:202)
  at com.google.obf.hj.a(IMASDK:41)
  at com.google.obf.hk.b(IMASDK:39)
  at com.google.obf.hk$1.shouldOverrideUrlLoading(IMASDK:4)
  at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:73)
  at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:354)
  at org.chromium.android_webview.AwContentsClient.shouldIgnoreNavigation(AwContentsClient.java:168)
  at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:352)
  at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
  at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
  at android.os.Handler.dispatchMessage(Handler.java:105)
  at android.os.Looper.loop(Looper.java:164)
  at android.app.ActivityThread.main(ActivityThread.java:6541)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Note: The seek position is irrelevant. Calling player.seekTo(0) produces the same result.

Version of ExoPlayer being used

Exoplayer 2.5.3 on branch dev-v2-r2.5.3

Device(s) and version(s) of Android being used

Nexus 5 with Android 6.0.1
Emulator with Android 8.0.0

A full bug report captured from the device

bugreport-sdk_gphone_x86-OSR1.170720.005-2017-09-28-11-06-27.zip

@andrewlewis
Copy link
Collaborator

Seeking while an ad is playing is quite difficult to do in general, because it may be necessary to play a different ad once the current ad finishes if the seek destination has a different preceding midroll ad. Initially I plan to ignore seeks and log a warning.

@ntkachov
Copy link
Author

ntkachov commented Oct 4, 2017

I think ignoring seeks is perfectly fine. It should be the consumers job to seek inside the content once the ad finishes playing.

ojw28 pushed a commit that referenced this issue Oct 27, 2017
Issue: #3309

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173114842
@ojw28 ojw28 closed this as completed Nov 3, 2017
@jazimm
Copy link

jazimm commented Dec 14, 2017

With v2.6.0 play will freeze using HLS if you try to seek past the midroll ad after the pre roll ad has finished. Seeking anywhere before the midroll is fine. Tested on Nexus 6P running 8.1.

@andrewlewis
Copy link
Collaborator

@jazimm If you file a new issue and include the information requested in the issue template we can investigate. Thanks.

@google google locked and limited conversation to collaborators Mar 7, 2018
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

4 participants