333 Commits

Author SHA1 Message Date
olly
37fc1d879d Propagate attributes to DefaultTimeBar
Issue: #5765
PiperOrigin-RevId: 249251150
2019-05-23 13:26:50 +01:00
andrewlewis
491edd1edc Update surface directly from SphericalSurfaceView
The SurfaceListener just sets the surface on the VideoComponent, but
SphericalSurfaceView already accesses the VideoComponent directly so it seems
simpler to update the surface directly.

PiperOrigin-RevId: 249242185
2019-05-23 13:26:19 +01:00
andrewlewis
f3f885c6aa Update a reference to SimpleExoPlayerView
PiperOrigin-RevId: 249068395
2019-05-21 13:52:30 +01:00
bachinger
a458635540 Add ProgressUpdateListener
Issue: #5834
PiperOrigin-RevId: 249067445
2019-05-21 13:52:14 +01:00
tonihei
33c677846a Use versioned manifest in all Robolectric tests.
We are currently defaulting to targetSdk=1 as no targetSdk is specified. Only
tests which explicitly ask for another SDK use another test SDK. With the
versioned manifest, all tests run using the targetSDK by default.

PiperOrigin-RevId: 249060796
2019-05-21 13:51:43 +01:00
aquilescanta
cf389268b0 Add links to the developer guide in some READMEs
PiperOrigin-RevId: 248221982
2019-05-15 18:14:07 +01:00
olly
f4968e1a8e Update translations
PiperOrigin-RevId: 246729123
2019-05-05 18:18:53 +01:00
olly
1ef49ed205 Fix broken Javadoc
PiperOrigin-RevId: 246728418
2019-05-05 18:18:34 +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
tonihei
21b2a471bb Toggle playback controls according to standard Android click handling.
We currently toggle the view in onTouchEvent ACTION_DOWN which is non-standard
and causes problems when used in a ViewGroup intercepting touch events.

Switch to standard Android click handling instead which is also what most
other player apps are doing.

Issue:#5784
PiperOrigin-RevId: 245219728
2019-04-26 18:32:42 +01:00
andrewlewis
b01075f325 Play out remaining data on reconfiguration
Before this change we'd release the audio track and create a new one as soon
as audio processors had drained when reconfiguring.

Fix this behavior by stop()ing the AudioTrack to play out all written data.

Issue: #2446
PiperOrigin-RevId: 244812402
2019-04-26 18:27:53 +01:00
olly
82061e9afb Improve progress reporting logic
- Listener based reporting of progress allows the content length
  to be persisted into the download index (and notified via a
  download state change) as soon as it's available.
- Moved contentLength back into Download proper. It should only
  ever change once, so I'm not sure it belongs in the mutable part
  of Download.
- Made a DownloadProgress class, for naming sanity.

PiperOrigin-RevId: 244242487
2019-04-18 23:24:11 +01:00
eguven
f9f009645d Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:22:35 +01:00
olly
ee08e7dcac Fix key and accessibility scrubbing
Issue: #5767
PiperOrigin-RevId: 243811443
2019-04-16 16:42:08 +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
tonihei
1ee51518ae Use new exoplayer.dev domain everywhere.
The old domain automatically forwards to the new one. For consistency, change
all doc and code references regardless.

Also adds GitHub CNAME config file which configures our page for the custom
domain.

PiperOrigin-RevId: 243592110
2019-04-16 15:25:27 +01:00
olly
68993f233d Improve DownloadNotificationHelper
- Remove completed downloads from progress notification.
- Treat restarting as a downloading, When there are both
remove and download tasks ongoing, we prefer to show a
download notification to a remove one. A restarting task
encapsulates is basically a (remove+download) task. Given
our preference, we should treat it as a download rather
than as a removal.

PiperOrigin-RevId: 242867228
2019-04-13 01:39:24 +01:00
eguven
8688bd2d88 Rename DownloadState to Download
PiperOrigin-RevId: 242839480
2019-04-13 01:38:25 +01:00
tonihei
f0cd144baf Update UI translations.
We have new strings for track role types.

PiperOrigin-RevId: 242829944
2019-04-13 01:38:05 +01:00
bachinger
8b766ba4b8 Use FLAG_UPDATE_CURRENT for PendingIntents of playback commands.
ISSUE: #5734
PiperOrigin-RevId: 242459668
2019-04-13 01:34:27 +01:00
bachinger
baf00406c0 Provide option to include next/prev button in lock screen/compact mode.
Issue: #5616
PiperOrigin-RevId: 242452686
2019-04-13 01:33:28 +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
eguven
27884c70f8 Make DownloadState counters mutable
PiperOrigin-RevId: 241763220
2019-04-05 21:12:35 +01:00
tonihei
32924e3f17 Use role flags in DefaultTrackNameProvider.
Also make combination of language and role flags the default over the label,
as it's more readable and auto-translated into other languages.

PiperOrigin-RevId: 240801070
2019-03-29 16:51:12 +00:00
tonihei
e5aed73fba Switch format language tag to use full BCP 47 codes.
This allows to distinguish between regional variants and scripts.

We still need to normalize the language code itself to make track selection
independent of the whether 2 or 3 letter codes are used.

PiperOrigin-RevId: 239783115
2019-03-22 19:56:25 +00:00
tonihei
8e80acd18f Use androidx.test and extensions.
This replaces the deprecated usages of RobolectricTestRunner and
RuntimeEnvironent and fully migrates the tests to androidx.

PiperOrigin-RevId: 238011667
2019-03-15 04:53:12 +00:00
tonihei
57e2ec6a1d Actually use view atrribute for min update interval.
We didn't read the attribute value so far.

PiperOrigin-RevId: 237420697
2019-03-15 04:51:08 +00:00
Oliver Woodman
89908794e6 Merge pull request #5496 from szaboa:dev-v2-5040
PiperOrigin-RevId: 237412166
2019-03-15 04:50:32 +00:00
olly
f35dbeb567 TrackSelectionView: Default to Auto when last check box deselected
PiperOrigin-RevId: 237052890
2019-03-06 17:29:18 +00:00
tonihei
36060e36cb Fix TrackSelectionView selection/deselection again.
There are 6 different situations which are now more explicitly covered to
ensure we handle them correctly:
1. Radio button (non-adaptive, single group only)
   Selected -> Do nothing.
   Unselected -> Replace override with selected track.
2. Check box (non-adaptive, but multi-group allowed)
   Selected -> Remove track (and override). If last one, set isDisabled flag.
   Unselected -> Replace override with selected track.
3. Check box (adaptive allowed, single or multi group)
   Selected -> Remove track. If last, remove override and maybe set isDisabled.
   Unselected -> Add track to override.

PiperOrigin-RevId: 236668642
2019-03-06 17:29:18 +00:00
tonihei
b48ceb19bd Remove unneccessary deprecated constants and classes.
This constants and classes are defined by the same name in the super class and
thus can be safely removed.

PiperOrigin-RevId: 236136197
2019-03-06 17:29:18 +00:00
tonihei
3eeb3acb3b Remove nullness suppressions.
These were added in an internal clean-up and are better fixed than suppressed.

PiperOrigin-RevId: 236118715
2019-03-06 17:29:18 +00:00
tonihei
84e20216d7 Do not allow deselection of radio button.
Instead just set the currently clicked item as override. If the already
selected button is clicked, the override is reset with the same value.

PiperOrigin-RevId: 236118429
2019-03-06 17:29:18 +00:00
tonihei
0bb123aa4c TrackSelectionView: Use same "isAdaptive" logic in updateViews and onClick.
We currently do not show check boxes if the renderer does not support adaptive
switches between tracks in one group. However, we assume check boxes in the
onClick method.

Use same logic for both methods to be consistent.

PiperOrigin-RevId: 236118372
2019-03-06 17:29:18 +00:00
andrewlewis
253ea78679 Register the overlay view as non-obstructing
Currently IMA determines that the overlay is obstructing, even
if it's empty. Register it as friendly, which means we're
assuming that anything the apps puts in it is necessary for
playback.

PiperOrigin-RevId: 234963065
2019-02-21 11:56:10 +00:00
olly
1450b3713f Suppress warnings emitted by Checker Framework version 2.6.0
PiperOrigin-RevId: 234917536
2019-02-21 11:56:02 +00:00
olly
bfc60e1694 Set vertical orientation by default in TrackSelectionView
Horizontal orientation doesn't make sense. I thought about
overriding the setter to throw something, but it's probably
not worth the extra lines.

PiperOrigin-RevId: 234632530
2019-02-20 13:55:33 +00:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
tonihei
c6195dbbaf Handle recreation of TrackSelectionView instances.
TrackSelectionView requires an initialization with a call to init(...).
That's why we shouldn't let the view retain its view hierarchy automatically
as the views won't be backed by data if restored. Instead add a listener
which lets the containing activity/fragment save and restore the state if
needed.

PiperOrigin-RevId: 234152491
2019-02-18 17:40:48 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
tonihei
399a963e02 Revert removal of single track option in TrackSelectionView.
PiperOrigin-RevId: 233584155
2019-02-18 15:59:12 +00:00
olly
a21572f0dd Fix minor issues and lint errors
PiperOrigin-RevId: 233428556
2019-02-18 15:58:37 +00:00
olly
6d461f5b25 Fix PlayerNotificationManager lint error
builder.mActions is marked as @RestrictTo(LIBRARY_GROUP). We'll
just have to put up with notification flicker on KitKat if the
actions change.

PiperOrigin-RevId: 233420076
2019-02-18 15:58:27 +00:00
andrewlewis
56944caa21 Allow registration of control overlays for ad viewability
Switch from passing an ad UI ViewGroup to passing an object that can also
provide information about controls overlays.

Also switch to using a dedicated overlay for ads instead of the overlay frame
layout, which apps have easy access to.

PiperOrigin-RevId: 233393500
2019-02-18 15:58:06 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
tonihei
abb53d7ce7 Support multiple overrides in TrackSelectionView and factor out Builder.
Supporting multiple overrides allows to select tracks from multiple groups, if
enabled. As more options are added, the creation of the dialog is moved to a
separate builder class.

PiperOrigin-RevId: 233366282
2019-02-18 15:57:44 +00:00
andrewlewis
ef139b2e31 Add an overlay FrameLayout for ad UI
This will be used instead of the current overlay FrameLayout (which apps can
interact with directly).

PiperOrigin-RevId: 233077175
2019-02-18 15:57:29 +00:00
Arnold Szabo
eaf0d40886 Extract time bar delay calculations to a static method 2019-02-16 12:17:09 +02:00
Arnold Szabo
ecfce46296 Changes according to the code review 2019-02-13 19:31:11 +02:00