Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
28d5b357
authored
Sep 07, 2021
by
olly
Committed by
Christos Tsilopoulos
Sep 16, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use defStyleAttr when obtaining styled attributes in player views
Issue #9024 PiperOrigin-RevId: 395224661
parent
ced4232f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
9 deletions
RELEASENOTES.md
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
RELEASENOTES.md
View file @
28d5b357
...
...
@@ -9,7 +9,7 @@
*
Extractors:
*
Support TS packets without PTS flag
(
[
#9294
](
https://github.com/google/ExoPlayer/issues/9294
)
).
*
Video
*
Video
:
*
Request smaller decoder input buffers for Dolby Vision. This fixes an
issue that could cause UHD Dolby Vision playbacks to fail on some
devices, including Amazon Fire TV 4K.
...
...
@@ -18,6 +18,10 @@
thrown from
`Requirements.isInternetConnectivityValidated`
on devices
running Android 11
(
[
#9002
](
https://github.com/google/ExoPlayer/issues/9002
)
).
*
UI:
*
Use
`defStyleAttr`
when obtaining styled attributes in
`StyledPlayerView`
,
`PlayerView`
and
`PlayerControlView`
(
[
#9024
](
https://github.com/google/ExoPlayer/issues/9024
)
).
*
Cast extension:
*
Implement
`CastPlayer.setPlaybackParameters(PlaybackParameters)`
to
support setting the playback speed
...
...
@@ -247,6 +251,11 @@
(
[
#9183
](
https://github.com/google/ExoPlayer/issues/9183
)
).
*
Allow the timeout to be customised via
`RtspMediaSource.Factory.setTimeoutMs`
.
*
Downloads and caching:
*
Workaround platform issue that can cause a
`SecurityException`
to be
thrown from
`Requirements.isInternetConnectivityValidated`
on devices
running Android 11
(
[
#9002
](
https://github.com/google/ExoPlayer/issues/9002
)
).
### 2.14.1 (2021-06-11)
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
28d5b357
...
...
@@ -377,7 +377,8 @@ public class PlayerControlView extends FrameLayout {
TypedArray
a
=
context
.
getTheme
()
.
obtainStyledAttributes
(
playbackAttrs
,
R
.
styleable
.
PlayerControlView
,
0
,
0
);
.
obtainStyledAttributes
(
playbackAttrs
,
R
.
styleable
.
PlayerControlView
,
defStyleAttr
,
/* defStyleRes= */
0
);
try
{
showTimeoutMs
=
a
.
getInt
(
R
.
styleable
.
PlayerControlView_show_timeout
,
showTimeoutMs
);
controllerLayoutId
=
...
...
@@ -424,8 +425,8 @@ public class PlayerControlView extends FrameLayout {
if
(
customTimeBar
!=
null
)
{
timeBar
=
customTimeBar
;
}
else
if
(
timeBarPlaceholder
!=
null
)
{
// Propagate
attrs as timebarAttrs so that DefaultTimeBar's custom attributes are transferred,
// but standard attributes (e.g. background) are not.
// Propagate
playbackAttrs as timebarAttrs so that DefaultTimeBar's custom attributes are
//
transferred,
but standard attributes (e.g. background) are not.
DefaultTimeBar
defaultTimeBar
=
new
DefaultTimeBar
(
context
,
null
,
0
,
playbackAttrs
);
defaultTimeBar
.
setId
(
R
.
id
.
exo_progress
);
defaultTimeBar
.
setLayoutParams
(
timeBarPlaceholder
.
getLayoutParams
());
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
28d5b357
...
...
@@ -367,7 +367,11 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
boolean
controllerHideDuringAds
=
true
;
int
showBuffering
=
SHOW_BUFFERING_NEVER
;
if
(
attrs
!=
null
)
{
TypedArray
a
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
PlayerView
,
0
,
0
);
TypedArray
a
=
context
.
getTheme
()
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
PlayerView
,
defStyleAttr
,
/* defStyleRes= */
0
);
try
{
shutterColorSet
=
a
.
hasValue
(
R
.
styleable
.
PlayerView_shutter_background_color
);
shutterColor
=
a
.
getColor
(
R
.
styleable
.
PlayerView_shutter_background_color
,
shutterColor
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java
View file @
28d5b357
...
...
@@ -491,7 +491,11 @@ public class StyledPlayerControlView extends FrameLayout {
TypedArray
a
=
context
.
getTheme
()
.
obtainStyledAttributes
(
playbackAttrs
,
R
.
styleable
.
StyledPlayerControlView
,
0
,
0
);
.
obtainStyledAttributes
(
playbackAttrs
,
R
.
styleable
.
StyledPlayerControlView
,
defStyleAttr
,
/* defStyleRes= */
0
);
try
{
controllerLayoutId
=
a
.
getResourceId
(
...
...
@@ -576,8 +580,8 @@ public class StyledPlayerControlView extends FrameLayout {
if
(
customTimeBar
!=
null
)
{
timeBar
=
customTimeBar
;
}
else
if
(
timeBarPlaceholder
!=
null
)
{
// Propagate
attrs as timebarAttrs so that DefaultTimeBar's custom attributes are transferred,
// but standard attributes (e.g. background) are not.
// Propagate
playbackAttrs as timebarAttrs so that DefaultTimeBar's custom attributes are
//
transferred,
but standard attributes (e.g. background) are not.
DefaultTimeBar
defaultTimeBar
=
new
DefaultTimeBar
(
context
,
null
,
0
,
playbackAttrs
,
R
.
style
.
ExoStyledControls_TimeBar
);
defaultTimeBar
.
setId
(
R
.
id
.
exo_progress
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
View file @
28d5b357
...
...
@@ -369,7 +369,10 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
int
showBuffering
=
SHOW_BUFFERING_NEVER
;
if
(
attrs
!=
null
)
{
TypedArray
a
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
StyledPlayerView
,
0
,
0
);
context
.
getTheme
()
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
StyledPlayerView
,
defStyleAttr
,
/* defStyleRes= */
0
);
try
{
shutterColorSet
=
a
.
hasValue
(
R
.
styleable
.
StyledPlayerView_shutter_background_color
);
shutterColor
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment