680 Commits

Author SHA1 Message Date
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +01:00
andrewlewis
71a4b6337c Fix javadoc consistency
#exofixit

PiperOrigin-RevId: 396304941
2021-09-14 11:56:45 +01:00
klhyun
442a5f4500 Update PlayerView's UI when available commands change
PiperOrigin-RevId: 395395015
2021-09-08 16:58:44 +01:00
olly
86f8c4e44e Fix some PlayerControlView accessibility issues
- Fix focus when pausing and resuming
- Prevent repeated readout of the playback position when paused

#exofixit
#minor-release
Issue #9111

PiperOrigin-RevId: 395301765
2021-09-07 20:28:54 +01:00
olly
730cdbb9e6 Use defStyleAttr when obtaining styled attributes in player views
#minor-release
#exofixit
Issue #9024

PiperOrigin-RevId: 395224661
2021-09-07 17:48:45 +01:00
andrewlewis
654a320792 Remove stray symlinks
These are unneeded for the external project

#minor-release

PiperOrigin-RevId: 392835942
2021-08-25 10:58:20 +01:00
bachinger
2f09ecef53 Make constructor of PlayerNotificationManager protected
Issue: #9303
#minor-release
PiperOrigin-RevId: 392022613
2021-08-23 14:08:39 +01:00
olly
3f16730763 Support generating notifications for paused downloads
- Android 12 will not allow our download service to be
  restarted from the background when conditions that
  allow downloads to continue are met. As an interim
  (and possibly permanent) solution, we'll keep the
  service in the foreground if there are unfinished
  downloads that would continue if conditions were met.
- Keeping the service in the foreground requires a
  foreground notification. Hence we need to be able to
  generate a meaningful notification for this state.

PiperOrigin-RevId: 391969986
2021-08-20 16:25:43 +01:00
kimvde
1ae879788a Fix issue caused by using ForwardingPlayer and StyledPlayerControlView
StyledPlayerControlView was checking whether the player is an ExoPlayer
instance to set the track selector. This means that, if apps were
wrapping an ExoPlayer in a ForwardingPlayer (to replace a
ControlDispatcher for example), the track selector wasn't set anymore.

#minor-release

PiperOrigin-RevId: 391776305
2021-08-20 11:49:12 +01:00
andrewlewis
ce4c8e405c Add some range annotations
PiperOrigin-RevId: 391253301
2021-08-17 15:48:10 +01:00
olly
38e5864f87 Remove Player.Listener inheritance of TextOutput
PiperOrigin-RevId: 390630998
2021-08-17 15:37:29 +01:00
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
7dffb2dc4d Migrate to Player.Listener
PiperOrigin-RevId: 390124675
2021-08-11 17:32:55 +01:00
ibaker
db1fe8041b Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

Follow-up to 0df0df9aee

PiperOrigin-RevId: 389616471
2021-08-09 20:02:05 +01:00
andrewlewis
9c27cfcda7 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).

PiperOrigin-RevId: 387290360
2021-07-28 09:15:29 +01:00
samrobinson
0b0277af50 Set StyledPlayerView/PlayerView artwork from MediaMetadata.
PiperOrigin-RevId: 385763366
2021-07-21 14:41:20 +01:00
kimvde
31c9875ec9 Deprecate ControlDispatcher in the UI
PiperOrigin-RevId: 385129211
2021-07-20 08:38:13 +01:00
kimvde
3830848888 Use Player methods in DefaultControlDispatcher
PiperOrigin-RevId: 385118021
2021-07-20 08:36:46 +01:00
klhyun
f173ffa972 Do not set aspect ratio if unknown.
When the size of the video is unknown,
PlayerView and StyledPlayerView set the aspect ratio as 1,
which could result in wrong view layout.

This CL sets the aspect ratio as 0 (unset) to prevent that.

This handles Issue: #9189.

PiperOrigin-RevId: 385115357
2021-07-20 08:35:17 +01:00
kimvde
626c3e9843 Remove fastforward_increment and rewind_increment attributes
This values won't be configurable from the UI anymore once the
DefaultControlDispatcher is removed.

They can be configured in the Player or by using a ForwardingPlayer.

PiperOrigin-RevId: 385113498
2021-07-20 08:33:49 +01:00
kimvde
227f9a3b93 PlayerNotificationManager: add setUseRewind/FastForwardAction
This is a preliminary step to deprecate ControlDispatcher.

PiperOrigin-RevId: 385097270
2021-07-16 11:25:42 +01:00
kimvde
85f3af8864 Use Player commands to enable UI buttons
PiperOrigin-RevId: 384910388
2021-07-15 14:45:44 +01:00
olly
08ac778ad6 Fix package name for UI tests
PiperOrigin-RevId: 384893655
2021-07-15 13:23:42 +01:00
samrobinson
b9ac5a145f Implement a DefaultMediaDescriptionAdapter that uses MediaMetadata.
PiperOrigin-RevId: 384681659
2021-07-14 21:16:20 +01:00
olly
822f6282f1 The sound, vibrate and ticker will only be played once
Android doc:https://developer.android.com/reference/android/app/Notification.Builder#setOnlyAlertOnce(boolean)

PiperOrigin-RevId: 384227580
2021-07-13 10:04:11 +01:00
kimvde
7e6d82237a Rename MEDIA_ITEM to WINDOW is seek commands
This is more correct and is consistent with the Javadoc.

PiperOrigin-RevId: 383808096
2021-07-13 09:56:42 +01:00
samrobinson
d9618b5104 Fix missing word in javadoc.
PiperOrigin-RevId: 383448851
2021-07-09 09:19:01 +01:00
samrobinson
23c884ee2a Add @return to the MediaDescriptionAdapter documentation.
PiperOrigin-RevId: 383268454
2021-07-09 09:08:11 +01:00
ibaker
3bd662eb9a Don't propagate attrs into child SubtitleOutput from SubtitleView
#minor-release

PiperOrigin-RevId: 382763308
2021-07-09 08:51:39 +01:00
klhyun
3c97815d55 PlayerView sets aspect ratio when setting a new player
PlayerView and StyledPlayerView handled this in
onVideoSizeChanged but it can be omitted.
(e.g. if the player is MediaController)

PiperOrigin-RevId: 382340927
2021-07-09 08:28:37 +01:00
olly
7aaba1ffe5 Migrate usage of Player.EventListener to Player.Listener
PiperOrigin-RevId: 381837274
2021-06-30 13:43:51 +01:00
olly
9df2e42d4d Fix expansion of items within StyledPlayerView popup
Issue: #9086
#minor-release
PiperOrigin-RevId: 380756562
2021-06-22 10:17:28 +01:00
olly
b1dda6a02a Fix DefaultTimeBar glitches
The glitches were introduced in:
https://github.com/google/ExoPlayer/commit/6c31e34528

The problem is that Listener.onEvents is called in a later looper iteration
than the listener methods that were previously used. This created a gap on
the main thread between the UI component dispatching a seek operation to the
player, and onEvents being called to update the progress bar's position.

At the start of this gap the progress bar is rendering the new position,
but its position member variable is still set to the old position. If the
progress bar is re-drawn by another message on the main thread within the
gap, it will briefly show the old position until onEvents is called.

There are multiple possible fixes to this, and the best one is probably to
modify ListenerSet to remove the gap. That's high risk though, so for now we
fix the flicker by always updating the progress immediately after the seek
is dispatched, in addition to when onEvents is called.

Issue: #9049
#minor-release
PiperOrigin-RevId: 380678388
2021-06-21 23:52:43 +01:00
olly
3d3ac623a6 Specify a root when inflating child views
#minor-release

PiperOrigin-RevId: 380655806
2021-06-21 22:31:52 +01:00
olly
6f686be751 Workaround for focus issues on API levels less than 26
Issue: #9061
PiperOrigin-RevId: 380640601
2021-06-21 22:30:38 +01:00
olly
63f12f0216 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    TAP for global presubmit queue passed after automated deflaking of failures: http://mondo/deflaker/run/ff80a4f9-d5d7-47ac-9560-63372e1ff624 http://mondo/deflaker/run/ca3ce61f-2af8-4fa7-b6e4-c98b5c4d950c
    http://test/OCL:379405669:BASE:379421861:1623763190392:bd2d256a
PiperOrigin-RevId: 379623080
2021-06-21 21:57:56 +01:00
olly
3e819d082a Make javadoc valid html5
As of [JDK-8247957](https://bugs.openjdk.java.net/browse/JDK-8247957), doclint
no longer supports html4.

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 378819179
2021-06-11 12:23:35 +01:00
olly
628ebeeb2b Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 378184078
2021-06-09 00:09:16 +01:00
aquilescanta
4e85184955 Make PlayerView depend on PlaybackException
PiperOrigin-RevId: 377542206
2021-06-08 12:59:38 +01:00
aquilescanta
536f7c8dbe Make StyledPlayerView depend on PlaybackException
PiperOrigin-RevId: 377480089
2021-06-08 12:53:22 +01:00
bachinger
46687fecb1 Allow fast forward and rewind actions in compact view
PiperOrigin-RevId: 377107132
2021-06-03 13:51:40 +01:00
olly
85b6a51666 Add DoNotInstrument annotations to DASH and UI tests
PiperOrigin-RevId: 377048460
2021-06-02 18:19:02 +01:00
tonihei
2938d40bf4 Allow to specify the number of removed ad groups in AdPlaybackState.
This helps to remove old ad groups (e.g. those that fell out
of the live window) to keep the data size of AdPlaybackState small.

Also added this case to some existing unit tests to ensure it's
covered.

PiperOrigin-RevId: 376170653
2021-05-27 18:49:53 +01:00
olly
4b0c987675 Fix StyledPlayerView detachment
Issue: #8985
#minor-release
PiperOrigin-RevId: 375913914
2021-05-27 10:40:14 +01:00
Oliver Woodman
afe4217c1c Merge pull request #8943 from dlafayet:embeddedstyle2
PiperOrigin-RevId: 375484765
2021-05-26 11:28:37 +01:00
Denise LaFayette
e3228064f3 Introduce LanguageFeatureStyle interface to mark language features 2021-05-17 13:20:34 -07:00
Denise LaFayette
49dfe66bb3 Preserve Japanese language features when not applying embedded styling
Fix bug where rubies and boutens are missing, tate-chu-yoko is rendered
incorrectly when SubtitleView.setApplyEmbeddedStyles(false). This method
should only affect styling elements and not remove any language features.
2021-05-14 16:37:37 -07:00
olly
cc05e85700 Minor translation updates
#minor-release

PiperOrigin-RevId: 373543587
2021-05-13 11:05:15 +01:00
olly
5ff2d24fab Update PlayerNotficationManager to set PendingIntent.FLAG_IMMUTABLE on its Broadcast intent.
In Android 12 mutability flags have to be set on PendingIntents. If they are not, and the app targets Android 12, then the app will be crashed by the system.

PiperOrigin-RevId: 373427591
2021-05-13 10:51:48 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00