Before this change, HlsMediaSource timelines had a period starting at the epoch.
For VOD streams the window position in the period was the program date time.
This change makes period and initial window positions match. For live streams
the window position advances as segments are removed, so its position in the
period is the difference between the initial program date time and the program
date time of the latest playlist.
This also makes it possible to insert ads in VOD HLS content with program date
time, as the period and window are now aligned.
Issue: #3865
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187590948
Currently, AspectRatioFrameLayout may need to resize itself if it could not
satisfy a target aspect ratio. User may want to know when this happen, or
whether this can happen, so they can update their UI accordingly. For
example: show/hide a button to toggle different resize mode only when the
aspect ratio of the view and the content is very different.
GitHub: #3736
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187484241
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
The non-dynamic media source has a strict subset of features of the dynamic one and
thus can be replaced.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187299432
ClippingMediaSource provides a timeline where the period and window have the
same start/end positions, so when clipping a child timeline with a non-zero
offset between the window and period it is necessary to clear the offset then
apply the offset to the start/end positions used in the ClippingMediaPeriod.
Also add a message to clipping exceptions.
Also fix adjustment of seeks to the start of the clipped view.
Issue: #3888
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187292506
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
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
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 added comments for all existing devices for easier reference.
Issue:#3835
Issue:#3236
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185661900
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
Releasing the player released the internal playback thread once renderers were
released. Releasing a MediaPeriod queued a Loader.ReleaseTask on the loading
thread which would post back to the playback thread. If the playback thread had
been quit by the time this happened, the release task wouldn't be run.
Release on the loading thread instead of the playback thread. This avoids
needing to block releasing the player until the loading threads have ended, and
ensures that release tasks will run eventually. As part of this change,
ExtractorMediaPeriod's call to Extractor.release will now run on the loading
thread (which means that all Extractor methods are called on that thread) and
other cleanup in ReleaseCallback will run on the loading thread instead of the
playback thread.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185651320
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
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
Try to delay failure for as long as possible. That is, propagate
DRM session failures only after an encrypted buffer arrives or clear
sample playback without session is not allowed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183076348
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
Also disable use of dummy surface for devices that require the
workaround. It's only useful in the case that we can use
setOutputSurfaceWorkaround, so if it's disabled the dummy surface
has no purpose (it actually makes things worse by consuming past
the key-frame prior to the current position, which doesn't happen
if you have no surface at all).
Issue: #3724
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182750068
- In IDLE, the button will now call a preparer. This allows
removal of the separate retry button from the demo app.
- In ENDED, the button will seek back to the default position
and play.
- Behavior is made consistent with LeanbackPlayerAdapter.
Issue: #3689
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182506855
It seems good to have EventLogger available from the library.
In particular because when app developers use it and then
submit bug reports, it makes it much easier to work out what
happened. It will also allow EventLogger to be used across
our (now multiple) demo apps.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182389407
For live streaming, there are several types of DASH `emsg' events that directly
target the player. These events can signal whether the manifest is expired, or
the live streaming has ended, and should be handle directly within the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182034591
This it to distinguish between actual period transitions and the
transitions occuring to and from ads within one timeline period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181606023
----------------------------------
Original change description:
DRM fixes
- Parse multiple kids from default_KID. It's specified as a whitespace
separated list of UUIDs rather than a single UUID.
- Opportunistically proceed with playback in cases where the manifest
only defines a single SchemeData with the common PSSH UUID. In such
cases the manifest isn't saying anything about which specific DRM
schemes it supports.
Issue: #3630
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181137621
If SimpleExoPlayer is using TextView as output, we can handle video rotation by
automatically applying a matrix transformation to the TextureView when we have
this information available from the video (from video's metadata).
GitHub: #91
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180925571
In certain conditions CacheDataSource switch to reading from upstream
without writing back to cache. This change makes it detect the change of
these conditions and switch to reading from or writing to cache.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180901463
- Parse multiple kids from default_KID. It's specified as a whitespace
separated list of UUIDs rather than a single UUID.
- Opportunistically proceed with playback in cases where the manifest
only defines a single SchemeData with the common PSSH UUID. In such
cases the manifest isn't saying anything about which specific DRM
schemes it supports.
Issue: #3630
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180675056
Whilst the previous behavior was WAI and had the advantage of
updating the position to be more exact when known, there were
a couple of disadvantages:
1. If seeking to the very end of a period in a playlist when
paused, the position adjustment could trigger a position
discontinuity to the next period.
2. We de-duplicate seeks to the current playback position.
The position adjustment can prevent this from being
effective. This is particularly important with the new
SeekParameters support. When seeking to nearest sync point
it's often possible to de-duplicate seeks, but we cannot
do so if the playback position adjusts away from the sync
point's time.
Issue: #2439
Issue: #2882
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180540736