125 Commits

Author SHA1 Message Date
olly
77ec24ca58 Translation console import
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185409304
2018-02-16 11:47:49 +00:00
eguven
fc7a6d2596 Increase character limit for download notification strings
This is requested for Romanian translation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185359071
2018-02-16 11:45:27 +00:00
eguven
0e51a77839 Add message parameter to DownloadNotificationUtil.createNotification
DownloadNotificationUtil should not use getData().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=185002149
2018-02-16 11:38:11 +00:00
eguven
b3da82dc1c Open source DownloadService, DownloadManager and related classes
Issue: #2643

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184844484
2018-02-08 14:47:54 +00:00
olly
a7d4d2d21c Automated g4 rollback of changelist 184056034.
*** Reason for rollback ***

Broke everything

*** Original change description ***

Clean up message naming in EPII

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184061352
2018-02-01 15:13:51 +00:00
olly
fd10a3cbb0 Fix initial visibility of PlayerControlView
This applies when PlayerControlView is used as a standalone
component (not inside PlayerView). Previously hideAtMs was
set to 0, which caused the view to be immediatley hidden in
onAttachedToWindow. After this change the first time the view
is attached to the window is effectively treated as a "user
interaction" for the purposes of deciding when to timeout.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184056324
2018-02-01 15:12:23 +00:00
olly
2f932bfaf7 Clean up message naming in EPII
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184056034
2018-02-01 15:11:00 +00:00
olly
0c67a5783f Add descriptions for strings.
For our strings to be translated, we're required to provide
added context in the form of a description, and specify a
maximum length for the translated strings.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183651515
2018-02-01 14:56:18 +00:00
hoangtc
205055a01f Update ExoPlayer PlayerView, add zoom mode for PlayerView xml attributes
Since AspectRatioFrameLayout supports zoom mode as another resize_mode,
PlayerView's resize mode xml attribute should include this as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183237663
2018-02-01 14:17:10 +00:00
eguven
10879e32ba Add DownloadNotificationHelper
Helper class to create notifications for downloads using DownloadManager.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183225948
2018-02-01 14:15:40 +00:00
bachinger
32f8c2e907 add strings and drawables for fullscreen button
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182512582
2018-01-23 19:09:19 +00:00
olly
4828f275c7 Make play button behave differently in IDLE and ENDED states
- In IDLE, the button will now call a preparer. This allows
  removal of the separate retry button from the demo app.
- In ENDED, the button will seek back to the default position
  and play.
- Behavior is made consistent with LeanbackPlayerAdapter.

Issue: #3689

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182506855
2018-01-23 19:07:52 +00:00
olly
c577d9d351 Let SimpleExoPlayerView/LeanbackPlayerAdapter bind with any Player
Also sanitize naming (PlayerView/PlayerControlView).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182364487
2018-01-23 19:00:20 +00:00
aquilescanta
515fdf3bfd Allow extension of DebugTextViewHelper
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181970955
2018-01-23 18:39:37 +00:00
hoangtc
5364962dca Automatically apply rotation for TextureView in SimpleExoPlayer.
If SimpleExoPlayer is using TextView as output, we can handle video rotation by
automatically applying a matrix transformation to the TextureView when we have
this information available from the video (from video's metadata).

GitHub: #91

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180925571
2018-01-15 11:20:41 +00:00
olly
a314db04ad Reformat UI classes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180777553
2018-01-04 15:52:32 +00:00
hoangtc
bb8c608795 Make updating showTimeoutMs takes effect immediately.
Update PlaybackControlView and SimpleExoPlayerView so when showTimeoutMs is set
while the controller is shown, the new timeout takes effect immediately.

GitHub: #3554

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179171727
2017-12-15 12:16:41 +00:00
olly
435686f969 Add missing attrs to SimpleExoplayerView
They worked without being present in the declare-styleable,
but they need to be present for Android Studio auto-complete
to suggest them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179047478
2017-12-15 12:08:24 +00:00
andrewlewis
aa01fb85dc Add an option to turn off hiding controls during ads
Issue: #3532

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178372763
2017-12-12 19:07:02 +00:00
olly
a155edc568 Hide subtitles when switching player in SimpleExoPlayerView
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177941993
2017-12-12 18:39:14 +00:00
tonihei
aac53cac56 Add reason to onTimelineChanged.
Currently onTimelineChanged doesn't allow to distinguish easily between the
different reasons why it's being called. Especially, finding
out whether a new media source has been prepared or the current source
refreshed dynamically was impossible without tightly coupling the player
operations with the listener.

The new reasons provide this disdinction by either indicating a newly
initialized media source, a dynamic update to an existing timeline
or manifest, or a reset of the player (which usually results in an
empty timeline).

The original onTimelineChanged method without reason is kept in the
DefaultEventListener as deprecated to prevent the need to update all
existing listeners in one go.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176478701
2017-11-21 13:07:46 +00:00
olly
82d0a27fd9 Fix some lint issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176337058
2017-11-20 13:39:03 +00:00
Oliver Woodman
e92667ba5b Only set shutter color if attr is declared 2017-11-13 17:28:25 +00:00
nvalletta
580acb4e2f Add an easy way to set the shutter view background color 2017-11-12 14:25:14 -07:00
olly
9abc1d2974 Don't call Drawable.setLayoutDirection pre-API-23
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174323423
2017-11-02 16:32:29 +00:00
olly
3021897383 Allow multiple listeners on TimeBar
Issue: #3406

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174214296
2017-11-02 16:29:36 +00:00
andrewlewis
3602a9a7e4 Allow specifying a Drawable for the TimeBar scrubber
Issue: #3337

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173411321
2017-10-27 16:20:00 +01:00
andrewlewis
9306b24c65 Fix some Android Studio inspection warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
2017-10-27 15:54:17 +01:00
andrewlewis
e46a7600cf Document DefaultTimeBar attributes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172339124
2017-10-17 18:23:35 +01:00
bachinger
333e745e7b show PlaybackControlView when on key event for DPAD center or any direction
and consume event without moving the focus.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171967057
2017-10-13 19:48:56 +01:00
andrewlewis
20e43ac4f8 Allow ads to be paused/resumed
Controls are still hidden while playing ads, but if the app pauses the player,
controls will be shown. During ads, the player is not seekable.

When the player enters the background then returns to the foreground, the
content period may not be prepared, so also cache the content window duration.
This means that if the app reenters the foreground while an ad is paused the
time bar can be populated.

Issue: #3303

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171123428
2017-10-11 12:18:45 +01:00
andrewlewis
09165ab870 Rename droppedOutputBufferCount
Now this counter includes input buffers too, which are dropped as part of
skipping to keyframes for catch up.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171119930
2017-10-11 12:17:25 +01:00
andrewlewis
b3d462df39 Catch up video rendering by dropping to keyframes
If the current output buffer is very late and the playback position is in a
later group of pictures, drop all buffers to the keyframe preceding the
playback position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170975259
2017-10-11 12:11:58 +01:00
olly
fd576d2189 Smoother PlaybackControlView updates when speed != 1
* If speed <= 0.1, update every second.
* If 0.1 < speed < 1, update approximately once per
  second in real time, aligned so that each second boundary
  in media time has a corresponding updatae.
* If speed == 1, keep existing behavior.
* If 1 < speed <= 5, update every second in media time
* If speed > 5, update every 200ms.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170559037
2017-10-03 08:55:52 +01:00
tonihei
52de36c5eb Add abstract, default Player event listener.
This allows simplified listener implementations as most listeners
will not listen to all possible notifications.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170177821
2017-10-03 08:44:33 +01:00
andrewlewis
f2aed7186e Workaround the skip ad button not being focused
Issue: #3258

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168669969
2017-09-15 23:39:19 +01:00
tonihei
7d59383cc4 Add reason to onPositionDiscontinuity.
This allows listeners to easily determine the source of the discontinuity.
Reasons can be period transitions, seeks, and internal reasons.

Listeners still using the deprecated ExoPlayer.EventListener interface were
updated to Player.EventListener.

GitHub: #3252

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168549612
2017-09-15 23:36:46 +01:00
olly
39dbb9a7fc De-dupe ACTION_DOWN events
Issue: #3259

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168378650
2017-09-15 23:31:54 +01:00
olly
d66143d96d Add full stops
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167711267
2017-09-06 15:53:57 +01:00
olly
013379fd3e Workaround for SurfaceView not being hidden properly
This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.

Issue: #3160

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070
2017-09-06 15:51:01 +01:00
olly
fb023da529 Fix attr inheritance in SimpleExoPlayerView
When creating PlaybackControlView inside SimpleExoPlayerView,
we want certain attributes to be passed through. This lets you
set control attributes on the SimpleExoPlayerView directly. We
don't want all attributes to be propagated though; only our own
custom ones.

Not sure if there's a cleaner way to do this. Pragmatically this
solution seems ... ok :)?

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167619801
2017-09-06 15:46:44 +01:00
Oliver Woodman
74b8c45e6d Minor cleanup to AspectRatioFrameLayout 2017-09-04 11:34:57 +01:00
ojw28
21363d2f8e Merge pull request #3187 from stellabei/stellabei/aspect-ratio-crop
Support zoom mode for AspectRatioFrameLayout
2017-09-04 10:31:21 +01:00
olly
55e928f75a Make LeanbackPlayerAdapter use a ControlDispatcher + Misc cleanup
1. Make LeanbackPlayerAdapter use a ControlDispatcher. This
   allows apps to suppress control events in some circumstances,
   and is in-line with our mobile controls.
2. Misc simplifications and cleanup to LeanbackPlayerAdapter.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166852816
2017-08-29 23:13:13 +01:00
tonihei
1b9c904dba Add UI for shuffle mode.
This includes an option to show and hide the shuffle mode button. When
pressing the button, the shuffle mode of the player is toggled.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166455759
2017-08-29 22:58:42 +01:00
olly
6907ffb285 Remove unnecessary view casts
findViewById is now defined using generics, which allows
the types to be inferred.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166355555
2017-08-29 22:57:17 +01:00
tonihei
bd81181892 Add shortcut methods to query next or previous window index.
This functionality is most likely needed by UI modules which currently need
to obtain the timeline, the current repeat and shuffle modes and are only then
able to query the next/previous window index using this information.

Adding these methods simplifies these cumbersome requests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166181202
2017-08-29 22:40:13 +01:00
tonihei
10f1bd7396 Add shuffle mode parameter to Timeline interface methods.
This parameter is used by methods such as getNextWindowIndex
and getPreviousWindowIndex to determine the playback order.
Additionally, there are method to query the first and last
window index given the shuffle mode.

None of the timeline implementations nor the ExoPlayer
implementation supports shuffling so far.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166170229
2017-08-29 22:37:27 +01:00
Bei Yi
b084821678 Support zoom mode for AspectRatioFrameLayout 2017-08-24 16:13:44 -07:00
Bei Yi
50c485652c Support aspect ratio fill mode for AspectRatioFrameLayout 2017-08-24 14:31:33 -07:00