mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-12-02 19:26:47 +00:00
Merge pull request #332 from cewert/play-items-with-play-button
This commit is contained in:
commit
51af9fdc55
@ -343,6 +343,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||
optionsClosed()
|
||||
return true
|
||||
end if
|
||||
else if key = "play" then
|
||||
markupGrid = m.top.getChild(2)
|
||||
itemToPlay = markupGrid.content.getChild(markupGrid.itemFocused)
|
||||
if itemToPlay <> invalid and (itemToPlay.type = "Movie" or itemToPlay.type = "Episode") then
|
||||
m.top.quickPlayNode = itemToPlay
|
||||
end if
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function
|
||||
|
@ -33,6 +33,7 @@
|
||||
<interface>
|
||||
<field id="parentItem" type="node" onChange="loadInitialItems" />
|
||||
<field id="selectedItem" type="node" alwaysNotify="true" />
|
||||
<field id="quickPlayNode" type="node" alwaysNotify="true" />
|
||||
<field id="imageDisplayMode" type="string" value="scaleToZoom" />
|
||||
</interface>
|
||||
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
|
||||
|
@ -8,6 +8,7 @@
|
||||
<field id="showID" type="string" />
|
||||
<field id="seasonID" type="string" />
|
||||
<field id="overview" type="string" />
|
||||
<field id="type" type="string" value="Episode" />
|
||||
<field id="json" type="associativearray" onChange="setFields" />
|
||||
<function name="loadSeasons" />
|
||||
</interface>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<interface>
|
||||
<field id="selectedItem" alias="homeRows.selectedItem" />
|
||||
<field id="userConfig" alias="homeRows.userConfig" />
|
||||
<field id="quickPlayNode" alias="homeRows.quickPlayNode" />
|
||||
<field id="timeLastRefresh" type="integer" />
|
||||
<function name="refresh" />
|
||||
<function name="loadLibraries" />
|
||||
|
@ -313,7 +313,17 @@ function itemSelected()
|
||||
end function
|
||||
|
||||
function onKeyEvent(key as string, press as boolean) as boolean
|
||||
return false
|
||||
handled = false
|
||||
if press then
|
||||
if key = "play" then
|
||||
itemToPlay = m.top.content.getChild(m.top.rowItemFocused[0]).getChild(m.top.rowItemFocused[1])
|
||||
if itemToPlay <> invalid and (itemToPlay.type = "Movie" or itemToPlay.type = "Episode") then
|
||||
m.top.quickPlayNode = itemToPlay
|
||||
end if
|
||||
handled = true
|
||||
end if
|
||||
end if
|
||||
return handled
|
||||
end function
|
||||
|
||||
function filterNodeArray(nodeArray as object, nodeKey as string, excludeArray as object) as object
|
||||
|
@ -3,6 +3,7 @@
|
||||
<interface>
|
||||
<field id="selectedItem" type="node" alwaysNotify="true" />
|
||||
<field id="userConfig" type="assocarray" />
|
||||
<field id="quickPlayNode" type="node" alwaysNotify="true" />
|
||||
<function name="updateHomeRows" />
|
||||
<function name="loadLibraries" />
|
||||
</interface>
|
||||
|
@ -5,3 +5,17 @@ end sub
|
||||
sub setSeason()
|
||||
m.top.overhangTitle = m.top.seasonData.SeriesName + " - " + m.top.seasonData.name
|
||||
end sub
|
||||
|
||||
function onKeyEvent(key as string, press as boolean) as boolean
|
||||
handled = false
|
||||
if press then
|
||||
if key = "play" then
|
||||
itemToPlay = m.top.focusedChild.content.getChild(m.top.focusedChild.rowItemFocused[0]).getChild(0)
|
||||
if itemToPlay <> invalid and itemToPlay.id <> "" then
|
||||
m.top.quickPlayNode = itemToPlay
|
||||
end if
|
||||
handled = true
|
||||
end if
|
||||
end if
|
||||
return handled
|
||||
end function
|
||||
|
@ -5,6 +5,7 @@
|
||||
</children>
|
||||
<interface>
|
||||
<field id="episodeSelected" alias="picker.itemSelected" />
|
||||
<field id="quickPlayNode" type="node" alwaysNotify="true" />
|
||||
<field id="seasonData" type="associativearray" onChange="setSeason" />
|
||||
<field id="objects" alias="picker.objects" />
|
||||
</interface>
|
||||
|
@ -81,6 +81,24 @@ sub Main()
|
||||
else
|
||||
group.setFocus(true)
|
||||
end if
|
||||
else if isNodeEvent(msg, "quickPlayNode")
|
||||
reportingNode = msg.getRoSGNode()
|
||||
itemNode = reportingNode.quickPlayNode
|
||||
if itemNode = invalid or itemNode.id = "" then return
|
||||
if itemNode.type = "Episode" or itemNode.type = "Movie" or itemNode.type = "Video" then
|
||||
video = CreateVideoPlayerGroup(itemNode.id)
|
||||
if video <> invalid then
|
||||
group.lastFocus = group.focusedChild
|
||||
group.setFocus(false)
|
||||
group.visible = false
|
||||
group = video
|
||||
m.scene.appendChild(group)
|
||||
group.setFocus(true)
|
||||
group.control = "play"
|
||||
ReportPlayback(group, "start")
|
||||
m.overhang.visible = false
|
||||
end if
|
||||
end if
|
||||
else if isNodeEvent(msg, "selectedItem")
|
||||
' If you select a library from ANYWHERE, follow this flow
|
||||
selectedItem = msg.getData()
|
||||
|
@ -159,6 +159,7 @@ function CreateHomeGroup()
|
||||
group = CreateObject("roSGNode", "Home")
|
||||
|
||||
group.observeField("selectedItem", m.port)
|
||||
group.observeField("quickPlayNode", m.port)
|
||||
|
||||
sidepanel = group.findNode("options")
|
||||
sidepanel.observeField("closeSidePanel", m.port)
|
||||
@ -199,6 +200,7 @@ function CreateMovieListGroup(libraryItem)
|
||||
group.parentItem = libraryItem
|
||||
|
||||
group.observeField("selectedItem", m.port)
|
||||
group.observeField("quickPlayNode", m.port)
|
||||
|
||||
sidepanel = group.findNode("options")
|
||||
movie_options = [
|
||||
@ -281,6 +283,7 @@ function CreateSeasonDetailsGroup(series, season)
|
||||
group.objects = TVEpisodes(series.id, season.id)
|
||||
|
||||
group.observeField("episodeSelected", m.port)
|
||||
group.observeField("quickPlayNode", m.port)
|
||||
|
||||
return group
|
||||
end function
|
||||
@ -291,6 +294,7 @@ function CreateCollectionsList(libraryItem)
|
||||
group.parentItem = libraryItem
|
||||
|
||||
group.observeField("selectedItem", m.port)
|
||||
group.observeField("quickPlayNode", m.port)
|
||||
|
||||
sidepanel = group.findNode("options")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user