mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-16 07:10:29 +05:30
21 lines
378 B
Kotlin
21 lines
378 B
Kotlin
|
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
|
||
|
)
|
||
|
}
|
||
|
}
|