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
951b1319
authored
Jul 18, 2022
by
Jorge Antonio Diaz-Benito Soriano
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add WrappingMediaSource
This is a CompositeMediaSource<Void> with a slightly simpler API.
parent
9271572e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
0 deletions
libraries/exoplayer/src/main/java/androidx/media3/exoplayer/source/WrappingMediaSource.java
libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java
libraries/exoplayer/src/main/java/androidx/media3/exoplayer/source/WrappingMediaSource.java
0 → 100644
View file @
951b1319
/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
androidx
.
media3
.
exoplayer
.
source
;
import
androidx.media3.common.Timeline
;
/**
* Single-child {@link CompositeMediaSource}.
*/
public
abstract
class
WrappingMediaSource
extends
CompositeMediaSource
<
Void
>
{
/**
* @deprecated - Use {@link #onChildSourceInfoRefreshed}.
*/
@Deprecated
@Override
protected
final
void
onChildSourceInfoRefreshed
(
Void
id
,
MediaSource
mediaSource
,
Timeline
timeline
)
{
onChildSourceInfoRefreshed
(
timeline
);
}
/**
* Called when the source info has been refreshed.
*
* @param timeline The timeline of the source.
*/
protected
abstract
void
onChildSourceInfoRefreshed
(
Timeline
timeline
);
/**
* Prepares a source.
*
* <p>{@link #onChildSourceInfoRefreshed(Timeline)} will be called when the
* child source updates its timeline with the same {@code id} passed to this method.
*
* <p>If sources aren't explicitly released with {@link #releaseChildSource()} they will be
* released in {@link #releaseSourceInternal()}.
*
* @param mediaSource The child {@link MediaSource}.
*/
protected
final
void
prepareChildSource
(
MediaSource
mediaSource
)
{
prepareChildSource
(
CHILD_SOURCE_ID
,
mediaSource
);
}
/**
* Enables the child source.
*/
protected
final
void
enableChildSource
()
{
enableChildSource
(
CHILD_SOURCE_ID
);
}
/**
* Disables the child source.
*/
protected
final
void
disableChildSource
()
{
disableChildSource
(
CHILD_SOURCE_ID
);
}
/**
* Releases the child source.
*/
protected
final
void
releaseChildSource
()
{
releaseChildSource
(
CHILD_SOURCE_ID
);
}
private
static
final
Void
CHILD_SOURCE_ID
=
null
;
}
libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java
View file @
951b1319
...
...
@@ -128,6 +128,7 @@ import androidx.media3.exoplayer.source.MediaSourceEventListener;
import
androidx.media3.exoplayer.source.ShuffleOrder
;
import
androidx.media3.exoplayer.source.SinglePeriodTimeline
;
import
androidx.media3.exoplayer.source.TrackGroupArray
;
import
androidx.media3.exoplayer.source.WrappingMediaSource
;
import
androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource
;
import
androidx.media3.exoplayer.trackselection.DefaultTrackSelector
;
import
androidx.media3.exoplayer.upstream.Allocation
;
...
...
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