Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

TCL Roku TV hdmi_status.IsHdcpActive("2.2") causes crash

Jump to solution

Hello All,

I am new to roku development. I am implementing a playback in channel and using below canPlay4k method in my TCL Roku TV (model: 55S403).

I see crash. Appreciate any help as I am currently stuck with this issue

*     if devinfo.GetModelType = "STB" and hdmi_status.IsHdcpActive("2.2") <> true

'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec)

Function CanPlay4K() as Boolean
    dev_info = CreateObject("roDeviceInfo")
    hdmi_status = CreateObject("roHdmiStatus")

    ' Check if the output mode is 2160p
    video_mode = dev_info.GetVideoMode()
    if (Left(video_mode, 5) <> "2160p")
      return false 'output mode is not set to 2160p
    end if

    print "Inside CanPlay4K  "
    if hdmi_status = invalid
        print "hdmi_status invalid "
    end if
  
    ' Check if HDCP 2.2 is enabled, skip check for TVs
    if devinfo.GetModelType = "STB" and hdmi_status.IsHdcpActive("2.2") <> true
        return false 'HDCP version is not 2.2
    end if

    ' Check if the Roku player can decode 4K 60fps HEVC streams or 4K 30fps vp9 streams
    hevc_video = { Codec: "hevc", Profile: "main", Level: "5.1" }
    vp9_video = { Codec: "vp9", Profile: "profile 0" }
    can_decode_hevc = dev_info.CanDecodeVideo(hevc_video)
    can_decode_vp9 = dev_info.CanDecodeVideo(vp9_video)
    if can_decode_hevc.result <> true OR can_decode_vp9.result <> true
      return false 'device cannot decode 4K HEVC AND VP9 streams
    end if

    ' (Optional) Check if the Roku player decrypts inside a TEE
    drm_info = dev_info.GetDrmInfo()
    if Instr(1, drm_info.playready, "tee") = 0
      return false 'device does not decrypt inside TEE
    end if

    return true
End Function
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Level 11

Re: TCL Roku TV hdmi_status.IsHdcpActive("2.2") causes crash

Jump to solution
if dev_info.GetModelType() = "STB"

View solution in original post

2 Replies
Level 11

Re: TCL Roku TV hdmi_status.IsHdcpActive("2.2") causes crash

Jump to solution
if dev_info.GetModelType() = "STB"

View solution in original post

Level 7

Re: TCL Roku TV hdmi_status.IsHdcpActive("2.2") causes crash

Jump to solution

Thanks @necrotek It works

0 Kudos