function setVODDataOnResponse() as void
top = m.top
if top.response.AvailableMedia <> invalid AND top.response.AvailableMedia.Count() > 0
videoContent = createObject("RoSGNode", "ContentNode")
mediaData = top.response.AvailableMedia[0]
m.content = top.response
' ******************************************
' * parse: DRM
' ******************************************
' get content url
videoContent.url = mediaData.ContentUrl
' check DRM
if mediaData.LicenseRequestToken <> invalid then
videoContent.EncodingType = "PlayReadyLicenseAcquisitionAndChallenge"
' logic to get enckey and removed as shared outside
videoContent.EncodingKey = encKey
end if
' ******************************************
' * parse videoContent: streamformat
' * need to determine the type of steam because the Roku player is not smart enough to figure it out and will error
' ******************************************
streamformat = determineStreamFormatFromUrl(videoContent.url)
videoContent.streamformat = streamformat
m.video.content = videoContent
m.video.control = "play"
m.timer.control = "start"
m.progressUpdateTimer.control = "start"
top.isBusy = true
if m.top.response.mediaType = "preview"
m.ffwd.speeds = [0, 5, 15, 30]
m.ffwd.displayTag = ["", "2x", "4x", "8x"]
end if
if top.contentType = "vod"
' setup progressBar
attachVodPlayerProgressBar()
attachTrickPlayProgressBar()
m.progressBar.model = top.response
m.trickPlayBar.model = top.response
' setup player data
' end if
end if
end function
RokuJonathanD - here is the code I used. Both HD and SD content works on both devices. Only 4k content has issue in one as there is no image only audio.