Allow skipping an ad group when requested by IMA, even if we aren't currently
playing one, to handle cases where no ads in an ad group will load (so IMA
requests resuming content but we never managed to start playing an ad).
Use the known ad group index (rather than the expected one) when handling ad
group load errors. This ensures we skip the right ad group if we notify IMA of
playback errors for every ad in the ad group, then IMA notifies that the ad
group is empty via a load error.
Also make some other miscellaneous small fixes to ads code:
- Avoid warning about unexpected ad group indices more than once.
- Output a warning if the ad count in an ad group decreases.
- Remove unnecessary assertion.
- Fix getting the ad duration for ad indices that haven't loaded yet.
- Allow setting an ad group state to its current value.
- Fix javadoc for setting the ad resume position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184831495
The ad index in the ad group may need to skip over ads that failed to load, so
it can't just be incremented any more.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184812556
If IMA loads an empty VAST document for an ad group it notifies via a LOG
AdEvent. Handle the event by updating the AdPlaybackState accordingly.
The error state will be handled in ExoPlayerImplInternal in a separate change.
Issue: #3584
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184516585
*** Reason for rollback ***
Broke everything
*** Original change description ***
Clean up message naming in EPII
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184061352
Before this change, the ad playback state stored the number of played ads in
each ad group. There was no way to represent that an ad had failed to load (and
it wouldn't be possible just to increment the played ad count to signal a load
error because there might be an unplayed ad before the ad that failed to load).
Represent the state of each ad (unavailable, available, skipped, played, error)
in each ad group. In a later change the player will use this information to
update its loaded MediaPeriods in response to future ads failing to load.
Also make the AdPlaybackState immutable and remove copying/duplication of its
fields in the ad timeline and period.
Issue: #3584
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183655308
1. When we try and load something via reflection and find the
class, always throw rather than failing silently if we
subsequently fail to instantiate an instance. This is
indicative of a broken proguard setup, and failing silently
makes it hard to spot.
2. Add library/core proguard configuration to ensure extension
renderer constructors that we access via reflection are kept.
3. Add demos/main proguard configuration to ensure ImaAdsLoader
constructor that we access via reflection is kept.
4. Added IMA proguard file to hopefully fix#3723, although I
wasn't actually able to reproduce the issue.
Issue: #3723
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183648187
This removes some boiler-plate code for compostite sources and will also
simplify resuing media source in the future (because this class can keep track
of child listeners).
Issue:#3498
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183387123
Track the expected next ad group index so that it can be used as a fallback if
IMA does not notify the ad index via a LOADED event.
Also do some miscellaneous minor cleanup (including logging all LOG events, and
logging at debug level where appropriate).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183048612
Previously the ad/content progress updates were toggled based on whether the
player was playing ads or content. After this change, we switch based on
whether playAd/stopAd has been called instead.
This seems to resolve an issue where occasionally the player would get stuck at
the start of an ad, but as I don't have a root cause for that issue and it's
only sporadically reproducible I'm not certain this is a reliable fix.
Issue: #3525
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179169296
onEnded was being called also for content finishing, as in this case the playing
ad index changed (from INDEX_UNSET to 0). Fix this test so we only detect ads
finishing.
Also add logging for onEnded callbacks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179167737
Also fix propagation of ad errors that occur when no player
is attached.
Issue: #3548
Issue: #3556
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178767997
This fixes an issue where quickly detaching and reattaching the player might
cause ads to be requested multiple times with both responses handled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177922167
This is a step towards harmonizing the MediaSource Builders and (potentially)
providing MediaSource factories.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177783157
Currently onTimelineChanged doesn't allow to distinguish easily between the
different reasons why it's being called. Especially, finding
out whether a new media source has been prepared or the current source
refreshed dynamically was impossible without tightly coupling the player
operations with the listener.
The new reasons provide this disdinction by either indicating a newly
initialized media source, a dynamic update to an existing timeline
or manifest, or a reset of the player (which usually results in an
empty timeline).
The original onTimelineChanged method without reason is kept in the
DefaultEventListener as deprecated to prevent the need to update all
existing listeners in one go.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176478701
Remove an assertion that there was a call to pause content between two
content -> ad transitions.
Also, only use the player position for resuming an ad on reattaching if the
player is currently playing an ad, in case IMA pauses content before the player
actually transitions to an ad.
Issue: #3430
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176365842
As MediaSource listeners now return the MediaSource in on SourceInfoRefreshed,
we need to make sure that media sources wrapping another source don't just
forward the listener, but also provide a listener wrapper. This allows to
inject the wrapper source instance in the callback.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173653307
Controls are still hidden while playing ads, but if the app pauses the player,
controls will be shown. During ads, the player is not seekable.
When the player enters the background then returns to the foreground, the
content period may not be prepared, so also cache the content window duration.
This means that if the app reenters the foreground while an ad is paused the
time bar can be populated.
Issue: #3303
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171123428
imaPausedInAd could only be true when imaPlayingAd was true, so there are only
three possible states.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170827974
This allows simplified listener implementations as most listeners
will not listen to all possible notifications.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
AdsMediaSource lives in the core library so only ImaAdsLoader remains in
the ima extension. AdsMediaSource takes an AdsLoader implementation.
ImaAdsMediaSource is deprecated rather than removed for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168707921
This allows listeners to easily determine the source of the discontinuity.
Reasons can be period transitions, seeks, and internal reasons.
Listeners still using the deprecated ExoPlayer.EventListener interface were
updated to Player.EventListener.
GitHub: #3252
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168549612
Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.
Issue: #3180
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
This CL adds the fundamental pieces for ExoPlayer/Cast integration and includes a
demo app to showcase this functionality. However, media queues should be supported
in the first release of this extension.
Issue:#2283
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165576892
Also mark all ads as played when the postroll plays, in the case the
player is backgrounded then resumed and the user seeks back.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164262738
Multiple timelines work as a wrapper around another timeline and forward
most of the method calls to the wrapped timeline. Added a base class meant to
be overridden which handles all the boiler-plate forwarding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164117264
The manifest value is always overridden in gradle builds,
so this is for internal builds only. The value should be
the same (i.e. 25!).
Also fix IMA build to force the right support library
version, attempt 2!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164103183
- Publish IMA extension
- Force IMA to use the correct version of the support library
- Add missing sr translations for repeat mode strings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163705883
Also don't detach any attached player in release() to prevent a possible
NullPointerException if ImaAdsLoader.release() runs first, then the MediaSource
is released and detaches the player. This is safe because if the loader was
attached it's guaranteed to be detached.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163673750