mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-05 15:49:22 +00:00
Elaboration on prev/next queue behavior
This commit is contained in:
parent
bc00b12b8c
commit
d433d6e774
1 changed files with 18 additions and 0 deletions
|
@ -373,6 +373,10 @@ class StatePlayer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Checks what the prev queue item would without consuming it.
|
||||||
|
* @param forceLoop If start of queue should be ignored and loop around to end without queueRepeat being true
|
||||||
|
*/
|
||||||
fun getPrevQueueItem(forceLoop: Boolean = false) : IPlatformVideo? {
|
fun getPrevQueueItem(forceLoop: Boolean = false) : IPlatformVideo? {
|
||||||
synchronized(_queue) {
|
synchronized(_queue) {
|
||||||
if(_queue.size == 1)
|
if(_queue.size == 1)
|
||||||
|
@ -397,6 +401,10 @@ class StatePlayer {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
/***
|
||||||
|
* Checks what the next queue item would without consuming it.
|
||||||
|
* @param forceLoop If end of queue should be ignored and loop around to start without queueRepeat being true
|
||||||
|
*/
|
||||||
fun getNextQueueItem(forceLoop: Boolean = false) : IPlatformVideo? {
|
fun getNextQueueItem(forceLoop: Boolean = false) : IPlatformVideo? {
|
||||||
synchronized(_queue) {
|
synchronized(_queue) {
|
||||||
if(_queue.size == 1)
|
if(_queue.size == 1)
|
||||||
|
@ -427,6 +435,12 @@ class StatePlayer {
|
||||||
return nextQueueItem(false, true);
|
return nextQueueItem(false, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Triggers the next queue item, removing it depending on the queue type, should ONLY be used if you're directly consuming this item
|
||||||
|
* @param withoutRemoval Prevents the removal behavior of certain playlists, should be true for manual user actions like next
|
||||||
|
* @param bypassVideoLoop Bypasses any single-video-looping behavior, should be true for manual user actions like next
|
||||||
|
*/
|
||||||
fun nextQueueItem(withoutRemoval: Boolean = false, bypassVideoLoop: Boolean = false) : IPlatformVideo? {
|
fun nextQueueItem(withoutRemoval: Boolean = false, bypassVideoLoop: Boolean = false) : IPlatformVideo? {
|
||||||
if(loopVideo && !bypassVideoLoop)
|
if(loopVideo && !bypassVideoLoop)
|
||||||
return currentVideo;
|
return currentVideo;
|
||||||
|
@ -463,6 +477,10 @@ class StatePlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Triggers the prev queue item, removing it depending on the queue type
|
||||||
|
* @param withoutRemoval Prevents the removal behavior of certain playlists, should be true for manual user actions like next
|
||||||
|
*/
|
||||||
fun prevQueueItem(withoutRemoval: Boolean = false) : IPlatformVideo? {
|
fun prevQueueItem(withoutRemoval: Boolean = false) : IPlatformVideo? {
|
||||||
synchronized(_queue) {
|
synchronized(_queue) {
|
||||||
if (_queue.size == 0) {
|
if (_queue.size == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue