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
0ad33116
authored
Oct 20, 2020
by
olly
Committed by
Oliver Woodman
Oct 21, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Simplify artwork selection in PlayerView
PiperOrigin-RevId: 338056357
parent
f1c3928b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
12 deletions
library/core/src/main/java/com/google/android/exoplayer2/util/EventLogger.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/core/src/main/java/com/google/android/exoplayer2/util/EventLogger.java
View file @
0ad33116
...
@@ -300,10 +300,10 @@ public class EventLogger implements AnalyticsListener {
...
@@ -300,10 +300,10 @@ public class EventLogger implements AnalyticsListener {
public
void
onStaticMetadataChanged
(
EventTime
eventTime
,
List
<
Metadata
>
metadataList
)
{
public
void
onStaticMetadataChanged
(
EventTime
eventTime
,
List
<
Metadata
>
metadataList
)
{
logd
(
"staticMetadata ["
+
getEventTimeString
(
eventTime
));
logd
(
"staticMetadata ["
+
getEventTimeString
(
eventTime
));
for
(
int
i
=
0
;
i
<
metadataList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
metadataList
.
size
();
i
++)
{
@Nullable
Metadata
currentM
etadata
=
metadataList
.
get
(
i
);
Metadata
m
etadata
=
metadataList
.
get
(
i
);
if
(
currentMetadata
!=
null
&&
currentM
etadata
.
length
()
!=
0
)
{
if
(
m
etadata
.
length
()
!=
0
)
{
logd
(
" "
+
i
);
logd
(
" "
+
i
);
printMetadata
(
currentM
etadata
,
" "
);
printMetadata
(
m
etadata
,
" "
);
}
}
}
}
logd
(
"]"
);
logd
(
"]"
);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
0ad33116
...
@@ -57,7 +57,6 @@ import com.google.android.exoplayer2.source.TrackGroupArray;
...
@@ -57,7 +57,6 @@ import com.google.android.exoplayer2.source.TrackGroupArray;
import
com.google.android.exoplayer2.source.ads.AdsLoader
;
import
com.google.android.exoplayer2.source.ads.AdsLoader
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.text.Cue
;
import
com.google.android.exoplayer2.text.TextOutput
;
import
com.google.android.exoplayer2.text.TextOutput
;
import
com.google.android.exoplayer2.trackselection.TrackSelection
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode
;
import
com.google.android.exoplayer2.ui.AspectRatioFrameLayout.ResizeMode
;
import
com.google.android.exoplayer2.ui.spherical.SingleTapListener
;
import
com.google.android.exoplayer2.ui.spherical.SingleTapListener
;
...
@@ -1373,17 +1372,11 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
...
@@ -1373,17 +1372,11 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
closeShutter
();
closeShutter
();
// Display artwork if enabled and available, else hide it.
// Display artwork if enabled and available, else hide it.
if
(
useArtwork
())
{
if
(
useArtwork
())
{
for
(
int
i
=
0
;
i
<
selections
.
length
;
i
++)
{
for
(
Metadata
metadata
:
player
.
getCurrentStaticMetadata
())
{
@Nullable
TrackSelection
selection
=
selections
.
get
(
i
);
if
(
setArtworkFromMetadata
(
metadata
))
{
if
(
selection
!=
null
)
{
for
(
int
j
=
0
;
j
<
selection
.
length
();
j
++)
{
@Nullable
Metadata
metadata
=
selection
.
getFormat
(
j
).
metadata
;
if
(
metadata
!=
null
&&
setArtworkFromMetadata
(
metadata
))
{
return
;
return
;
}
}
}
}
}
}
if
(
setDrawableArtwork
(
defaultArtwork
))
{
if
(
setDrawableArtwork
(
defaultArtwork
))
{
return
;
return
;
}
}
...
...
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