77 Commits

Author SHA1 Message Date
tofunmi
feb83c2d59 Update translations
PiperOrigin-RevId: 529069808
(cherry picked from commit bba760f6e5ae8ba6db2cd2e45163698223335c2a)
2023-05-15 16:32:38 +01:00
rohks
2ca9050134 Add media3 guide entries in README files
PiperOrigin-RevId: 520650881
(cherry picked from commit 766e7d7d35f20b91a2c72635ac13b10ad9d22dac)
2023-03-31 13:36:24 +01:00
rohks
d1d16659a6 Fix javadoc links in media README files
Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.

#minor-release

PiperOrigin-RevId: 520636868
(cherry picked from commit 6a928805d4b0f52f5f07b1f7cd75e2a7357e9397)
2023-03-31 13:35:43 +01:00
tonihei
7958737655 Fix lint-baseline.xml for latest UI translations
#minor-release

PiperOrigin-RevId: 513533248
(cherry picked from commit 8498e4b4445ae88665c6cdbc4e47e8e6ca7b7303)
2023-03-02 17:58:04 +00:00
tonihei
ee4ac61640 Update translations
#minor-release

PiperOrigin-RevId: 512890813
(cherry picked from commit a7faa5bfd8c82e22c7d99378cf78f31a57274db2)
2023-03-02 09:44:16 +00:00
tonihei
5e6f79ae63 Tweak UI behavior when commands are missing.
For most missing commands, we already disable the corresponding
controls. This change extends this to more UI elements that are
disabled in case the corresponding action is unavailable.

#minor-release

PiperOrigin-RevId: 505057751
(cherry picked from commit b3e7696ba7d66a2d3c477858194a20789f4d75c7)
2023-02-02 13:18:29 +00:00
tonihei
55312e1257 Add missing command checks in UI module
The commands are partly checked already before enabling
features or calling player methods, but the checks were
still missing in many places.

#minor-release

PiperOrigin-RevId: 504589888
(cherry picked from commit e2ece2f5bcda0cea436d782d58fa6f1d9a4d1f99)
2023-01-26 14:26:00 +00:00
Googler
d41eedecb4 Disables play/pause button when there's nothing to play
PiperOrigin-RevId: 502571320
(cherry picked from commit d49a16e094d6d4bde0d1dc1ec42876c156b9c55a)
2023-01-25 18:18:42 +00:00
ibaker
a94aa8dbd9 Fix order of playback controls in RTL layout
Issue: androidx/media#227

#minor-release

PiperOrigin-RevId: 497159283
(cherry picked from commit 80603427abbd0da09f21e381cc10a5d47fb6d780)
2023-01-25 18:17:16 +00:00
ibaker
7d3375c6ec Fix recursive loop when registering controller visibility listeners
There are two overloads of this method due to a type 'rename' from
`PlayerControlView.VisibilityListener` to
`PlayerView.ControllerVisibilityListener`. Currently when you call one
overload it passes `null` to the other one (to clear the other listener).
Unfortunately this results in it clearing itself, because it receives
a null call back!

This change tweaks the documentation to clarify that the 'other'
listener is only cleared if you pass a non-null listener in. This solves
the recursive problem, and allows the 'legacy' visibility listener to be
successfully registered.

Issue: androidx/media#229

#minor-release

PiperOrigin-RevId: 496876397
(cherry picked from commit 4087a011e21aba2c27e3ae890f74a65812c6f4ce)
2023-01-25 18:17:16 +00:00
bachinger
9817c46923 Use theme when loading drawables on API 21+
Issue: androidx/media#220
PiperOrigin-RevId: 495642588
(cherry picked from commit 22dfd4cb32fdb76ba10047f555c983490c27eb13)
2023-01-25 18:17:15 +00:00
ibaker
3df6949c52 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
(cherry picked from commit 636a4a8538ccfb235eeca7d9131d4b5d4d95e9aa)
2023-01-25 18:01:21 +00:00
tonihei
91c51fe94d Mark broadcast receivers as not exported
They are called from the system only and don't need to be exported
to be visible to other apps.

PiperOrigin-RevId: 489210264
(cherry picked from commit 22ccc1a1286803868970fb2b1eafe63e9c669a5c)
2023-01-25 17:37:31 +00:00
ibaker
950ea910db Remove ForwardingPlayer special case from PlayerControlView.setPlayer
This was originally added in 4fd7d777b6, but it hasn't done anything
since 98ee159df1 (when the instanceof ExoPlayer check was removed).

PiperOrigin-RevId: 482161662
(cherry picked from commit a5b09b8cccca80fb7c40a9576e029ef462b64582)
2022-10-19 10:40:06 +00:00
ibaker
1c37ad6470 Remove more references to overriding layouts from Player(Control)View
In exoplayer2 this affects StyledPlayer(Control)View

#minor-release

PiperOrigin-RevId: 481878940
(cherry picked from commit cc1d35cfd787a02124c48d9e7df1c94dd78da085)
2022-10-18 10:55:13 +00:00
Googler
ca411a0141 Fix display settings window UI bug for foldable devices.
PiperOrigin-RevId: 481215581
(cherry picked from commit 0128fa36e7bdc63f72d8369b8c59310e2dc2ec2f)
2022-10-14 20:07:09 +00:00
ibaker
2382016e7b Fix the position of IntDef annotations on fields in the UI module
PiperOrigin-RevId: 481150758
(cherry picked from commit e1d3f1b863ed195a2bbf9a40d05da97b193383f5)
2022-10-14 15:21:58 +00:00
ibaker
5fe0cf6af2 Mark effectively-final PlayerControlView fields as actually final
This means the null checker can be more sure that these fields don't
get reassigned between a null-check and a usage.

PiperOrigin-RevId: 481142004
(cherry picked from commit e97b25a668035679fce798e978af576303b0e10e)
2022-10-14 14:33:04 +00:00
bachinger
db25954dfd Use the current overrides of the player as preset
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
(cherry picked from commit 5c2aabca660e7618ebe410d8ab7de95acc76ee1a)
2022-07-18 10:36:01 +00:00
olly
6eb30ce233 Add TODOs for registerReceiver calls without flag
PiperOrigin-RevId: 461165173
(cherry picked from commit 9271572e950230a24da69a6ec5838dd838ea672d)
2022-07-15 10:34:53 +00:00
ibaker
258d9361c4 Ensure TalkBack announces the selected playback speed in the UI menu
Issue: google/ExoPlayer#10298
PiperOrigin-RevId: 457991028
(cherry picked from commit 3fc6a66527c6af940b45dd0d2ce1f3fb19491fa0)
2022-06-29 16:10:11 +00:00
bachinger
e53a649a41 Add lint base xml file for string.xml files
Fixing lint errors in the string.xml files makes no sense because these are
overridden with the next automated string import. Adding a lint-baseline.xml
instead for the ui module.

See https://issuetracker.google.com/208178382

#minor-release

PiperOrigin-RevId: 455354304
(cherry picked from commit 61ab75b8b88050a12492c412e8c79ebf75fc1d9c)
2022-06-16 13:05:17 +00:00
bachinger
5ebc07ce76 Updating translations
#minor-release

PiperOrigin-RevId: 455128997
(cherry picked from commit 958105c91c931fa942ce7de4e8311589eca76564)
2022-06-15 17:00:36 +00:00
bachinger
fde58ed91d Add many quantity for fr an fr-CA
See https://issuetracker.google.com/208178382

PiperOrigin-RevId: 454949204
(cherry picked from commit 1f380c1dd36b4554286d0f4e93bc0479579eb991)
2022-06-15 16:52:51 +00:00
rohks
001090cc43 Migrate leaf listeners of Player to new onCues override
PiperOrigin-RevId: 449587030
2022-05-24 11:02:03 +01:00
rohks
c728647290 Create new class to store cues and timestamp.
We need to pass timestamp for the list of cues so we are defining a new class CueGroup which will store both cues and timestamp.

PiperOrigin-RevId: 449212054
2022-05-24 10:49:48 +01:00
ibaker
54d8b5bc7c Don't implement Player.Listener from SubtitleView
We never register SubtitleView as a Player.Listener directly, it's
always done via PlayerView.

PiperOrigin-RevId: 447467037
2022-05-10 17:48:12 +01:00
ibaker
8323c69ed2 Allow stable API users to register PlayerView listeners
These listeners cover controller visibility and fullscreen button
clicks.

PiperOrigin-RevId: 445420757
2022-05-09 10:41:49 +01:00
ibaker
abbd7652b1 Add more UI symbols (and some others) to the stable API
These are used by the main demo app and would be reasonably used by
other relatively simple media playback apps.

PiperOrigin-RevId: 445371266
2022-05-09 10:37:42 +01:00
ibaker
5766cd52ba Add copies of PlayerControlView's public listeners to PlayerView
Developers are expected to (eventually) only use methods on
PlayerView (and not PlayerControlView) to interact with the UI
controller.

PiperOrigin-RevId: 445361488
2022-05-09 10:35:58 +01:00
ibaker
5186798db9 Rename Player.COMMAND_GET_TRACK_INFOS to COMMAND_GET_TRACKS
`Player.getCurrentTracksInfo` was renamed to `Player.getCurrentTracks` in
83daa052cb.

PiperOrigin-RevId: 441825078
2022-04-26 14:41:41 +01:00
olly
d9f0c2c071 Tracks.Group/TrackGroup variable naming disambiguation
PiperOrigin-RevId: 441712166
2022-04-26 14:37:35 +01:00
olly
83daa052cb Rename TracksInfo and TrackGroupInfo
1. TracksInfo is renamed to Tracks
2. TracksInfo.TrackGroupInfo is renamed to Tracks.Group

PiperOrigin-RevId: 441232373
2022-04-26 14:30:14 +01:00
Ian Baker
ea61511a24 Merge pull request #10047 from LuGO0:9432/added-filtering-for-forced-text-tracks
PiperOrigin-RevId: 439262085
2022-04-06 11:50:35 +01:00
ibaker
2a2873840d Add PlayerView to the stable API
PiperOrigin-RevId: 437777445
2022-04-06 11:11:54 +01:00
ibaker
da3cb63c5e Remove exo_legacy_player_view.xml from media3
This is only used by LegacyPlayerView which was removed in
6aa1816bd3

PiperOrigin-RevId: 437018966
2022-03-24 16:54:31 +00:00
ibaker
90d1c6fc33 Tolerate the result of View.getLayoutParams being null
PiperOrigin-RevId: 437017422
2022-03-24 16:47:44 +00:00
olly
ea2fbfd0a1 Suppress new nullness warnings when stub for View.getLayoutParams is added.
I am suppressing these warnings so that the stub file can be added and future usages will be checked correctly. As noted in https://developer.android.com/reference/android/view/View#getLayoutParams() this can be null before params are set. This was produced by running the TGP on <unknown commit>.

More information: go/new-nullness-stubs-lsc

Tested:
    Automated deflaking failed to skip failures:  http://mondo/deflaker/run/ff55923b-d76d-4eba-86dc-1b3077362352
    http://test/OCL:435678706:BASE:436509228:1647985874385:4fae6f0a
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 436951684
2022-03-24 10:15:13 +00:00
olly
29fb77ea3a Rollback of 98e039d872
*** Original commit ***

Rollback of aa22bc2dbe

*** Original commit ***

Fix PlayerView touch handling

Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClick...

***

PiperOrigin-RevId: 434502423
2022-03-14 17:29:56 +00:00
olly
98e039d872 Rollback of aa22bc2dbe
*** Original commit ***

Fix PlayerView touch handling

Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the vi...

***

PiperOrigin-RevId: 433262414
2022-03-09 15:11:23 +00:00
olly
aa22bc2dbe Fix PlayerView touch handling
Overriding onTouchEvent was causing multiple issues, and
appears to be unnecessary. Removing the override fixes:

1. StyledPlayerView accessibility issue where "hide player
   controls" actually toggled play/pause.
2. Delivery of events to a registered OnClickListener when
   useController is false.
3. Delivery of events to a registered OnLongClickListener
   in all configurations.
4. Incorrectly treating a sequence of touch events that
   exit the bounds of the view before ACTION_UP as a click,
   both for delivery to OnClickListener and for toggling
   the controls.

Note: After this change, control visibility will not be
toggled if the application developer explicitly sets the
view to be non-clickable. I think that's probably working
as intended though. It seems correct that a non-clickable
view would not respond to clicks.

Issue: google/ExoPlayer#8627
Issue: google/ExoPlayer#9605
Issue: google/ExoPlayer#9861
PiperOrigin-RevId: 433016626
2022-03-09 15:05:07 +00:00
olly
08b861b61a Decouple UI module from ExoPlayer
This change rewrites the UI module's track selection
components to depend on the Player API, allowing us to
finally remove the UI module's dependency on ExoPlayer
as a concrete player implementation.

PiperOrigin-RevId: 432989318
2022-03-09 15:04:11 +00:00
ibaker
c2a3249f98 Remove unused constants from (Styled/Legacy)PlayerView
These were added in
b57aa34b66
and then not removed when the rest of the code was removed in
0b0277af50

PiperOrigin-RevId: 432419684
2022-03-04 13:07:27 +00:00
ibaker
a353b3332a Remove media3 PlayerView javadoc references to overriding layouts
These should have been removed as part of 1391b7c65d, since we no
longer officially support overriding the layout file for this class.

This class is known as StyledPlayerView in exoplayer2.

#minor-release

PiperOrigin-RevId: 432411322
2022-03-07 11:30:48 +00:00
olly
68c310a94a TrackSelectionParameters: Simplify disabling of track types
As evidenced by the somewhat awkward logic in PlayerControlView, the
previous design wasn't very friendly to expected usage. There will be
more usage when the track selection dialog components are migrated,
which would be similarly awkward without this change.

PiperOrigin-RevId: 431407675
2022-03-01 09:45:38 +00:00
Ian Baker
38717ce969 Reformat some javadoc 2022-02-18 14:54:02 +00:00
olly
8b01d07512 Flatten TrackSelectionParameters
PiperOrigin-RevId: 428747243
2022-02-17 11:52:23 +00:00
olly
76839a02d6 Add getFormat and length to TrackGroupInfo
PiperOrigin-RevId: 428520090
2022-02-17 10:37:20 +00:00
tonihei
0314d14737 Set character limit for accessability strings to NONE
They are not normally displayed in any size-restricted UI element and don't
need a character limit.

#minor-release

PiperOrigin-RevId: 427998164
2022-02-17 10:23:57 +00:00
ibaker
502bb9afdd Remove LegacyPlayerView from media3
Apps should migrate to PlayerView (called StyledPlayerView in
exoplayer2) before migrating from exoplayer2 to media3.

PiperOrigin-RevId: 427222944
2022-02-17 10:02:49 +00:00