694 Commits

Author SHA1 Message Date
olly
e160649d9c README updates for MediaSource, DataSource and UI modules
PiperOrigin-RevId: 401793145
2021-10-09 18:21:54 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
andrewlewis
1d29f12677 Update translations
PiperOrigin-RevId: 401767033
2021-10-09 18:10:12 +01:00
olly
d45cf6028d Remove reference to ExoPlayer from UI module
PiperOrigin-RevId: 401751490
2021-10-09 17:54:50 +01:00
ibaker
fc25798af6 Add public.xml to UI module with an empty <public /> node
This is the recommended way to mark all resources as private:
https://developer.android.com/studio/projects/android-library#PrivateResources

PiperOrigin-RevId: 401470108
2021-10-07 21:57:50 +01:00
ibaker
ee71c8387c Migrate usages of deprecated Player COMMAND_ constants
PiperOrigin-RevId: 401292817
2021-10-06 21:19:37 +01:00
olly
80d365163d Rollback of 912c47ff6f
*** Original commit ***

Rollback of 8ed6c9fcf5

*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

***

PiperOrigin-RevId: 400942287
2021-10-05 23:18:25 +01:00
krocard
ac881be2fc Add TracksInfo to the Player API
TracksInfo is very similar to
`MappingTrackSelector.MappedTracksInfo` with some
fields removed to simplify the Player API,
notably it doesn't expose the renderer concept.

A significant difference is the addition of a `selected` boolean
field which avoids having a separate `getCurrentTrackSelection`
API.

This cl is a part of the bigger track selection change,
splitted for ease of review.

In particular, the MediaSession implementation and UI usage
have been slitted in child cls.

Find all cls with the tag:
#player-track-selection

PiperOrigin-RevId: 400937124
2021-10-05 23:15:16 +01:00
olly
912c47ff6f Rollback of 8ed6c9fcf5
*** Original commit ***

Fix capitalization of language in track selector

Issue: #9452

***

PiperOrigin-RevId: 400706984
2021-10-04 15:40:47 +01:00
olly
ac4a7e919a Remove ExoPlayer link from UI module
PiperOrigin-RevId: 400706800
2021-10-04 15:37:48 +01:00
olly
8ed6c9fcf5 Fix capitalization of language in track selector
Issue: #9452
PiperOrigin-RevId: 400680794
2021-10-04 12:13:49 +01:00
bachinger
168d0cc9a6 Merge pull request #9525 from talklittle:fix-initial-position
PiperOrigin-RevId: 400666736
2021-10-04 11:56:36 +01:00
bachinger
014ee8f5d8 Remove fully qualified class names in link tags
PiperOrigin-RevId: 400224459
2021-10-04 11:53:39 +01:00
Andrew Shu
e883c04006 Fix setting initial 0 position in PlayerControlView 2021-10-03 15:58:05 -07:00
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