-Hooking playback manager and play queue into main video player.

This commit is contained in:
John Zhen M
2017-10-30 20:58:41 -07:00
committed by John Zhen Mo
parent 701320b100
commit b859823011
9 changed files with 147 additions and 44 deletions
@@ -25,8 +25,14 @@ public abstract class PlayQueue {
private BehaviorSubject<PlayQueueEvent> changeBroadcast;
private Flowable<PlayQueueEvent> playQueueFlowable;
PlayQueue(final int index) {
PlayQueue() {
this(0, Collections.<PlayQueueItem>emptyList());
}
PlayQueue(final int index, final List<PlayQueueItem> startWith) {
streams = Collections.synchronizedList(new ArrayList<PlayQueueItem>());
streams.addAll(startWith);
queueIndex = new AtomicInteger(index);
changeBroadcast = BehaviorSubject.create();
@@ -37,9 +43,6 @@ public abstract class PlayQueue {
// single stream or local queues are always complete
public abstract boolean isComplete();
// load in the background the item at index, may do nothing if the queue is incomplete
public abstract void load(int index);
// load partial queue in the background, does nothing if the queue is complete
public abstract void fetch();