Before this change, the player state would be STATE_ENDED then
STATE_BUFFERING (when the postroll ad was marked as played) then
STATE_ENDED again.
Queueing a final content media period with start point equal to
the content duration after a postroll ensures that the player
state doesn't change to STATE_ENDED transiently.
Switch from using C.TIME_END_OF_SOURCE to C.TIME_UNSET for media
periods that should not have an end point and are not followed
by an ad.
Content media periods before postrolls have end position
C.TIME_END_OF_SOURCE. If the postroll ad loads, its content
position is set to the content duration, which should be known
at the point of loading the postroll, then a final 'empty'
content media period with start position equal to its duration
is queued. If the postroll fails to load, this empty content
media period is queued up directly after the preceding content
media period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219443683
A lot of methods just forward to other methods and there is no conceivable
way a player should implement it another way. Moving these methods to a
base player class allows to remove duplicated code across our player
implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215374192
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.
Issue:#4665
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
ExoPlayer can be run on a background thread, but some components (UI and IMA)
only support players on the main thread. This adds some documentation and
assertions for that.
To simplify assertions, this also moves the getApplicationLooper method from
ExoPlayer to Player.
Issue:#4439
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213280359
This fixes or suppresses all reported issues by the code review linter tools.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210107759
At the point of starting to play a postroll, source info refreshes for future
postroll ads in the same ad group would cause a seek that incorrectly identified
the media period to play as the content media period. Fix the logic in
getAdGroupIndexForPositionUs to address this.
Also handle empty postroll ad breaks by resetting the expected ad group index
when we send content complete.
Issue: #4710
Issue: #4681
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210071054
The previous change was too aggressive as it would clear future ad breaks.
Still clear the pending content position so the real content position is
reported after an empty ad break.
Issue: #4681
Issue: #4622
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209752306
The IMA SDK now handles focusing the skip button so remove the workaround.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207515573
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
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
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