Roku – Instant Resume

22 / Oct / 2024 by Lokesh Singh Sodha 0 comments

Instant Resume is a feature that enables the channel to save their current state on exit and when the user relaunches the channel next time then the channel resumes the execution where the user exits.
This improves the user experience and increases the engagement ratio by letting viewers quickly get back to the content where they left off last time.

What is the Instant Resume Feature?

The Instant Resume is a feature that helps users get back to their previous spot in an app after exiting the app. Imagine you’re watching any show in any Roku app, and for some reason, you exit the app and move to another app. With Instant Resume, when you return to the original app, you don’t have to reload the entire application or find your place manually. Roku remembers where you left off and resumes from that exact spot no loading, no hassle.

This feature works much like the bookmarking functionality where the user can to continue watch the video from the last played position. Not all apps support this feature, but Roku has been rolling it out with select channels, continually expanding its availability as it partners with more services.

How Does Instant Resume Work?

Instant Resume operates in a way that integrates seamlessly with Roku’s user interface. Here’s how it works:

  • Supported Channels: When a user opens a supported channel, starts watching content, and then exits, Roku automatically bookmarks the user’s progress in the background.
  • Seamless Return: Upon re-opening the app, Roku skips the introductory splash screens, loading bars, and previous menus. It takes you directly to where you left off, saving time and eliminating the frustration of navigating through multiple screens.
  • Minimal Interruption: The system is designed to function even if your device has been turned off or restarted, ensuring a smooth transition back into your streaming experience.
  • Supported Content: Instant Resume works with a growing list of popular channels like Tubi, Netflix, etc. on Roku. As the feature expands, more users will be able to experience its benefits across their favorite apps.

Benefits to Integrate the Instant Resume in Roku Channel

  • Faster Access to Content: The most obvious benefit of the Instant Resume feature is speed. Streaming apps, especially those loaded with content, can take a few seconds to load, followed by more time spent navigating back to what you were watching. Instant Resume eliminates this by letting you jump straight into your last viewing session, saving you time and frustration.
  • Enhanced User Experience: Instant Resume provides a seamless way for users to engage with content, even if their streaming session is interrupted. Whether you’re multitasking, swapping between apps, or stepping away from your device, this feature ensures you can resume without a hitch.
  • Perfect for Binge-Watchers: For those who love to binge-watch TV series or indulge in back-to-back movies, this feature is a blessing. There’s no need to hunt for the episode you were on or scrub through to find your spot—Roku remembers it all. This convenience means more time enjoying content and less time dealing with navigation.

Steps to implement Instant Resume

  1. Updates the channel manifest with required attributes.
  2. Implements the required suspend and resume handlers.
  3. Adds signal beacons to measure channel suspend and resume times.

1. Add below entries in Channel manifest

  • sdk_instant_resume=1, Acknowledge that the channel has implemented all the requirements and protocols for the Instant Resume integration.
  • run_as_process=1, Enables the Roku OS to preserve the channel state in the device RAM when the channel is suspended.

2. Implementing suspend and resume handlers

  • Implementing Instant Resume involves programming two handlers: customSuspend and customResume.
  • These handlers must be attached to any scene that may be active during channel operation.
  • I created the 2 callback functions for customSuspend and customResume in sample code named as onMainSceneSuspend and onMainSceneResume.

onMainSceneSuspend: When the channel is suspended after being exited, this callback function checks whether the channel was exited because the Home button was pressed on the Roku remote control. If the Home button was pressed and the viewer was watching content, they are returned to the Details screen upon relaunching the channel. The user can resume playback or start watching from the beginning.

onMainSceneResume: When the channel is resumed, this callback function checks whether it received any launch parameters. If so, the channel into the content specified by the `contentId` using the launch behavior required by the specified `mediaType`.

Signal Beacons:
The “onMainSceneResume” callback function fires the “AppResumeComplete” beacon.
This beacon must be fired when the suspended scene is fully rendered during the resume process and when video playback starts after handling a deeplinking, once the channel can respond to commands sent via the Roku remote control.

Code Sample:

Add these manifest entries to enable the Instant resume.

# Enable instant resume with the following manifest entries...
sdk_instant_resume=1
run_as_process=1

Add these 2 functions with your logic into your mainscene.brs file

sub onMainSceneSuspend(args as dynamic)
    print "***** Suspending Channel *****"
    print "Args passed into suspend callback: "; args
    if args.doesExist("lastSuspendOrResumeReason") and args.lastSuspendOrResumeReason = "home"
        if m.videoScreen <> invalid
            playerTask = m.videoScreen.findNode("PlayerTask")
            playerTask.control = "STOP"
        end if
    end if
end sub

' Callback function when the channel resumes after a channel exit. In this example, the channel will check if
' there were any launch parameters passed with deeplink information. If so, the channel will deeplink into the
' appropriate content using the behavior defined by the media type.
sub onMainSceneResume(args as dynamic)
    print "***** Resuming Channel *****"
    print "Args passed into resume callback: "; args
    if args.doesExist("launchParams")
        if args.launchParams.contentId <> invalid and args.launchParams.mediaType <> invalid
            DeepLink(m.contentTask.content, args.launchParams.mediaType, args.launchParams.contentId)
        end if
    end if
    myScene = m.top.getScene()
    myScene.signalBeacon("AppResumeComplete")
end sub

Here is the demo video of the Instant Resume feature.
https://www.youtube.com/watch?v=0Xux_UutCDw

FOUND THIS USEFUL? SHARE IT

Tag -

instant resume

Leave a Reply

Your email address will not be published. Required fields are marked *