LibreTube/app/src/main/java/com/github/libretube/util/PlayingQueue.kt

21 lines
378 B
Kotlin
Raw Normal View History

2022-09-19 23:37:55 +05:30
package com.github.libretube.util
object PlayingQueue {
val queue = mutableListOf<String>()
fun clear() {
queue.clear()
}
fun add(videoId: String) {
queue.add(videoId)
}
fun playNext(currentVideoId: String, nextVideoId: String) {
queue.add(
queue.indexOf(currentVideoId),
nextVideoId
)
}
}