mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Return the removed media source from ConcatenatingMediaSource.removeMediaSource
PiperOrigin-RevId: 260681773
This commit is contained in:
parent
58006ac3ad
commit
40926618ad
1 changed files with 8 additions and 2 deletions
|
|
@ -263,9 +263,12 @@ public final class ConcatenatingMediaSource extends CompositeMediaSource<MediaSo
|
||||||
*
|
*
|
||||||
* @param index The index at which the media source will be removed. This index must be in the
|
* @param index The index at which the media source will be removed. This index must be in the
|
||||||
* range of 0 <= index < {@link #getSize()}.
|
* range of 0 <= index < {@link #getSize()}.
|
||||||
|
* @return The removed {@link MediaSource}.
|
||||||
*/
|
*/
|
||||||
public synchronized void removeMediaSource(int index) {
|
public synchronized MediaSource removeMediaSource(int index) {
|
||||||
|
MediaSource removedMediaSource = getMediaSource(index);
|
||||||
removePublicMediaSources(index, index + 1, /* handler= */ null, /* onCompletionAction= */ null);
|
removePublicMediaSources(index, index + 1, /* handler= */ null, /* onCompletionAction= */ null);
|
||||||
|
return removedMediaSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -282,10 +285,13 @@ public final class ConcatenatingMediaSource extends CompositeMediaSource<MediaSo
|
||||||
* @param handler The {@link Handler} to run {@code onCompletionAction}.
|
* @param handler The {@link Handler} to run {@code onCompletionAction}.
|
||||||
* @param onCompletionAction A {@link Runnable} which is executed immediately after the media
|
* @param onCompletionAction A {@link Runnable} which is executed immediately after the media
|
||||||
* source has been removed from the playlist.
|
* source has been removed from the playlist.
|
||||||
|
* @return The removed {@link MediaSource}.
|
||||||
*/
|
*/
|
||||||
public synchronized void removeMediaSource(
|
public synchronized MediaSource removeMediaSource(
|
||||||
int index, Handler handler, Runnable onCompletionAction) {
|
int index, Handler handler, Runnable onCompletionAction) {
|
||||||
|
MediaSource removedMediaSource = getMediaSource(index);
|
||||||
removePublicMediaSources(index, index + 1, handler, onCompletionAction);
|
removePublicMediaSources(index, index + 1, handler, onCompletionAction);
|
||||||
|
return removedMediaSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue