All known instances use DataSource as generic type and thus code can be simplified
by removing the generic type altogether.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205798542
In the future, this allows to register the BandwidthMeter (managed by the player)
as a listener to all media transfers related to this media source.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202643946
Original change by nickchavez@nickchavez:andcsvol:3257:citc on 2018/06/19 12:41:18.
Add VolumeProvider interface to VideoAdPlayer and VideoStreamPlayer.
- Send volume on videoDisplay.start so that it can be sent to OMID.
- Add unit tests for AdPlayerCalback and ExoPlayerVideoAdPlayerImpl.
- Add functional tests for client side and DAI volume updates.
Add onVolumeChanged() to VideoAdPlayerCallback and VideoStreamPlayerCallback.
- Implement volume updates for SDK owned video player.
- Remove mute/unmute events, which are handled in JS instead (like iOS).
- Collect volume changes from client side and DAI video players.
External: Publisher players will now have to implement getVolume() and onVolumeChanged() for custom video players.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202324636
The DefaultEventListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695490
Some module/extensions couldn't use the static test so far because all files
needed to be put on the blacklist. To ensure the test it set up for all
modules, this fixes at least one file for each of the modules.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197731449
The old event listener on AdsMediaSource is deprecated, in favor of
reporting in the normal way (via MediaSourceEventListener).
Add AdLoadException with information on what ad/ads failed to load.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195426144
These don't seem to be needed anymore. All tests run without them in gradle
and Blaze.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191867518
This is achieved by adding a BaseMediaSource which keeps a reference count of the
number of times the source has been prepared and forwards to the actual implementations
only once, such that only minimal changes are needed for each media source.
Issue:#3498
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187186691
AdsMediaSource must be top-level. Currently the (deprecated) ImaAdsMediaSource
can't be used because it prepares its contained AdsMediaSource as a child
source.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186990882
Occasionally the player could transition from playing content to playing an ad
after IMA called playAd. The discontinuity triggered faking the content
position, and the fake position was passed to IMA when content resumed causing
the wrong ad group to be loaded. Fix this by only faking the position if the
player transitions before playAd.
Also fix the calculation of the expected ad group index for a postroll ad, and
wait for the player to transition back from ad to content before passing a
content progress update.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185994229
If an exception is thrown in an IMA callback it crashes the process with lots of
logging from WebView (including several stack traces, etc.). This change wraps
ImaAdsLoader code that might throw, skips any remaining ads (as the errors are
not recoverable, in general) and notifies a new load error callback so that the
application can implement its own handling. The intention is to make the loader
robust to unexpected requests from IMA and avoid crashes.
Also handle IMA loading an ad in an ad group that has no available ads. In rare
cases IMA will try to load an ad for which an error was previously notified, so
this drops those load requests allowing playback of the content to continue.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185985850
If there was no preroll and the pending content position was set before the
first midroll, the pending content position was never cleared so loading the ad
was never triggered.
Only set a pending content position if we know that we need to trigger playing
an ad for the current position and IMA will poll for an ad (because there is a
midroll ad group). Clearing the pending content position happens when IMA pauses
content to play the ad.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185818315
IMA sometimes delivers an ad group load error just after the time of the ad
group, which is problematic now that we set the expected ad group index based on
the last returned content progress.
Only update the expected ad group index once we are within a fixed preloading
threshold of the next ad.
Also fix updating the ad group to use the new ad count, and check for ad group
load errors when we have no expected ad group defensively.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185803086
Content progress is only polled if there are midroll ad groups. If the ad tag
had only preroll/postroll ads, the pending content position was not provided to
IMA, which meant that the postroll ad could never play.
Only set the pending content position if there are midroll ads.
Issue: #3715
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185680803
This error marks the current ad group as unplayable.
Issue: #3801
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185663472
Also make ad group skipping more robust. After calling onError for an ad, IMA
will sometimes trigger an ad group load error, so this needs to be handled in a
way that allows some ads to be loaded already for the ad group.
This change also fixes calculation of the expected ad index to take into account
whether the position is being faked to trigger loading an ad or is the actual
player position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185655844
IMA's cue points may not be in order, so sort them. It looks like IMA events use
time ordered ad indices, so it is not necessary to map between the original cue
point order and the time order.
Issue: #3716
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185495798
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