mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-28 00:40:39 +00:00
Make the video player prettier and automark movies as played
This commit is contained in:
parent
7195d59c95
commit
e6062661dd
@ -23,8 +23,6 @@
|
||||
end if
|
||||
end for
|
||||
m.top.title = m.top.base_title + ": " + m.top.value
|
||||
|
||||
print m.top.value_index
|
||||
end sub
|
||||
|
||||
sub cycle()
|
||||
|
@ -100,7 +100,7 @@ sub ShowLibrarySelect()
|
||||
while(true)
|
||||
msg = wait(0, port)
|
||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
||||
exit while
|
||||
return
|
||||
else if nodeEventQ(msg, "escape") and msg.getNode() = "search"
|
||||
library.setFocus(true)
|
||||
else if nodeEventQ(msg, "search_value")
|
||||
@ -404,7 +404,7 @@ sub ShowSearchOptions(query)
|
||||
end while
|
||||
end sub
|
||||
|
||||
sub showVideoPlayer(id)
|
||||
sub showVideoPlayer(video_id)
|
||||
port = CreateObject("roMessagePort")
|
||||
screen = CreateObject("roSGScreen")
|
||||
screen.setMessagePort(port)
|
||||
@ -414,12 +414,27 @@ sub showVideoPlayer(id)
|
||||
|
||||
themeScene(scene)
|
||||
|
||||
VideoPlayer(scene, id)
|
||||
video = VideoPlayer(video_id)
|
||||
scene.appendChild(video)
|
||||
|
||||
video.setFocus(true)
|
||||
|
||||
video.observeField("state", port)
|
||||
|
||||
while true
|
||||
msg = wait(0, port)
|
||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
||||
progress = int( video.position / video.duration * 100)
|
||||
if progress > 95 ' TODO - max resume percentage
|
||||
MarkItemWatched(video_id)
|
||||
end if
|
||||
' TODO - report progress here
|
||||
return
|
||||
else if nodeEventQ(msg, "state")
|
||||
state = msg.getData()
|
||||
if state = "stopped" or state = "finished"
|
||||
screen.close()
|
||||
end if
|
||||
end if
|
||||
end while
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
function VideoPlayer(scene, id)
|
||||
video = scene.createChild("Video")
|
||||
function VideoPlayer(id)
|
||||
video = CreateObject("roSGNode", "Video")
|
||||
content = VideoContent(id)
|
||||
|
||||
video.content = content
|
||||
@ -7,6 +7,12 @@ function VideoPlayer(scene, id)
|
||||
video.setFocus(true)
|
||||
video.control = "play"
|
||||
|
||||
jellyfin_blue = "#00a4dcFF"
|
||||
|
||||
video.retrievingBar.filledBarBlendColor = jellyfin_blue
|
||||
video.bufferingBar.filledBarBlendColor = jellyfin_blue
|
||||
video.trickPlayBar.filledBarBlendColor = jellyfin_blue
|
||||
|
||||
return video
|
||||
end function
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user