2018-02-22 22:30:48 +01:00
|
|
|
package org.schabi.newpipe.player.mediasource;
|
|
|
|
|
2019-10-04 14:59:08 +02:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import androidx.annotation.Nullable;
|
2018-02-27 04:57:59 +01:00
|
|
|
|
2021-01-19 09:27:29 +01:00
|
|
|
import com.google.android.exoplayer2.MediaItem;
|
2018-05-08 19:18:32 +02:00
|
|
|
import com.google.android.exoplayer2.source.BaseMediaSource;
|
2018-02-22 22:30:48 +01:00
|
|
|
import com.google.android.exoplayer2.source.MediaPeriod;
|
|
|
|
import com.google.android.exoplayer2.upstream.Allocator;
|
2019-03-05 18:05:44 +01:00
|
|
|
import com.google.android.exoplayer2.upstream.TransferListener;
|
2018-02-22 22:30:48 +01:00
|
|
|
|
2018-04-21 23:10:01 +02:00
|
|
|
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
|
2018-02-27 04:57:59 +01:00
|
|
|
|
2018-05-08 19:18:32 +02:00
|
|
|
public class PlaceholderMediaSource extends BaseMediaSource implements ManagedMediaSource {
|
2021-01-19 09:27:29 +01:00
|
|
|
/**
|
|
|
|
* Returns the {@link MediaItem} whose media is provided by the source.
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public MediaItem getMediaItem() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-02-22 22:30:48 +01:00
|
|
|
// Do nothing, so this will stall the playback
|
2020-03-31 19:20:15 +02:00
|
|
|
@Override
|
|
|
|
public void maybeThrowSourceInfoRefreshError() { }
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public MediaPeriod createPeriod(final MediaPeriodId id, final Allocator allocator,
|
|
|
|
final long startPositionUs) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void releasePeriod(final MediaPeriod mediaPeriod) { }
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void prepareSourceInternal(@Nullable final TransferListener mediaTransferListener) { }
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void releaseSourceInternal() { }
|
2018-02-22 22:30:48 +01:00
|
|
|
|
|
|
|
@Override
|
2020-03-31 19:20:15 +02:00
|
|
|
public boolean shouldBeReplacedWith(@NonNull final PlayQueueItem newIdentity,
|
2018-03-18 00:04:02 +01:00
|
|
|
final boolean isInterruptable) {
|
2018-02-22 22:30:48 +01:00
|
|
|
return true;
|
|
|
|
}
|
2018-03-18 00:04:02 +01:00
|
|
|
|
|
|
|
@Override
|
2020-03-31 19:20:15 +02:00
|
|
|
public boolean isStreamEqual(@NonNull final PlayQueueItem stream) {
|
2018-03-18 00:04:02 +01:00
|
|
|
return false;
|
|
|
|
}
|
2018-02-22 22:30:48 +01:00
|
|
|
}
|