Your Digital Media Has Never Looked So Good

 
clonemaster
Topic Author
Posts: 8
Joined: Sat Jun 18, 2011 4:15 pm

Resume Playback Issues

Sun Jun 19, 2011 8:07 pm

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?
 
renojim
** Valued Community Member **
Posts: 3490
Joined: Mon Feb 15, 2010 1:35 pm

Re: Resume Playback Issues

Sun Jun 19, 2011 9:11 pm

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
 
clonemaster
Topic Author
Posts: 8
Joined: Sat Jun 18, 2011 4:15 pm

Re: Resume Playback Issues

Sun Jun 19, 2011 9:58 pm

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
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: Resume Playback Issues

Mon Jun 20, 2011 8:10 am

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
Topic Author
Posts: 8
Joined: Sat Jun 18, 2011 4:15 pm

Re: Resume Playback Issues

Mon Jun 20, 2011 9:42 am

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?
 
User avatar
RokuMarkn
Roku Engineering
Posts: 1581
Joined: Mon Jun 09, 2008 9:20 am

Re: Resume Playback Issues

Mon Jun 20, 2011 10:05 am

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
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: Resume Playback Issues

Tue Nov 22, 2011 4:07 pm

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.

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
 
User avatar
RokuJoel
Posts: 1758
Joined: Mon Nov 14, 2011 5:22 pm

Re: Resume Playback Issues

Wed Nov 23, 2011 1:39 am

Hi, here is a link to an updated version of appDetailScreen.brs that should fix the Resume issue:

Download appDetailScreen.brs
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: Resume Playback Issues

Wed Nov 23, 2011 5:59 am

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

Who is online

Users browsing this forum: No registered users and 15 guests