Nonstop Brightscript SDK

Complete Content

Complete Content allows the client app to query for information regarding the current stream, as well as record a Complete Content task internally.

Generally this is used to integrate Nonstop information into End Card scenarios for Episodes and Movies.

When to call it

completeContent should be called when the client app needs to present information on completing a piece of content to the logged in user:

  • Reaches the end card of a movie
  • Reaches the end card of an episode
  • Reaches the end card of a VPPO clip
  • Reaches the end card of a ShowMS clip
  • Note: there are no end cards on Live so no completeContent should be called

How to call it

sub OnEndCardReadyToShow()
    listener = createNodeAndInit("AssociativeArrayListener")
    m.global.Nonstop.completeContent.callFunc("start", {
        workflowListener: listener,
        details: {
            contentId: "VDKA4220171"
        }
    })
    listener.observeFieldScoped("data", "OnReportResult")
end sub

sub OnReportResult(message as Object)
    listener = message.getRoSGNode()
    if listener.status = "complete" then
        ' listener.data contains details of the users activity
    else if listener.status = "error" then
        ' an error occurred when getting the report details
    end if
    listener.unObserveFieldScoped("data")
end function
  • contentId - Pass the Partner API Id of the content the user has just finished watching

Report Object

The report object contains the following properties:

  • contentTitle: String - The title of the Content the points were earned on - for Movies the Movie title for Shows the name of the Show
  • contentId: String - The ID of the Content the points were earned on
  • episodeTitle: String - If the content was an Episode, the title of the Episode
  • episodeNumber: Int - If the content was an Episode, the title of the Episode
  • seasonNumber: Int - If the content was an Episode, the title of the Episode
  • logoImageUrl: String - The logo for the content, if available
  • backgroundImageUrl: String - The background image for the content, if available
  • previousPoints: Int - The points the user had when they started this Watch & Earn stream
  • previousPointsDisplay: String - The points the user had when they started this Watch & Earn stream, correctly formatted for display to the user
  • newPoints: Int? - The points the user has now
  • newPointsDisplay: String - The points the user has now, correctly formatted for display to the user
  • pointsEarned: Int? - The points the user earned for this stream
  • pointsEarnedDisplay: String - The points the user earned for this stream, correctly formatted for display to the user
  • minutesWatched: Int? - The number of minutes the user watched
  • minutesWatchedDisplay: String - The number of minutes the user watched, correctly formatted for display to the user
  • amplitudeEpisodeNumber: String? - Used for tracking internally by the SDK

If pointsEarned equals 0 then the client app should not present anything Nonstop related to the user.

In this document