609 Commits

Author SHA1 Message Date
tonihei
237cb9df54 Merge pull request #7804 from yoobi:TrackSelectionDialogBuilderTheme
PiperOrigin-RevId: 328726246
2020-08-27 14:41:28 +00:00
andrewlewis
74c493f51e Add back support for setting audio pitch
To play slow motion streams where the audio has been recorded at
slower speeds, it is necessary to be able to resample (rather than
time-stretch) the audio. This change undeprecates back the previously
deprecated PlaybackParameters class to allow apps to set pitch.

PiperOrigin-RevId: 328703116
2020-08-27 12:06:41 +01:00
Yoni Obadia
c9b4b98103 Review: Fix initSortedTrack to keep all groups in the TrackGroupArray 2020-08-27 12:19:56 +02:00
Yoni Obadia
551b6d65ae Review: Simplify getSortedIndexFromInitialTrackGroup 2020-08-27 10:15:17 +02:00
Yoni Obadia
ed58280d23 Review: Update according to review 2020-08-27 09:46:30 +02:00
Yoni Obadia
0176422f0b Review: Update according to review 2020-08-26 19:07:47 +02:00
Yoni Obadia
425bd2d801 improvement: get already existing sortingTrackGroups if exists 2020-08-26 14:31:44 +02:00
Yoni Obadia
88d7587ca7 dev: add setting theme for TrackSelectionDialogBuilder 2020-08-26 11:40:48 +02:00
Yoni Obadia
181676d950 dev: adding sorting for TrackSelectionDialog and TrackSelectionDialogBuilder 2020-08-24 15:13:21 +02:00
insun
74f788afc3 Improve a11y in minimal mode
Previously, the fullscreen button and timebar has been overlapped in minimal mode

PiperOrigin-RevId: 327606728
2020-08-21 12:51:15 +01:00
insun
b853978a91 Fix bug to show 'play' button at the end of stream
PiperOrigin-RevId: 327158791
2020-08-18 08:11:54 +01:00
insun
333ccedf80 Improve error message and correct reference to proper layout
PiperOrigin-RevId: 326944292
2020-08-17 16:13:43 +01:00
insun
602d880841 Fix StyledControlView's minimal mode bug and setShow{*}Button bug
There were two bugs in StyledPlayerControlView:
- Center icons are shown when toggling control view in minimal mode.
- `StyledControlView#setShow{*}Button` methods and corresponding
  `set_show_*_button` attributes didn't work properly.

This CL fixes bugs by controlling the buttons' visibility in one place,
StyledPlayerControlViewLayoutManager.

PiperOrigin-RevId: 326567213
2020-08-17 16:12:30 +01:00
insun
454a38c366 Increase touch target size and margins between icons
PiperOrigin-RevId: 326423935
2020-08-17 16:11:44 +01:00
insun
cda35f6677 Make play/pause button to reflect getPlayWhenReady state
Previously, it refelects isPlaying() and it makes the button to seem
unresponsive when playback error occurs.

PiperOrigin-RevId: 326396570
2020-08-17 16:10:59 +01:00
insun
b95c984d16 Cleanup unused ui resources and code
PiperOrigin-RevId: 326390725
2020-08-17 16:10:40 +01:00
insun
8661876960 Remove unnessary resources
1) As we don't display metadata (title) removed titlebar.
2) Removed exo_ic_{forward,rewind}_30.xml which are not used.

PiperOrigin-RevId: 325195605
2020-08-07 19:01:55 +01:00
insun
b26d578ff3 Fix bug that clicking didn't show up controls at the beginning
StyledLayoutManager#isFullyVisibility() was wrong and
so hiding/showing logic didn't work properly.

PiperOrigin-RevId: 324996446
2020-08-07 19:01:45 +01:00
olly
5c879ac8f8 Final string import for 2.12
PiperOrigin-RevId: 324579230
2020-08-07 18:58:51 +01:00
insun
f99023e887 Makes controls initially hidden
Also, there was a bug that controls are always shown at the beginning
even when controlview's hide() is called.

PiperOrigin-RevId: 323300617
2020-07-27 23:59:16 +01:00
insun
6fb28a8dc9 Hide fullscreen button if no listener is registered
PiperOrigin-RevId: 322912266
2020-07-24 10:48:43 +01:00
insun
cf2a58e6dc Fix styled ui's documents
#exofixit

PiperOrigin-RevId: 322854029
2020-07-24 10:48:25 +01:00
olly
132c9d15e3 UI module string cleanup
PiperOrigin-RevId: 322323784
2020-07-24 10:43:07 +01:00
olly
899a78fca9 StyledPlayerControlView: Some cleanup
PiperOrigin-RevId: 322317638
2020-07-24 10:42:48 +01:00
insun
63ca2b00fb Resolve styled controls crash on pre-API 21
When building a demo app without recent gradle (ex. blaze)
it crashes.

PiperOrigin-RevId: 322313886
2020-07-24 10:42:39 +01:00
andrewlewis
9594aa45ff Move functionality from DemoApplication to DemoUtil
https://developer.android.com/reference/android/app/Application recommends
against subclassing application.

PiperOrigin-RevId: 322163812
2020-07-24 10:41:27 +01:00
olly
0cd15d9158 Proactively check listener arguments are non-null
PiperOrigin-RevId: 322143359
2020-07-24 10:40:24 +01:00
tonihei
953db7898e Make dependency on AndroidX appcompat optional for dialog builder.
The dependency is only used to create a dialog in
TrackSelectionDialogBuilder that is compatible with newer styling
options.

This dependendy adds over 500Kb to the apk (even if unused) and we
shoudn't force this on an app. Instead make the dependency optional by
automatically falling back to the platform version if the AndroidX one
doesn't exist.

Issue: #7357
PiperOrigin-RevId: 322143005
2020-07-24 10:40:15 +01:00
insun
bcf218da60 Import translated strings
PiperOrigin-RevId: 321762840
2020-07-24 10:38:08 +01:00
ibaker
437d1b6e9a Migrate usages of deprecated Player#set/getPlaybackParameters()
PiperOrigin-RevId: 321166822
2020-07-24 10:33:36 +01:00
ibaker
23d680a4b4 Suppress deprecation warnings in deprecated places
PiperOrigin-RevId: 320970814
2020-07-24 10:30:53 +01:00
olly
f205539616 Use lambdas where possible
PiperOrigin-RevId: 320960833
2020-07-13 17:00:44 +01:00
kimvde
92437f3a0f Remove some occurrences of dummy
Remove occurrences in comments and private fields.

ISSUE: #7565
PiperOrigin-RevId: 320948364
2020-07-13 17:00:21 +01:00
ibaker
cdfee89181 Use CSS inheritance for background-color in WebViewSubtitleOutput
CSS background-color isn't inherited to inner HTML elements by default:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-color

But Android Span styling assumes an outer BackgroundColorSpan will
affect inner spans. This usually doesn't make a difference, because
HTML elements are transparent by default, so there's an implicit
inheritance by just being able to see through to the 'outer' element
underneath. However this doesn't work if the inner element sits outside
the bounding box of the outer element, e.g. <rt> (ruby text, sits above/below)
or a <span> with font-size > 100%.
END_PUBLIC

Demo of <rt> and font-size problems: http://go/cpl/ruby-backgrounds/1
Demo of CSS inheritance: http://go/cpl/css-inheritance/1

PiperOrigin-RevId: 320915999
2020-07-13 14:04:20 +01:00
andrewlewis
245459a34a Fix raw type
PiperOrigin-RevId: 320909448
2020-07-13 14:04:11 +01:00
insun
5e50e110a4 Mark currently selected subtitle track in track list
Previously, the automatically selected subtitle track
has not been marked (with check mark) in subtitle track list,
just like audio track.

But, in subtitle track option UI, there is no 'auto' option,
which is different from audio track selection menu.

This CL marks the auto selected subtitle track name in the cc list.

PiperOrigin-RevId: 320802575
2020-07-13 14:04:02 +01:00
andrewlewis
3214851fbb Migrate off deprecated IMA SDK APIs
AdDisplayContainer now takes the video ad player at construction time,
and obstructions are registered/unregistered via a new method. Also
'content complete' is now notified via ad callbacks rather than the
AdsLoader.

PiperOrigin-RevId: 320567666
2020-07-13 14:02:52 +01:00
insun
9a42141e66 Toggles subtitle button's image and content description accordingly
PiperOrigin-RevId: 320323388
2020-07-09 08:04:16 +00:00
insun
b8e9f19b37 Add document for show_subtitle_button attribute
This also removes unused deprecated methods.

PiperOrigin-RevId: 320141729
2020-07-08 13:56:12 +01:00
insun
4fc45b92c0 Increase char limits for some string translations
And also replaced "Click" with "Tap" for CC button descriptions.

PiperOrigin-RevId: 319455553
2020-07-03 09:03:24 +01:00
Oliver Woodman
ab348c045c Merge pull request #7568 from juankysoriano:subtitles-font-size-bug
PiperOrigin-RevId: 319223173
2020-07-03 09:02:13 +01:00
tonihei
f8217140d7 Add missing null check.
The system services may return a null value if the service is
not available. Guard against this by falling back to default values.

PiperOrigin-RevId: 319187882
2020-07-03 09:01:37 +01:00
insun
22802506cd Minor changes regarding animation_enabled in StyledPlayerControlView.
- Removed unnecessary private method
- Revised document for animation_enabled attribute
- Added setAnimationEnabled/isAnimationEnabled in StyledPlayerControlView

PiperOrigin-RevId: 319054648
2020-07-03 09:01:03 +01:00
insun
a3bbcf3395 Add StyledPlayerView and StyledPlayerControlView into ui/
Moved ui2/ code and resources into ui/

PiperOrigin-RevId: 318984707
2020-07-03 09:00:10 +01:00
Juanky Soriano
5c096acc29 Use default text size if captioning manager is disabled
This fixes an issue where, even if captioning manager is disabled, the latest used captioning manager preference
related to text size is being applied.

In order to replicate:
1. Go to Captioning Preferences under device Settings and enable it
2. Change the text size to "very large"
3. Observe the selected text size is used for subtitles, for example in Youtube
4. Go to Captioning Preferences under device Settings and disable it
5. Observe the text size used for subtitles does not come back to normal, stays on "very large"
2020-07-01 00:15:31 -05:00
insun
d5f029315c Cleanup deprecated SimpleExoPlayerView and PlaybackControlView
PiperOrigin-RevId: 318152038
2020-06-26 11:14:13 +01:00
ibaker
54eccd3893 Change WebViewSubtitleOutput to use em not % for line offsets
The existing code moves a multi-line cue box by multiples of the height
of the whole cue box (incorrect), rather than multiples of the first
line of text (correct). These two are equivalent for single-line cues,
which is why I didn't initially spot the problem.

PiperOrigin-RevId: 318036793
2020-06-26 11:13:41 +01:00
ibaker
06c17f5152 Redefine numeric Cue.line in terms of viewport lines, ignore lineAnchor
Numerical lines conceptually map to a grid of lines in the viewport,
with the Cue text lines being aligned to one of the viewport lines.

It doesn't make sense to position a single-line cue differently based
on lineAnchor when it's expected to 'snap' to a particular line on the
viewport grid. So we redefine the position to be in terms of the cue
lines rather than the bounds of the cue box.

It's also not possible to always handle ANCHOR_TYPE_MIDDLE when
lineType=NUMBER (as it relies on the number of lines in the cue being
odd), so it's easier to ignore lineAnchor completely.
PiperOrigin-RevId: 318034664
2020-06-26 11:13:33 +01:00
tonihei
4138e28d62 Move common gradle setup to a setting file.
This removes a lot of duplication from the module configuration,
avoids divergence, and makes sure that only the important differences
to the default are visible in each module file.

PiperOrigin-RevId: 318024823
2020-06-26 11:13:25 +01:00
samrobinson
836babd5d6 Replace usages of Charset.forName with Guava Charsets.
PiperOrigin-RevId: 317672619
2020-06-23 11:07:43 +01:00