59 Commits

Author SHA1 Message Date
bachinger
5c2aabca66 Use the current overrides of the player as preset
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
2022-07-21 12:39:46 +00:00
olly
9271572e95 Add TODOs for registerReceiver calls without flag
PiperOrigin-RevId: 461165173
2022-07-15 12:19:04 +00:00
ibaker
3fc6a66527 Ensure TalkBack announces the selected playback speed in the UI menu
Issue: google/ExoPlayer#10298
#minor-release
PiperOrigin-RevId: 457991028
2022-07-04 19:43:48 +00:00
bachinger
61ab75b8b8 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
2022-06-16 12:58:29 +00:00
bachinger
958105c91c Updating translations
#minor-release

PiperOrigin-RevId: 455128997
2022-06-15 15:34:08 +00:00
bachinger
1f380c1dd3 Add many quantity for fr an fr-CA
See https://issuetracker.google.com/208178382

PiperOrigin-RevId: 454949204
2022-06-15 15:26:36 +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
tonihei
1df5572dd2 Update some text descriptions to ease translations.
Some strings didn't mention the context in which they are used
(for example as item in a list, or for accessibility). This makes it
harder for translators to choose the most appropriate translation and
grammar.

Also fix repeat and shuffle mode button accessibility descriptions to
indicate the action, not the current state.

PiperOrigin-RevId: 426924163
2022-02-08 10:24:41 +00:00
ibaker
ce4225f864 Fix some missed StyledPlayerView -> PlayerView rename sites
PiperOrigin-RevId: 426868804
2022-02-07 11:43:37 +00:00
ibaker
168914256d Remove LegacyPlayerView reference from comment in proguard-rules.txt
This class is deprecated (and will be removed from media3).

#minor-release

PiperOrigin-RevId: 426860018
2022-02-07 10:50:22 +00:00
ibaker
01c814e2f0 Mark all public 'rarely used' IntDefs as only TYPE_USE
This is a breaking change if the annotation itself is in use in Kotlin
code. It's judged that the IntDefs in this commit are unlikely to be
referred to often in Kotlin code. This is because they're either:
- Related to esoteric parts of the library, or
- In a common part of the library but only returned from methods (and
  never passed to callback methods).

A follow-up change will fix the positions of existing usages to match
this new config.

#minor-release

PiperOrigin-RevId: 426410237
2022-02-07 10:47:50 +00:00
ibaker
0bf21f2e20 Reshuffle the 'legacy' attrs.xml and drawables.xml files
Keep values related to LegacyPlayerView in attrs_legacy_player_view.xml
and put all values related to LegacyPlayerControlView back in their
original locations. We plan to remove LegacyPlayerView (and
attrs_legacy_player_view.xml) from media3, but will keep
LegacyPlayerControlView - so the separation of the XML files needs to
reflect this split.

#minor-release

PiperOrigin-RevId: 426406973
2022-02-07 10:43:43 +00:00
ibaker
37d47e1d13 Mark LegacyPlayerView as deprecated
This type is still known as PlayerView in exoplayer2

#minor-release

PiperOrigin-RevId: 426348286
2022-02-04 14:47:47 +00:00
ibaker
8aefed20f8 Remove references to Player(Control)View from the dev guide
Remove most of the customisation documentation, since StyledPlayerView
isn't really designed to be customised as deeply as PlayerView.

Also remove most documentation around StyledPlayerControlView,
especially as a standalone controller class - since it doesn't work
well for this use-case.

#minor-release

PiperOrigin-RevId: 426090762
2022-02-04 09:37:13 +00:00
olly
d2cc14a98b Fix some lint warnings
PiperOrigin-RevId: 424383900
2022-01-28 08:46:46 +00:00
olly
b1d8a97ca0 Use translatable playback speed strings
Issue: google/ExoPlayer#9811
PiperOrigin-RevId: 423855051
2022-01-25 19:20:41 +00:00
olly
8f65b7f69d Update translations
Issue: google/ExoPlayer#9811
PiperOrigin-RevId: 423849421
2022-01-25 19:18:36 +00:00
ibaker
bfce8f5456 Rename StyledPlayerView to PlayerView
This commit leaves some 'styled' references, specifically:
* exo_styled_XXX dimension names
* exo_styled_controls_XXX drawable IDs
* exo_styled_XXX color names
* ExoStyledControls.XXX style names

PiperOrigin-RevId: 421576554
2022-01-25 18:10:42 +00:00
ibaker
220179ccbb Remove 'styled' from styledPlayerControlView field name
This class is already called StyledPlayerControlViewLayoutManager, it
seems unecessary to repeate the 'styled' word again in this context.

PiperOrigin-RevId: 420711161
2022-01-11 13:42:59 +00:00
ibaker
bc12306267 Rename some references from PlayerView to LegacyPlayerView
These were missed in 9dae5fd2c0

These references will be re-written to PlayerView when exporting to
exoplayer2, so this commit results in some small reformatting changes.

Also fix a reference to LegacyPlayerControlView that should be
StyledPlayerControlView.

PiperOrigin-RevId: 420707706
2022-01-11 13:41:50 +00:00
olly
f7e88d7c82 Add translatable playback speed strings
The UI component will be switched over to use them in a
subsequent commit, once the translations have been
imported.

Issue: google/ExoPlayer#9811
PiperOrigin-RevId: 419632617
2022-01-05 12:15:35 +00:00
ibaker
9dae5fd2c0 Rename PlayerView to LegacyPlayerView in media3
The old name is kept in exoplayer2.

PiperOrigin-RevId: 417378759
2022-01-05 10:38:50 +00:00
ibaker
de0f129f21 Fix some comment references in StyledPlayer(Control)View
These comments inadvertantly refer to types and drawables associated
with Player(Control)View.

PiperOrigin-RevId: 416794967
2022-01-05 10:29:23 +00:00
ibaker
69d83a28bb Move Player(Control)View resource IDs into separate _legacy.xml files
This is a no-op because all the <resource> elements from these XML
files are effectively concatenated together during building.

PiperOrigin-RevId: 416326534
2022-01-05 10:16:51 +00:00
olly
bc1e5868d6 Fix FFWD/RWND color in night mode
The color set via textAppearance is overridden by any non-null
textColor set directly on the style. We always want the specific
properties the textAppearance specifies, so set them directly to
prevent them from being overridden.

#minor-release
Issue: google/ExoPlayer#9765
PiperOrigin-RevId: 414967143
2021-12-10 11:10:18 +00:00