Commit e791e3ce by andrewlewis Committed by Christos Tsilopoulos

Fix checking imaAdMediaInfo nullness

It's intended to log a warning in this case, rather than throw.

Issue: #8290

#minor-release

PiperOrigin-RevId: 347790527
parent 5a6c99e3
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
([#3750](https://github.com/google/ExoPlayer/issues/3750)). ([#3750](https://github.com/google/ExoPlayer/issues/3750)).
* Fix a condition where playback can get stuck before an empty ad * Fix a condition where playback can get stuck before an empty ad
([#8205](https://github.com/google/ExoPlayer/issues/8205)). ([#8205](https://github.com/google/ExoPlayer/issues/8205)).
* Log a warning rather than throwing when reaching the end of the stream
with an ad playing but without ad media info
([#8290](https://github.com/google/ExoPlayer/issues/8290)).
* Add `ImaAdsLoader.Builder.setEnableContinuousPlayback` for setting * Add `ImaAdsLoader.Builder.setEnableContinuousPlayback` for setting
whether to request ads for continuous playback. whether to request ads for continuous playback.
* Metadata retriever: * Metadata retriever:
......
...@@ -800,7 +800,7 @@ import java.util.Map; ...@@ -800,7 +800,7 @@ import java.util.Map;
&& playWhenReady) { && playWhenReady) {
ensureSentContentCompleteIfAtEndOfStream(); ensureSentContentCompleteIfAtEndOfStream();
} else if (imaAdState != IMA_AD_STATE_NONE && playbackState == Player.STATE_ENDED) { } else if (imaAdState != IMA_AD_STATE_NONE && playbackState == Player.STATE_ENDED) {
AdMediaInfo adMediaInfo = checkNotNull(imaAdMediaInfo); @Nullable AdMediaInfo adMediaInfo = imaAdMediaInfo;
if (adMediaInfo == null) { if (adMediaInfo == null) {
Log.w(TAG, "onEnded without ad media info"); Log.w(TAG, "onEnded without ad media info");
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment