diff --git a/components/manager/QueueManager.brs b/components/manager/QueueManager.brs index 4b255fee..4a5b14b9 100644 --- a/components/manager/QueueManager.brs +++ b/components/manager/QueueManager.brs @@ -125,6 +125,11 @@ sub playQueue() return end if + if nextItemMediaType = "musicvideo" + CreateVideoPlayerView() + return + end if + if nextItemMediaType = "video" CreateVideoPlayerView() return diff --git a/source/Main.brs b/source/Main.brs index 02ce259b..4ec33899 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -179,6 +179,8 @@ sub Main (args as dynamic) as void quickplay.userView(itemNode) else if itemType = "folder" quickplay.folder(itemNode) + else if itemType = "musicvideo" + quickplay.musicVideo(itemNode) end if m.global.queueManager.callFunc("playQueue") diff --git a/source/utils/quickplay.bs b/source/utils/quickplay.bs index 37af9ecb..7127d9c1 100644 --- a/source/utils/quickplay.bs +++ b/source/utils/quickplay.bs @@ -61,6 +61,13 @@ namespace quickplay m.global.queueManager.callFunc("push", itemNode) 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. ' Play the entire album starting with track 1. sub album(itemNode as object) @@ -418,6 +425,25 @@ namespace quickplay end for m.global.queueManager.callFunc("toggleShuffle") 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 print "Quick Play WARNING: Unknown collection type"