350 Commits

Author SHA1 Message Date
olly
904e3f8d47 Define default colors as constants
It's confusing that app:played_color also modifies the colors
that derive from it, but the corresponding setter does not. It
seems generally clearer just to define constants.

PiperOrigin-RevId: 273249557
2019-10-13 12:19:04 +01:00
olly
97cfcb57e6 Cleanup: Only clamp seek positions for FFWD/RWND
It's confusing that seekTo(player, windowIndex, positionMs) does
clamping, because it only makes sense if windowIndex is the current
window.

Note: This doesn't actually fix anything (other than code clarity).
In cases where we were passing other windowIndices, we always
passed 0 as the position and so the clamping logic wouldn't have
had any effect.
PiperOrigin-RevId: 272857104
2019-10-13 12:18:23 +01:00
andrewlewis
495b418fb1 Add missing player null check
PiperOrigin-RevId: 272654378
2019-10-13 12:17:10 +01:00
tonihei
76a1dd3da2 Use Player.isPlaying in appropriate places.
This method should be used where we previously checked for active playback
by state==READY and playWhenReady=true. Using the new method ensures we take
audio focus into account for these usages.

Also update some method naming to avoid confusion with the isPlaying method.

Issue:#6203
PiperOrigin-RevId: 270910982
2019-10-13 12:01:04 +01:00
olly
57370b37ce Update translations
PiperOrigin-RevId: 269521864
2019-09-17 09:07:55 -07:00
bachinger
32a8625fb7 allowing 36 characters for shuffle mode off
PiperOrigin-RevId: 268478545
2019-09-17 09:06:50 -07:00
bachinger
cf3cfa1d69 allow 33 characters for strings of shuffle on/off
PiperOrigin-RevId: 268238764
2019-09-17 09:06:43 -07:00
bachinger
b2aa0ae087 provide content description for shuffle on/off button
PiperOrigin-RevId: 266884166
2019-09-17 09:06:13 -07:00
bachinger
332afc9f79 move transparency values of buttons to resources to make it accessible for customization
PiperOrigin-RevId: 266880069
2019-09-16 16:57:53 -07:00
bachinger
c879bbf64c move transparency of shuffle mode off button to bitmap
PiperOrigin-RevId: 266795413
2019-09-16 16:56:55 -07:00
bachinger
4712bcfd53 use isPlaying to determine which notification action to display in compact view
PiperOrigin-RevId: 266782250
2019-09-16 16:54:18 -07:00
tonihei
936a7789c9 Check if controller is used when performing click directly.
Issue:#6260
PiperOrigin-RevId: 261647858
2019-08-05 20:35:56 +01:00
olly
b0c2b1a0fa Bump annotations dependency
PiperOrigin-RevId: 261353271
2019-08-02 19:08:20 +01:00
Oliver Woodman
309d043cee Merge pull request #6239 from ittiam-systems:vorbis-picture-parse
PiperOrigin-RevId: 261087432
2019-08-01 20:51:40 +01:00
Oliver Woodman
0b756a9646 Merge pull request #6042 from Timbals:dev-v2
PiperOrigin-RevId: 258812820
2019-07-26 17:01:18 +01:00
olly
b6777e030e Remove some UI classes from nullness blacklist
PiperOrigin-RevId: 256751627
2019-07-26 16:52:05 +01:00
andrewlewis
1d766c4603 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-07-09 11:39:36 +01:00
tonihei
71e0f2e81c Don't consume touch events if no controller is attached.
Issue:#6109
PiperOrigin-RevId: 255933121
2019-07-09 11:31:24 +01:00
bachinger
5d544974e9 keep notification when stop(false) is called
ISSUE: #6041
PiperOrigin-RevId: 253958225
2019-06-19 18:53:43 +01:00
tonihei
25e93a178a 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-05-31 22:57:50 +01:00
olly
9860c486e0 Keep controller visible on d-pad key events
PiperOrigin-RevId: 250661977
2019-05-31 22:45:24 +01:00
aquilescanta
42ffc5215f Fix anchor usage in SubtitlePainter's setupBitmapLayout
According to Cue's constructor (for bitmaps) documentation:
+ cuePositionAnchor does horizontal anchoring.
+ cueLineAnchor does vertical anchoring.

Usage is currently inverted.

Issue:#5633
PiperOrigin-RevId: 250253002
2019-05-31 22:37:14 +01:00
olly
94c10f1984 Propagate attributes to DefaultTimeBar
Issue: #5765
PiperOrigin-RevId: 249251150
2019-05-31 22:31:53 +01:00
andrewlewis
1d0618ee1a 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-31 22:30:30 +01:00
andrewlewis
e4d66c4105 Update a reference to SimpleExoPlayerView
PiperOrigin-RevId: 249068395
2019-05-31 22:29:56 +01:00
bachinger
b4d72d12f7 Add ProgressUpdateListener
Issue: #5834
PiperOrigin-RevId: 249067445
2019-05-31 22:29:40 +01:00
aquilescanta
6e9df31e7d Add links to the developer guide in some READMEs
PiperOrigin-RevId: 248221982
2019-05-15 20:03:46 +01:00
olly
90cb157985 Update translations
PiperOrigin-RevId: 246729123
2019-05-05 18:24:21 +01:00
Oliver Woodman
ce37c79968 Fix Javadoc 2019-05-03 21:12:02 +01:00
olly
54a5d6912b 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:42:57 +01:00
eguven
6d8bd34590 Add missing DownloadService build*Intent and startWith* methods
PiperOrigin-RevId: 244196081
2019-04-18 23:42:20 +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