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
be85da3a
authored
Jul 26, 2017
by
Danny Brain
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Allow PlaybackControlView to be overridden in SimpleExoPlayerView
parent
13732fe6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java
library/ui/src/main/res/values/ids.xml
library/ui/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java
View file @
be85da3a
...
@@ -168,6 +168,15 @@ import java.util.List;
...
@@ -168,6 +168,15 @@ import java.util.List;
* <li>Type: {@link View}</li>
* <li>Type: {@link View}</li>
* </ul>
* </ul>
* </li>
* </li>
* <li><b>{@code exo_controller}</b> - An already inflated instance of
* {@link PlaybackControlView}. Allows you to use your own {@link PlaybackControlView} instead
* of default. Note: attrs such as rewind_increment will not be passed through to this
* instance and should be set at creation. {@code exo_controller_placeholder} will be ignored
* if this is set.
* <ul>
* <li>Type: {@link View}</li>
* </ul>
* </li>
* <li><b>{@code exo_overlay}</b> - A {@link FrameLayout} positioned on top of the player which
* <li><b>{@code exo_overlay}</b> - A {@link FrameLayout} positioned on top of the player which
* the app can access via {@link #getOverlayFrameLayout()}, provided for convenience.
* the app can access via {@link #getOverlayFrameLayout()}, provided for convenience.
* <ul>
* <ul>
...
@@ -315,8 +324,11 @@ public final class SimpleExoPlayerView extends FrameLayout {
...
@@ -315,8 +324,11 @@ public final class SimpleExoPlayerView extends FrameLayout {
}
}
// Playback control view.
// Playback control view.
PlaybackControlView
customController
=
(
PlaybackControlView
)
findViewById
(
R
.
id
.
exo_controller
);
View
controllerPlaceholder
=
findViewById
(
R
.
id
.
exo_controller_placeholder
);
View
controllerPlaceholder
=
findViewById
(
R
.
id
.
exo_controller_placeholder
);
if
(
controllerPlaceholder
!=
null
)
{
if
(
customController
!=
null
)
{
this
.
controller
=
customController
;
}
else
if
(
controllerPlaceholder
!=
null
)
{
// Note: rewindMs and fastForwardMs are passed via attrs, so we don't need to make explicit
// Note: rewindMs and fastForwardMs are passed via attrs, so we don't need to make explicit
// calls to set them.
// calls to set them.
this
.
controller
=
new
PlaybackControlView
(
context
,
attrs
);
this
.
controller
=
new
PlaybackControlView
(
context
,
attrs
);
...
...
library/ui/src/main/res/values/ids.xml
View file @
be85da3a
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
<item
name=
"exo_subtitles"
type=
"id"
/>
<item
name=
"exo_subtitles"
type=
"id"
/>
<item
name=
"exo_artwork"
type=
"id"
/>
<item
name=
"exo_artwork"
type=
"id"
/>
<item
name=
"exo_controller_placeholder"
type=
"id"
/>
<item
name=
"exo_controller_placeholder"
type=
"id"
/>
<item
name=
"exo_controller"
type=
"id"
/>
<item
name=
"exo_overlay"
type=
"id"
/>
<item
name=
"exo_overlay"
type=
"id"
/>
<item
name=
"exo_play"
type=
"id"
/>
<item
name=
"exo_play"
type=
"id"
/>
<item
name=
"exo_pause"
type=
"id"
/>
<item
name=
"exo_pause"
type=
"id"
/>
...
...
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