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
2ef52904
authored
May 05, 2021
by
olly
Committed by
bachinger
May 06, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove remaining PlayerView/StyledPlayerView core dep
PiperOrigin-RevId: 372092412
parent
a3e06f7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
12 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
2ef52904
...
...
@@ -48,6 +48,7 @@ import androidx.core.content.ContextCompat;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Timeline
;
...
...
@@ -57,11 +58,12 @@ import com.google.android.exoplayer2.metadata.flac.PictureFrame;
import
com.google.android.exoplayer2.metadata.id3.ApicFrame
;
import
com.google.android.exoplayer2.source.TrackGroupArray
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionUtil
;
import
com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.ErrorMessageProvider
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.RepeatModeUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.common.collect.ImmutableList
;
...
...
@@ -1261,11 +1263,20 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
closeShutter
();
}
if
(
TrackSelectionUtil
.
hasTrackOfType
(
player
.
getCurrentTrackSelections
(),
C
.
TRACK_TYPE_VIDEO
))
{
// Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
// onRenderedFirstFrame().
hideArtwork
();
return
;
TrackSelectionArray
trackSelections
=
player
.
getCurrentTrackSelections
();
for
(
int
i
=
0
;
i
<
trackSelections
.
length
;
i
++)
{
@Nullable
TrackSelection
trackSelection
=
trackSelections
.
get
(
i
);
if
(
trackSelection
!=
null
)
{
for
(
int
j
=
0
;
j
<
trackSelection
.
length
();
j
++)
{
Format
format
=
trackSelection
.
getFormat
(
j
);
if
(
MimeTypes
.
getTrackType
(
format
.
sampleMimeType
)
==
C
.
TRACK_TYPE_VIDEO
)
{
// Video enabled, so artwork must be hidden. If the shutter is closed, it will be opened
// in onRenderedFirstFrame().
hideArtwork
();
return
;
}
}
}
}
// Video disabled so the shutter must be closed.
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java
View file @
2ef52904
...
...
@@ -49,6 +49,7 @@ import androidx.core.content.ContextCompat;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.Format
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Timeline
;
...
...
@@ -58,11 +59,12 @@ import com.google.android.exoplayer2.metadata.flac.PictureFrame;
import
com.google.android.exoplayer2.metadata.id3.ApicFrame
;
import
com.google.android.exoplayer2.source.TrackGroupArray
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionUtil
;
import
com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.ErrorMessageProvider
;
import
com.google.android.exoplayer2.util.MimeTypes
;
import
com.google.android.exoplayer2.util.RepeatModeUtil
;
import
com.google.android.exoplayer2.util.Util
;
import
com.google.common.collect.ImmutableList
;
...
...
@@ -1301,11 +1303,20 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
closeShutter
();
}
if
(
TrackSelectionUtil
.
hasTrackOfType
(
player
.
getCurrentTrackSelections
(),
C
.
TRACK_TYPE_VIDEO
))
{
// Video enabled so artwork must be hidden. If the shutter is closed, it will be opened in
// onRenderedFirstFrame().
hideArtwork
();
return
;
TrackSelectionArray
trackSelections
=
player
.
getCurrentTrackSelections
();
for
(
int
i
=
0
;
i
<
trackSelections
.
length
;
i
++)
{
@Nullable
TrackSelection
trackSelection
=
trackSelections
.
get
(
i
);
if
(
trackSelection
!=
null
)
{
for
(
int
j
=
0
;
j
<
trackSelection
.
length
();
j
++)
{
Format
format
=
trackSelection
.
getFormat
(
j
);
if
(
MimeTypes
.
getTrackType
(
format
.
sampleMimeType
)
==
C
.
TRACK_TYPE_VIDEO
)
{
// Video enabled, so artwork must be hidden. If the shutter is closed, it will be opened
// in onRenderedFirstFrame().
hideArtwork
();
return
;
}
}
}
}
// Video disabled so the shutter must be closed.
...
...
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