add quick play support for music videos
This commit is contained in:
parent
5218002f10
commit
853419eb9b
|
@ -125,6 +125,11 @@ sub playQueue()
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if nextItemMediaType = "musicvideo"
|
||||||
|
CreateVideoPlayerView()
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
if nextItemMediaType = "video"
|
if nextItemMediaType = "video"
|
||||||
CreateVideoPlayerView()
|
CreateVideoPlayerView()
|
||||||
return
|
return
|
||||||
|
|
|
@ -179,6 +179,8 @@ sub Main (args as dynamic) as void
|
||||||
quickplay.userView(itemNode)
|
quickplay.userView(itemNode)
|
||||||
else if itemType = "folder"
|
else if itemType = "folder"
|
||||||
quickplay.folder(itemNode)
|
quickplay.folder(itemNode)
|
||||||
|
else if itemType = "musicvideo"
|
||||||
|
quickplay.musicVideo(itemNode)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.global.queueManager.callFunc("playQueue")
|
m.global.queueManager.callFunc("playQueue")
|
||||||
|
|
|
@ -61,6 +61,13 @@ namespace quickplay
|
||||||
m.global.queueManager.callFunc("push", itemNode)
|
m.global.queueManager.callFunc("push", itemNode)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
' A single music video file.
|
||||||
|
sub musicVideo(itemNode as object)
|
||||||
|
if not isValid(itemNode) or not isValid(itemNode.id) or not isValid(itemNode.json) then return
|
||||||
|
|
||||||
|
m.global.queueManager.callFunc("push", itemNode)
|
||||||
|
end sub
|
||||||
|
|
||||||
' A music album.
|
' A music album.
|
||||||
' Play the entire album starting with track 1.
|
' Play the entire album starting with track 1.
|
||||||
sub album(itemNode as object)
|
sub album(itemNode as object)
|
||||||
|
@ -418,6 +425,25 @@ namespace quickplay
|
||||||
end for
|
end for
|
||||||
m.global.queueManager.callFunc("toggleShuffle")
|
m.global.queueManager.callFunc("toggleShuffle")
|
||||||
end if
|
end if
|
||||||
|
else if collectionType = "musicvideos"
|
||||||
|
' get randomized list of videos inside
|
||||||
|
data = api.users.GetItemsByQuery(m.global.session.user.id, {
|
||||||
|
"parentId": itemNode.id,
|
||||||
|
"includeItemTypes": "MusicVideo",
|
||||||
|
"sortBy": "Random",
|
||||||
|
"Recursive": true,
|
||||||
|
"imageTypeLimit": 1,
|
||||||
|
"enableUserData": false,
|
||||||
|
"EnableTotalRecordCount": false
|
||||||
|
})
|
||||||
|
print "data=", data
|
||||||
|
if isValid(data) and isValidAndNotEmpty(data.items)
|
||||||
|
' add each item to the queue
|
||||||
|
pushToQueue(data.Items)
|
||||||
|
if data.items.count() > 1
|
||||||
|
m.global.queueManager.callFunc("toggleShuffle")
|
||||||
|
end if
|
||||||
|
end if
|
||||||
' else if collectionType = "homevideos" ' also used for a "Photo" library
|
' else if collectionType = "homevideos" ' also used for a "Photo" library
|
||||||
else
|
else
|
||||||
print "Quick Play WARNING: Unknown collection type"
|
print "Quick Play WARNING: Unknown collection type"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user