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
27477a19
authored
Mar 11, 2021
by
gyumin
Committed by
Ian Baker
Mar 12, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add MediaMetadata.EMPTY
PiperOrigin-RevId: 362186928
parent
70f48093
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/DefaultMediaItemConverterTest.java
library/common/src/main/java/com/google/android/exoplayer2/MediaItem.java
library/common/src/main/java/com/google/android/exoplayer2/MediaMetadata.java
extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/DefaultMediaItemConverterTest.java
View file @
27477a19
...
...
@@ -51,7 +51,7 @@ public class DefaultMediaItemConverterTest {
MediaItem
item
=
builder
.
setUri
(
Uri
.
parse
(
"http://example.com"
))
.
setMediaMetadata
(
new
MediaMetadata
.
Builder
().
build
()
)
.
setMediaMetadata
(
MediaMetadata
.
EMPTY
)
.
setMimeType
(
MimeTypes
.
APPLICATION_MPD
)
.
setDrmUuid
(
C
.
WIDEVINE_UUID
)
.
setDrmLicenseUri
(
"http://license.com"
)
...
...
library/common/src/main/java/com/google/android/exoplayer2/MediaItem.java
View file @
27477a19
...
...
@@ -604,7 +604,7 @@ public final class MediaItem implements Bundleable {
liveMaxOffsetMs
,
liveMinPlaybackSpeed
,
liveMaxPlaybackSpeed
),
mediaMetadata
!=
null
?
mediaMetadata
:
new
MediaMetadata
.
Builder
().
build
()
);
mediaMetadata
!=
null
?
mediaMetadata
:
MediaMetadata
.
EMPTY
);
}
}
...
...
@@ -1308,7 +1308,7 @@ public final class MediaItem implements Bundleable {
@Nullable
Bundle
mediaMetadataBundle
=
bundle
.
getBundle
(
keyForField
(
FIELD_MEDIA_METADATA
));
MediaMetadata
mediaMetadata
;
if
(
mediaMetadataBundle
==
null
)
{
mediaMetadata
=
new
MediaMetadata
.
Builder
().
build
()
;
mediaMetadata
=
MediaMetadata
.
EMPTY
;
}
else
{
mediaMetadata
=
MediaMetadata
.
CREATOR
.
fromBundle
(
mediaMetadataBundle
);
}
...
...
library/common/src/main/java/com/google/android/exoplayer2/MediaMetadata.java
View file @
27477a19
...
...
@@ -23,7 +23,7 @@ import java.lang.annotation.Documented;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
/** Metadata of
the {@link MediaItem}
. */
/** Metadata of
a {@link MediaItem} or a playlist
. */
public
final
class
MediaMetadata
implements
Bundleable
{
/** A builder for {@link MediaMetadata} instances. */
...
...
@@ -43,6 +43,9 @@ public final class MediaMetadata implements Bundleable {
}
}
/** Empty {@link MediaMetadata}. */
public
static
final
MediaMetadata
EMPTY
=
new
MediaMetadata
.
Builder
().
build
();
/** Optional title. */
@Nullable
public
final
String
title
;
...
...
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