294 Commits

Author SHA1 Message Date
Oliver Woodman
47bc70d480 Merge pull request #6119 from eneim:patch-1
PiperOrigin-RevId: 256147742
2019-07-02 17:49:05 +01:00
olly
7798c07f64 Remove ExoCast
PiperOrigin-RevId: 255964199
2019-07-02 17:48:22 +01:00
aquilescanta
0ddd3c2bd0 Implement DecryptableSampleQueueReader.isReady
PiperOrigin-RevId: 254746146
2019-07-02 17:43:00 +01:00
Nam Nguyen Hoai
a5fd774647
Update TrackSelectionDialog.java
Fix a super tiny typo.
2019-07-02 18:04:08 +09:00
tonihei
3bff79f56f Wrap MediaCodec exceptions in DecoderException and report as renderer error.
We currently report MediaCodec exceptions as unexpected exceptions instead of
as renderer error. All such exceptions are now wrapped in a new DecoderException
to allow adding more details to the exception.

PiperOrigin-RevId: 252054486
2019-06-14 16:33:47 +01:00
aquilescanta
3490bea339 Simplify re-creation of the CastPlayer queue in the Cast demo app
PiperOrigin-RevId: 251617354
2019-06-06 17:35:44 +01:00
eguven
e4feaa68f2 Add VR player demo
PiperOrigin-RevId: 251460113
2019-06-06 17:35:06 +01:00
eguven
2c4eb1cd9b Demo app change.
PiperOrigin-RevId: 250248268
2019-05-30 15:22:58 +01:00
olly
3afdd7ac5a Put @Nullable annotation in the right place
PiperOrigin-RevId: 249828748
2019-05-30 15:10:55 +01:00
aquilescanta
3314391932 Add basic DRM support to CastPlayer's demo app
PiperOrigin-RevId: 249624829
2019-05-30 15:09:52 +01:00
eguven
4ca670bed3 Use MediaSourceFactory interface to simplify DownloadHelper
PiperOrigin-RevId: 248367983
2019-05-15 20:13:59 +01:00
tonihei
7d1ce3b13e Change legacy support UI dependency to more specific ViewPager dependency.
PiperOrigin-RevId: 247902405
2019-05-15 18:11:21 +01:00
olly
95495328cf ...Androidx Migration...
PiperOrigin-RevId: 247499141
2019-05-15 18:09:49 +01:00
tonihei
7d5558881d Fix two ad insertion related bugs in DefaultPlaybackSessionManager.
1. A content session after an ad has been played was not re-marked as active,
   leading to new ad session being marked as active too early.
2. Switching from content to post-roll ended the content session because
   the return value of getAdGroupTimeUs of C.TIME_END_OF_SOURCE was not
   handled. Using the nextAdGroupIndex instead.

PiperOrigin-RevId: 246977327
2019-05-15 18:07:49 +01:00
aquilescanta
ad5948f3ed Fix SmoothStreaming links
NOTE: Streams are working on ExoPlayer but querying them from
other platforms yields "bad request".

The new links:
+ Match Microsoft's test server.
+ Allow querying from clients other than ExoPlayer, like curl.

PiperOrigin-RevId: 246289755
2019-05-02 13:06:10 +01:00
tonihei
c480818249 Fix some random AndroidStudio warnings.
PiperOrigin-RevId: 245956915
2019-04-30 22:08:07 +01:00
tonihei
0bb32a8f09 Add IntDef for Player states.
PiperOrigin-RevId: 245925254
2019-04-30 22:07:47 +01:00
eguven
708cad6b28 Add DownloadHelper.createMediaSource utility method
PiperOrigin-RevId: 245243488
2019-04-26 18:33:02 +01:00
eguven
03313fb5e2 Add option to add entries in an ActionFile to DownloadIndex as completed
PiperOrigin-RevId: 244864742
2019-04-26 18:30:27 +01:00
olly
748a29e8f5 Further improve DownloadService action names & methods
- We had buildAddRequest and sendNewDownload. Converged to
  buildAddDownload and sendAddDownload.
- Also fixed a few more inconsistencies, and brought the
  action constants into line as well.

PiperOrigin-RevId: 244274041
2019-04-18 23:45:49 +01:00
olly
e9413b0d41 Simplify DownloadManager constructors
PiperOrigin-RevId: 244223870
2019-04-18 23:23:33 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
olly
d656782bd4 Don't start download if user explicitly deselects all tracks
PiperOrigin-RevId: 244003817
2019-04-18 15:15:01 +01:00
tonihei
e62da368d2 Use player.retry in demo app instead of manual position tracking.
We currently do manual position tracking while the player is in error mode.
This is to allow an initial seek to the new position when trying to re-prepare.

Instead, we can just use our player.retry method and remove the tracking code.

PiperOrigin-RevId: 243819580
2019-04-18 15:12:26 +01:00
eguven
5856e75781 Rename DownloadAction to DownloadRequest
PiperOrigin-RevId: 243806888
2019-04-16 16:41:29 +01:00
olly
77b78b96df DownloadTracker shouldn't depend on DefaultDownloadIndex
- It can work with any DownloadIndex
- Also simplify things to not require that it's registered
  as a DownloadManager listener by someone else

PiperOrigin-RevId: 243697352
2019-04-16 15:28:20 +01:00
olly
9c759a867b Prepare SimpleCache for 2.10.0 release
- Expose constructors that take DatabaseProvider. Deprecate those
  that do not.
- Expose Cache.getUid. This will likely be used for naming of the
  tables accessed by DefaultDownloadIndex .

PiperOrigin-RevId: 243637786
2019-04-16 15:28:01 +01:00
olly
7b84a1ead7 DownloadManager.getCurrentDownloads: Return list instead of array
- Allows enforcing immutability, which in a future CL will allow
  avoiding allocating a new array/list on every call.
- Also some left over doc cleanup from the DownloadState rename.

PiperOrigin-RevId: 243627352
2019-04-16 15:27:03 +01:00
olly
b84c51434f Deprecate ActionFile and simplify upgrading
PiperOrigin-RevId: 243085292
2019-04-13 01:40:24 +01:00
eguven
8688bd2d88 Rename DownloadState to Download
PiperOrigin-RevId: 242839480
2019-04-13 01:38:25 +01:00
olly
d3b63a97ad Remove DownloadAction serialization
Implement Parcelable instead, which is a more intented way of
passing structured data via Intents.

PiperOrigin-RevId: 242646441
2019-04-13 01:36:46 +01:00
olly
18dcad9b8d Simplify DownloadState to contain its DownloadAction
This makes sense now that DownloadAction is only for downloading,
and not also for removal.

PiperOrigin-RevId: 242561575
2019-04-13 01:36:07 +01:00
olly
0daaba443c Get rid of DownloadState.STATE_REMOVED
It's a transient state whose only use is when passing a removed
download to onDownloadStateChanged. It's a bit strange to have it
as a proper state, since we end up asserting that it's an invalid
value in other places.

This change adds an explicit onDownloadRemoved, which allows
removal of the transient STATE_REMOVED, related assertions, and
uncertainty when dealing with an @State variable whether it's
necessary to handle it being STATE_REMOVED.

PiperOrigin-RevId: 242444128
2019-04-13 01:32:08 +01:00
aquilescanta
be61715517 Fix Cast demo app
Broken in 399aa706a7

PiperOrigin-RevId: 242112068
2019-04-05 21:14:28 +01:00
olly
9471d61183 Fix ExoPlayer's demo app
PiperOrigin-RevId: 241811732
2019-04-05 21:13:31 +01:00
aquilescanta
9c0819001d Fix ExoPlayer's demo app gradle build
Broken by 399aa706a7.

PiperOrigin-RevId: 241770676
2019-04-05 21:12:54 +01:00
olly
399aa706a7 Remove usages of the widget package and migrate to new packages.
PiperOrigin-RevId: 241656157
2019-04-05 20:54:09 +01:00
olly
9aacef47ad Allow TrackSelectionDialog to indicate whether it has any content
PiperOrigin-RevId: 241523313
2019-04-05 20:49:25 +01:00
tonihei
28ea31cd4c Use Closeable interface for DownloadStateCursor to simplify closing.
PiperOrigin-RevId: 240775823
2019-03-29 16:50:57 +00:00
eguven
d4f5c9c721 Remove DownloadHelper.getRemoveAction
PiperOrigin-RevId: 240444051
2019-03-29 16:48:40 +00:00
eguven
3919f3843d Make DownloadManager use DownloadIndex
PiperOrigin-RevId: 240320220
2019-03-26 13:18:11 +00:00
eguven
b5e4523b58 Remove index modifier methods from DownloadIndex interface
PiperOrigin-RevId: 239045412
2019-03-20 23:26:49 +00:00
eguven
d85ee01ae7 Convert DownloadManager.Listener methods no-op default methods
PiperOrigin-RevId: 239019504
2019-03-20 23:26:49 +00:00
olly
07702cecdd Allow exoplayer/v2/ mockito2
PiperOrigin-RevId: 238625384
2019-03-20 23:26:10 +00:00
tonihei
d93ee00d19 Add convenience method to DownloadHelper to add selection for single renderer.
This simplifies the DownloadHelper code in the demo app and is generally
useful for more specific updates with SelectionOverrides.

PiperOrigin-RevId: 238228276
2019-03-15 04:53:29 +00:00
olly
ab5dae64b9 Make sure we handle SQLiteException and other IO errors properly
SQLiteException is a runtime exception, which makes it easy to
forget to handle it. This change converts SQLiteExceptions into
a checked exception, which is then handled appropriately.

PiperOrigin-RevId: 237038793
2019-03-06 17:29:18 +00:00
olly
a4754bb741 Don't show track selection tabs if there's only one
PiperOrigin-RevId: 237025639
2019-03-06 17:29:18 +00:00
tonihei
3500f07be6 Use theme overlay for track selection dialog.
We currrently just inherit the acitivity's alertDialogTheme style (which
is equivalent to ThemeOverlay.AppCompat.Dialog.Alert). Using the theme
overlay directly and also force-enable the title such that the title is
shown even if the activity disabled the title.

PiperOrigin-RevId: 237012601
2019-03-06 17:29:18 +00:00
tonihei
641c1d2af4 Properly release DownloadHelper and TrackSelectionDialog.
The release needs to post to the MediaSource thread and also needs to post
back to the DownloadHelper thread to prevent sending updates after release has
been called. The point where we release the downloadHelper also needs to
dismiss the dialog in case the creation has already been queued before the
release.

PiperOrigin-RevId: 236652309
2019-03-06 17:29:18 +00:00
olly
d68c861b21 Remove duplicate layout file
PiperOrigin-RevId: 236645446
2019-03-06 17:29:18 +00:00