mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00
Ignore seekTo if an ad is playing
Issue: #3309 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173114842
This commit is contained in:
parent
93423aa8d4
commit
43d70bdde9
@ -232,6 +232,18 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
if (windowIndex < 0 || (!timeline.isEmpty() && windowIndex >= timeline.getWindowCount())) {
|
||||
throw new IllegalSeekPositionException(timeline, windowIndex, positionMs);
|
||||
}
|
||||
if (isPlayingAd()) {
|
||||
// TODO: Investigate adding support for seeking during ads. This is complicated to do in
|
||||
// general because the midroll ad preceding the seek destination must be played before the
|
||||
// content position can be played, if a different ad is playing at the moment.
|
||||
Log.w(TAG, "seekTo ignored because an ad is playing");
|
||||
if (pendingSeekAcks == 0) {
|
||||
for (Player.EventListener listener : listeners) {
|
||||
listener.onSeekProcessed();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
pendingSeekAcks++;
|
||||
maskingWindowIndex = windowIndex;
|
||||
if (timeline.isEmpty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user