Nonstop Brightscript SDK

Choice Cards

Choice Cards control the logic around:

  • Whether the user should be offered the choice of purchasing the content at all
  • Whether the user has previously purchased the content and is still within their grace period
  • Whether the user has enough points to purchase the content
  • The user interface for presenting the choices to the user
  • Whether the choice card includes a timer, and if so for how long
  • Recording the user selection, including recording purchases
  • Calling back the integrating application with instruction on path to take

Note: In some situations the actual Choice Card UI will not show at all, the calling client will simply be instructed to continue.

When to render it

Choice Cards should be displayed prior to watching a long form on-demand stream when the user is logged in. The client should wait for one of the observed fields to change before proceeding.

This is not required for Live, VPPO clips or ShowMS clips. When called for non-valid content or when no user is logged in, the choice card will simplify notify any OnWatchStandard observers.

How to render it

  1. Include the <NonstopChoiceCard> node in the layout of the file you wish it to appear in. For example,
<NonstopChoiceCard
    id="ChoiceCard"
    visible="false"
    translation="[0,0]"/>
  1. Obtain a reference to this node in the containing Scene/Group. For example,
    m.choiceCard = m.top.findNode("ChoiceCard")
  1. When it comes time to present the ChoiceCard simply set the content ID it is being presented for, make it visible and hide any other UI. For example,
    m.choiceCard.contentId = "VDKA4220171"
    m.choiceCard.visible = true
    m.currentScene.visible = false

Callbacks

Watch Nonstop

    m.choiceCard.observeField("OnWatchNonstop", "OnWatchNonstop")

    sub OnWatchNonstop()
        ' Client should play the stream with Nonstop ad load
        ' The accessToken is located here
        accessToken = m.choiceCard.OnWatchNonstop
        ' Remember to restore your UI
        m.currentScene.visible = true
    end sub

When the client application receives this callback it means that the user should watch the selected content Nonstop. This could be for a number of reasons:

  • because they purchased via the choice card
  • because they are within their grace period for this piece of content
  • because this piece of content has been given to all users by a particular sponsor

The client application should instruct the player to commence with a reduced ad load by passing the accessToken value returned from the SDK to the entitlement request using the "cbp_token" parameter. See Playing Content Nonstop for more details.

Watch Standard

    m.choiceCard.observeField("OnWatchStandard", "OnWatchStandard")

    sub OnWatchStandard()
        ' Client should play the stream with standard ad load
        ' Remember to restore your UI
        m.currentScene.visible = true
    end sub

When the client application receives this callback it means that the user should watch the selected content with the standard ad load. This could be for a number of reasons:

  • this piece of content is not eligible to watch Nonstop
  • the user could not afford to watch the content Nonstop
  • the choice card timer elapsed and the user did not make a selection
  • an error has occurred that is best to be handled by just playing the stream with standard ad load

The client application should instruct the player to commence with a normal ad load by not passing a value for "cbp_token" to the entitlement request.

In this document