Page Summary
-
Streams with multiple metadata types, like the IMA SDK's ad metadata and SCTE-35, may require extra configuration depending on the player implementation.
-
Media3 ExoPlayer v1.6 and higher handle streams with two metadata types by default.
-
For ExoPlayer versions lower than v1.6, you need to add an additional
MetadataRendererinstance to handle streams with two metadata types.
For streams using two different types of metadata, you might need additional configuration setup depending on your player implementation. A stream can contain multiple types of metadata. The IMA SDK adds metadata to the stream to retrieve ad information from the media. For example, SCTE-35 is a common second metadata type.
For apps using Media3 ExoPlayer v1.6 or higher, streams with two metadata types are handled by default.
For apps using an ExoPlayer version lower than v1.6, you must add an additional MetadataRenderer
instance to your ExoPlayer implementation. The following example adds a
second MetadataRenderer
instance to support two metadata types:
RenderersFactory
defaultRenderersFactory
=
new
DefaultRenderersFactory
(
context
)
{
@Override
protected
void
buildMetadataRenderers
(
Context
context
,
MetadataOutput
output
,
Looper
outputLooper
,
@ExtensionRendererMode
int
extensionRendererMode
,
ArrayList<Renderer>
out
)
{
// Add a `MetadataRenderer` for each type of metadata. This example adds 2.
out
.
add
(
new
MetadataRenderer
(
output
,
outputLooper
));
out
.
add
(
new
MetadataRenderer
(
output
,
outputLooper
));
}
};
new
ExoPlayer
.
Builder
()
.
setRenderersFactory
(
defaultRenderersFactory
)
.
setMediaSourceFactory
(
mediaSourceFactory
)
.
build
();;

