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
This simplifies code skipping items in a playlist programatically.
Issue:#4863
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214580742
This provides the list of currently buffered media chunks and iterators over
the potential next chunks to the track selection. Having these two parameters
enables more advanced decision logic based on this data.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210551812
- Add @Deprecated on overrides of deprecated method.
- Suppress deprecation warnings where appropriate.
- Use non-deprecated alternatives where appropriate.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210092434
Similar to getBufferedPosition and getCurrentPosition, getDuration should
mention that it also returns the duration of the current ad.
And, also similar to getContentBufferedDuration and getContentPosition, a
new method getContentDuration simplifies querying the content duration while
playing an ad.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209914696
The MediaPeriodId with index is only properly defined together with a
timeline containing the index. Changing it to the period uid allows to use
the MediaPeriodId independent of the corresponding timeline.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209430257
LSC: []
Additional details: []
Cleanup change automatically generated by javacflume/refactory
Refactoring: //third_party/java_src/robolectric/errorprone:ShadowUsageCheck
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207014379
The looping media source doesn't convert the media period id to the externally
visible media period id. And the merging media source reports media period
creations multiple times which will break listeners assuming a media period
with a specific id will only be created once.
Also amend the doc for MediaSource.createPeriod to reflect that media periods
created in parallel do not actually have the same id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206327241
This removes the need to populate the entire period for the common usage of
getting the uid from the period.
Also add default implementation to get period by uid.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205638265
For the MetadataRetriever, for certain queries, after setting up the player to
render a frame (by seeking to the position), sometimes the player will seek to
the same position and ignore the seek, leading to the frame not being captured,
leaving the retriever in deadlock, waiting for the frame forever. This CL adds
a retry timer to avoid this and make sure we can return query result after some
time.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204460200
- Support handling frame queries (i.e get frames at times, output to certain
sizes) from MetadataRetriever.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203489788
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
This will make it possible for ImaAdsLoader to access the player volume when
used with SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201664189
Currently, the looper of the thread the player is created on is used (or the
main looper if this thread doesn't have a looper). To allow more control over
the threading, this change lets users specificy the looper which must be used
to call player methods and which is used for event callbacks.
Issue:#4278
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201331564
Currently only the buffered position in the current media period can be queried.
To achieve this, we save the buffered positions of all MediaPeriods to the
PlaybackInfo together with a list of MediaPeriodIds. ExoPlayerImpl can then
determine the correct buffered position for multi-period windows and windows
with midroll ads.
In addition, this change adds two new convenience methods to the Player interface
to query the total buffered duration across all windows and to get the buffered
duration of the content while playing an ad.
Issue:#4023
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200041791
Use PixelCopy API for the first SurfaceCapturer implementation. This supports
devices from API 24+.
Github: #3609.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197732711
If an app wants to reconcile its own state with that of a DownloadManager,
it's helpful to know when the DownloadManager has finished restoring any
previously persisted tasks.
Also suppress initial "state changed to paused" listener invocations for
tasks that are immediately started.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195594881
The lint workaround and org.json exclusion aren't needed any more.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195557066
Our current custom looper implementation tries to handle all messages
including those sent to the main looper. However, the main looper does not
use our doLoop implementation and thus messages never get executed.
This adds a check whether the target looper is the main looper and if so,
uses the default message forwarding implementation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194779214
- This is needed to make DefaultTrackSelector properly thread
safe, and enable atomic changes to the selector that, for
example, disable a renderer and enable another one at the same
time.
- This change also saves/restores parameters and the start
position in PlayerActivity, resolving the ref'd issue.
Issue: #3915
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193913350
This field (formerly "id") is almost impossible to use so far. Having setters
in the factories allows to specify custom tags for all media sources.
Also added a ExoPlayer.getCurrentTag() method to retrieve the tag of the
currently playing media source in a convenient way.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191738754
This adds callbacks for creating, releasing, and starting to read from media
periods.
Such events allow listeners to keep a list of active media periods. This is
useful to determine when no further events for a certain media period are
expected. It also allows listeners to associate renderer events unambigiously
with a reading media period.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190462717
This gives the MediaSourceEventListener API a consistent look when new methods are
added which only have a window index and media period id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190450270
This allows to test sending events when using fake media sources.
The FakeMediaSource now simulates a manifest load when being prepared.
And the FakeMediaPeriod simulates a media load when being prepared.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189205285
- 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