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
completeContentshould 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 ShowcontentId: String- The ID of the Content the points were earned onepisodeTitle: String- If the content was an Episode, the title of the EpisodeepisodeNumber: Int- If the content was an Episode, the title of the EpisodeseasonNumber: Int- If the content was an Episode, the title of the EpisodelogoImageUrl: String- The logo for the content, if availablebackgroundImageUrl: String- The background image for the content, if availablepreviousPoints: Int- The points the user had when they started this Watch & Earn streampreviousPointsDisplay: String- The points the user had when they started this Watch & Earn stream, correctly formatted for display to the usernewPoints: Int?- The points the user has nownewPointsDisplay: String- The points the user has now, correctly formatted for display to the userpointsEarned: Int?- The points the user earned for this streampointsEarnedDisplay: String- The points the user earned for this stream, correctly formatted for display to the userminutesWatched: Int?- The number of minutes the user watchedminutesWatchedDisplay: String- The number of minutes the user watched, correctly formatted for display to the useramplitudeEpisodeNumber: 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.