2018-02-22 22:30:48 +01:00
|
|
|
package org.schabi.newpipe.player.mediasource;
|
|
|
|
|
2018-02-27 04:57:59 +01:00
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
|
2018-02-22 22:30:48 +01:00
|
|
|
import com.google.android.exoplayer2.ExoPlayer;
|
|
|
|
import com.google.android.exoplayer2.source.MediaPeriod;
|
|
|
|
import com.google.android.exoplayer2.upstream.Allocator;
|
|
|
|
|
2018-02-27 04:57:59 +01:00
|
|
|
import org.schabi.newpipe.playlist.PlayQueueItem;
|
|
|
|
|
2018-02-22 22:30:48 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
public class PlaceholderMediaSource implements ManagedMediaSource {
|
|
|
|
// Do nothing, so this will stall the playback
|
|
|
|
@Override public void prepareSource(ExoPlayer player, boolean isTopLevelSource, Listener listener) {}
|
|
|
|
@Override public void maybeThrowSourceInfoRefreshError() throws IOException {}
|
|
|
|
@Override public MediaPeriod createPeriod(MediaPeriodId id, Allocator allocator) { return null; }
|
|
|
|
@Override public void releasePeriod(MediaPeriod mediaPeriod) {}
|
|
|
|
@Override public void releaseSource() {}
|
|
|
|
|
|
|
|
@Override
|
2018-02-27 04:57:59 +01:00
|
|
|
public boolean canReplace(@NonNull final PlayQueueItem newIdentity) {
|
2018-02-22 22:30:48 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|