68 Commits

Author SHA1 Message Date
olly
983fe9cc9f Add DownloadManager.Listener.onInitialized
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
2018-05-07 07:23:58 +01:00
olly
5adfd7e9d9 Simplify OkHttp extension build.gradle
The lint workaround and org.json exclusion aren't needed any more.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195557066
2018-05-07 07:19:42 +01:00
olly
d4d1fd64b3 Clean up DownloadManagerTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195364299
2018-05-07 07:03:05 +01:00
tonihei
c1e3cb767e Don't forward main looper messages to custom looper.
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
2018-05-07 06:29:56 +01:00
olly
7d6b0e1fda Move renderer flags, overrides and tunneling ID into Parameters
- 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
2018-05-07 05:56:48 +01:00
olly
d3cdf52591 Sanitize MappedTrackInfo API
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193897041
2018-05-07 05:53:05 +01:00
olly
d4aceef8a8 Add getPlaybackError to Player/ExoPlayer interface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193400443
2018-05-07 05:31:37 +01:00
olly
67cde97a70 Move code unrelated to mapping to DefaultTrackSelector
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192759210
2018-04-16 10:47:55 +01:00
olly
3568dca3b1 Make tests use DefaultTrackSelector
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192259167
2018-04-11 00:29:53 +01:00
tonihei
6b82d1c2bd Add setters to MediaSource factories for custom window tag.
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
2018-04-07 19:12:21 +01:00
tonihei
6c0d676050 Add callbacks for media period life cycle.
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
2018-03-28 00:41:29 +01:00
tonihei
eb84b144bf Move window index and media period id out of MediaLoadData again.
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
2018-03-28 00:38:09 +01:00
tonihei
c7c9a1e9e4 Send media source events for fake media sources.
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
2018-03-27 23:58:52 +01:00
olly
78e6979725 Fix min api check in RobolectricUtil
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188716201
2018-03-12 15:26:38 +00:00
tonihei
75c3bfb55c Rename Listener for timeline update to avoid confusion with MediaSourceEventListener.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187313128
2018-03-02 09:21:28 +00:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
tonihei
b2c445776a Allow parallel reuse of media sources.
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
2018-03-02 09:08:28 +00:00
tonihei
b47fb2826b Move extension tests to Robolectric.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187021822
2018-02-27 11:03:50 +00:00