clonemaster
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011
08:07 PM
Resume Playback Issues
I have an issue with the "Resume playback" button being displayed with every video in my channel; It doesn't matter if I've watched it or not. Even after I add a new video, it shows "Resume Playback" and "Play from Beginning." Anybody else have this problem when developing their channel?
8 REPLIES 8
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011
09:11 PM
Re: Resume Playback Issues
You have to handle that yourself. Don't add the "Resume" button if it's a new video or the video has already been viewed.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
clonemaster
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2011
09:58 PM
Re: Resume Playback Issues
"renojim" wrote:
You have to handle that yourself. Don't add the "Resume" button if it's a new video or the video has already been viewed.
-JT
Function refreshShowDetail(screen As Object, showList As Object, showIndex as Integer) As Integer
if validateParam(screen, "roSpringboardScreen", "refreshShowDetail") = false return -1
if validateParam(showList, "roArray", "refreshShowDetail") = false return -1
show = showList[showIndex]
'Uncomment this statement to dump the details for each show
'PrintAA(show)
screen.ClearButtons()
screen.AddButton(1, "resume playing")
screen.AddButton(2, "play from beginning")
screen.SetContent(show)
screen.Show()
End Function
So if i remove screen.AddButton(1, "resume playing") and screen.AddButton(2, "play from beginning"), how do I make them present if the show has been partially viewed?
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2011
08:10 AM
Re: Resume Playback Issues
How are you storing the playback position value if it has already played some of the video? Check that - if it exists, then add/modify the buttons. With the code you posted you aren't saving the playback position, or loading the playback position in that section of your script.
clonemaster
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2011
09:42 AM
Re: Resume Playback Issues
Function refreshShowDetail(screen As Object, showList As Object, showIndex as Integer) As Integer
if validateParam(screen, "roSpringboardScreen", "refreshShowDetail") = false return -1
if validateParam(showList, "roArray", "refreshShowDetail") = false return -1
show = showList[showIndex]
'Uncomment this statement to dump the details for each show
'PrintAA(show)
screen.ClearButtons()
if isPaused(screen)
screen.AddButton(1, "resume playing")
screen.AddButton(2, "play from beginning")
else
screen.AddButton(1, "Play")
end if
screen.SetContent(show)
screen.Show()
End Function
I haven't tested this code yet because I'm pretty sure it's incorrect. I just want to know if I'm headed in the right direction?
RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2011
10:05 AM
Re: Resume Playback Issues
I'm not sure you're yet understanding the mechanism by which resume works. Your code must save the playback position when the video stops. Normally you would save this in the registry so that you can resume even if you exit the channel and reenter it. You will need to use a name for the registry key that is associated with the file being played so that you don't resume a file based on a previous play of a different file. Then on resume, you would read that registry key for the file and set the initial playback position to the content of that registry key.
(Another option other than using the registry is to save the playback position on your server. This requires more work as you need to build a mechanism on your server to store everyone's playback position in some kind of database. The advantage is you can pause on one Roku player and resume on another. Usually only the major channels like Netflix do it this way.)
Once you have this mechanism in place, your springboard screen can check whether you have a saved playback position for the show (that is, whether the file's registry key exists), and create the resume button if there is one.
--Mark
(Another option other than using the registry is to save the playback position on your server. This requires more work as you need to build a mechanism on your server to store everyone's playback position in some kind of database. The advantage is you can pause on one Roku player and resume on another. Usually only the major channels like Netflix do it this way.)
Once you have this mechanism in place, your springboard screen can check whether you have a saved playback position for the show (that is, whether the file's registry key exists), and create the resume button if there is one.
--Mark
koshermetal
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2011
03:07 PM
Re: Resume Playback Issues
Do any of you guys have example code for the appDetailScreen.brs (that has been tested) for this whole "resume playback" thing? I removed it completely because it was showing up even if the content wasn't viewed yet. However, it would be nice to have it in there if the content was only partially watched. Any help is always appreciated!
Thanks & happy holidays!
P.S. I got this un-tested string of code below, but not sure exactly where in function refreshShowDetailScreen to place it...or if it will even work. I tried messing with it a bit but was unsuccessful.
Thanks & happy holidays!
P.S. I got this un-tested string of code below, but not sure exactly where in function refreshShowDetailScreen to place it...or if it will even work. I tried messing with it a bit but was unsuccessful.
if regread(episode.contentID)<> invalid then
screen.addbutton("Resume Playing")
end if
if regread(episode.contentID)<> invalid then
screen.addbutton("Play from Beginning")
else
screen.addbutton ("Play")
end if
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
www.koshermetal.com
RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2011
12:39 AM
Re: Resume Playback Issues
Hi, here is a link to an updated version of appDetailScreen.brs that should fix the Resume issue:
Download appDetailScreen.brs
Download appDetailScreen.brs
koshermetal
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2011
04:59 AM
Re: Resume Playback Issues
"RokuJoel" wrote:
Hi, here is a link to an updated version of appDetailScreen.brs that should fix the Resume issue:
Download appDetailScreen.brs
Thanks, Joel! This definitely did the trick and I rolled out a package update with the fix.
Gobble Gobble!!
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
www.koshermetal.com