If current and next item are both audio, don't leave player
This commit is contained in:
parent
d9f714690e
commit
39abf06056
|
@ -259,6 +259,10 @@ sub setTopStartingPoint(positionTicks)
|
|||
m.queue[0].startingPoint = positionTicks
|
||||
end sub
|
||||
|
||||
' getItemType: Returns the media type of the passed item
|
||||
'
|
||||
' @param {dynamic} item - Item to evaluate
|
||||
' @return {string} indicating type of media item is
|
||||
function getItemType(item) as string
|
||||
if isValid(item) and isValid(item.json) and isValid(item.json.mediatype) and item.json.mediatype <> ""
|
||||
return LCase(item.json.mediatype)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<function name="getHold" />
|
||||
<function name="getIsShuffled" />
|
||||
<function name="getItemByIndex" />
|
||||
<function name="getItemType" />
|
||||
<function name="getPosition" />
|
||||
<function name="getQueue" />
|
||||
<function name="getQueueTypes" />
|
||||
|
|
|
@ -298,15 +298,22 @@ function playAction() as boolean
|
|||
end function
|
||||
|
||||
function previousClicked() as boolean
|
||||
if m.global.queueManager.callFunc("getPosition") = 0 then return false
|
||||
currentQueuePosition = m.global.queueManager.callFunc("getPosition")
|
||||
|
||||
if currentQueuePosition = 0 then return false
|
||||
|
||||
if m.playlistTypeCount > 1
|
||||
m.global.audioPlayer.control = "stop"
|
||||
previousItem = m.global.queueManager.callFunc("getItemByIndex", currentQueuePosition - 1)
|
||||
previousItemType = m.global.queueManager.callFunc("getItemType", previousItem)
|
||||
|
||||
m.global.sceneManager.callFunc("clearPreviousScene")
|
||||
m.global.queueManager.callFunc("moveBack")
|
||||
m.global.queueManager.callFunc("playQueue")
|
||||
return true
|
||||
if previousItemType <> "audio"
|
||||
m.global.audioPlayer.control = "stop"
|
||||
|
||||
m.global.sceneManager.callFunc("clearPreviousScene")
|
||||
m.global.queueManager.callFunc("moveBack")
|
||||
m.global.queueManager.callFunc("playQueue")
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
exitScrubMode()
|
||||
|
@ -362,14 +369,21 @@ end sub
|
|||
|
||||
function nextClicked() as boolean
|
||||
if m.playlistTypeCount > 1
|
||||
if m.global.queueManager.callFunc("getPosition") < m.global.queueManager.callFunc("getCount") - 1
|
||||
m.global.audioPlayer.control = "stop"
|
||||
currentQueuePosition = m.global.queueManager.callFunc("getPosition")
|
||||
if currentQueuePosition < m.global.queueManager.callFunc("getCount") - 1
|
||||
|
||||
m.global.sceneManager.callFunc("clearPreviousScene")
|
||||
m.global.queueManager.callFunc("moveForward")
|
||||
m.global.queueManager.callFunc("playQueue")
|
||||
nextItem = m.global.queueManager.callFunc("getItemByIndex", currentQueuePosition + 1)
|
||||
nextItemType = m.global.queueManager.callFunc("getItemType", nextItem)
|
||||
|
||||
if nextItemType <> "audio"
|
||||
m.global.audioPlayer.control = "stop"
|
||||
|
||||
m.global.sceneManager.callFunc("clearPreviousScene")
|
||||
m.global.queueManager.callFunc("moveForward")
|
||||
m.global.queueManager.callFunc("playQueue")
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
return true
|
||||
end if
|
||||
|
||||
exitScrubMode()
|
||||
|
|
Loading…
Reference in New Issue
Block a user