Nonstop Brightscript SDK

Performing Tasks

Users can complete Tasks with the integrating application calling Nonstop to tell the platform whenever one of the relevant user actions occurs.

Tasks that should be tracked by the client application are:

Started Content

This should be called whenever a logged in user starts any content including Live, Episodes, Movies, VPPO Clips and ShowMS Clips. "Starts any content" refers to the point at which the user has started the video stream i.e. after any MVPD authentication or any pre-flight authorization checks have occurred. This is important to ensure points are correctly deducted from users. Please see Purchase Validation for details.

  • taskName - start-content
  • contentId - For VPPO content it should be passed the Partner API Id, for ShowMS Clips the ShowMS Id and for live either "US/Eastern" or "US/Pacific".
  • isWatchingNonstop - This defaults to false and should be set to true when the user is starting a stream in Nonstop mode. The client app should know this from the result of the presentChoiceCard call. It does not need to be set for Live, VPPO or ShowMS Clips as these cannot be viewed Nonstop.

Watch 1 Minute of Content

Whenever the logged in user is watching any content this task should be called once per every minute of viewing.

  • taskName - watch-1-minute-of-content
  • contentId - For VPPO content it should be passed the Partner API Id, for ShowMS Clips the ShowMS Id and for live either "US/Eastern" or "US/Pacific".

Note: While you cannot watch and earn on VPPO or ShowMS Clips by the minute we still recommend reporting Starts and Watch 1 Minute tasks for these content types.

Connect MVPD Account

This should be called whenever a logged in user connects their MVPD Provider.

  • taskName - connect-mvpd-account
  • mvpdName - MVPD name of the TV provider the user successfully connected. Note this should be the value obtained from the Adobe SDK for the provider Name, not the provider Id. For example, for Comcast it should be "Comcast Xfinity" not "Comcast_sso". The value should be camel cased.

Calling userPerformedTask

The correct task input and parameters is then passed to userPerformedTask as follows:

sub OnWatch1Min()
    promise = invalid 
    promise = m.global.Nonstop.instance.callFunc("userPerformedTask", {
        task: "watch-1-minute-of-content"
        contentId: "VDKA7128624"
    })
    promise.observeField("data", "OnWatch1MinuteResult")
end sub

sub OnWatch1MinuteResult(message as Object)
    promise = message.getRoSGNode()
    if promise.status = 1 then
        ' Task recorded successfully
    else if promise.status = 2
        ' Error when recording task
    end if
    promise.unObserveFieldScoped("data")
end sub

Notes on calling userPerformedTask:

  • If there is no logged in user an error will be thrown
  • Any issues with the validation of the task will be returned as an error - e.g. content doesn't exist
  • If the user should be receive points for completing the task then the SDK will assign them automatically
  • If the user should see a Reward Card for completing the task the SDK will show it and play it before returning success
  • If you wish to suppress the animation which will be played as a result of completing the task, you can pass a shouldAnimate parameter set to false

Success and Error should only be used for logging, if required.

Internal Tasks

Note: For some tasks the completion of them is tracked internally within the SDK based on either user interactions within SDK components or based on other SDK calls. These are:

Enter Code

This will be recorded when a user enters a code within the Nonstop home.

Sign Up

This is recorded in the background whenever the Login function is called.

Complete Content - Nonstop Promos

This will be recorded automatically when users complete Nonstop promos from Nonstop home.

As such at present the Client applications do not have to call userPerformedTask for these tasks.

In this document