-Rename playlist in players to play queue.
This commit is contained in:
parent
c108663eff
commit
32c39da15f
9 changed files with 164 additions and 144 deletions
|
|
@ -250,12 +250,7 @@ public abstract class BasePlayer implements Player.EventListener, AudioManager.O
|
|||
changeState(STATE_LOADING);
|
||||
|
||||
isPrepared = false;
|
||||
|
||||
final MediaSource ms = buildMediaSource(url, format);
|
||||
final DynamicConcatenatingMediaSource dcms = new DynamicConcatenatingMediaSource();
|
||||
dcms.addMediaSource(ms);
|
||||
mediaSource = dcms;
|
||||
dcms.addMediaSource(new LoopingMediaSource(ms, 2));
|
||||
mediaSource = buildMediaSource(url, format);
|
||||
|
||||
if (simpleExoPlayer.getPlaybackState() != Player.STATE_IDLE) simpleExoPlayer.stop();
|
||||
if (videoStartPos > 0) simpleExoPlayer.seekTo(videoStartPos);
|
||||
|
|
|
|||
|
|
@ -3,19 +3,31 @@ package org.schabi.newpipe.player;
|
|||
import com.google.android.exoplayer2.source.DynamicConcatenatingMediaSource;
|
||||
import com.google.android.exoplayer2.source.MediaSource;
|
||||
|
||||
import org.schabi.newpipe.playlist.Playlist;
|
||||
import org.schabi.newpipe.playlist.PlayQueue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MediaSourceManager {
|
||||
public class PlaybackManager {
|
||||
|
||||
private DynamicConcatenatingMediaSource source;
|
||||
|
||||
private Playlist playlist;
|
||||
private PlayQueue playQueue;
|
||||
private int index;
|
||||
|
||||
private List<MediaSource> sources;
|
||||
|
||||
public MediaSourceManager(Playlist playlist) {
|
||||
public PlaybackManager(PlayQueue playQueue, int index) {
|
||||
this.source = new DynamicConcatenatingMediaSource();
|
||||
this.playlist = playlist;
|
||||
|
||||
this.playQueue = playQueue;
|
||||
this.index = index;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface OnChangeListener {
|
||||
void isLoading();
|
||||
void isLoaded();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue