Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
EnTerr
Level 9

Bug? roCaptionRenderer has no ifGetMessagePort/ifSetMess...

Discrepancy - documentation http://sdkdocs.roku.com/display/sdkdoc/ ... onRenderer promices ifGetMessagePort/ifSetMessagePort interfaces, implementation does not deliver:
BrightScript Debugger> vp = createObject("roVideoPlayer")
BrightScript Debugger> cr = vp.getCaptionRenderer()
BrightScript Debugger> ? cr
<Component: roCaptionRenderer>
BrightScript Debugger> ? getInterface(cr, "ifCaptionRenderer")
<Interface: ifCaptionRenderer>
BrightScript Debugger> ? getInterface(cr, "ifGetMessagePort")
invalid
BrightScript Debugger> ? getInterface(cr, "ifSetMessagePort")
invalid
BrightScript Debugger> ? cr.getMessagePort()
Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(156)
0 Kudos
2 Replies
Roku Employee
Roku Employee

Re: Bug? roCaptionRenderer has no ifGetMessagePort/ifSetMess

You can use SetMessagePort(port), but from my testing, it appears that GetMessagePort is not implemented, even though it is documented as being a valid method.

BrightScript Debugger> cr=createobject("rocaptionrenderer")
BrightScript Debugger> ?cr
<Component: roCaptionRenderer>
BrightScript Debugger> ?cr.getmessageport()
Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(13)
BrightScript Debugger> port=createobject("romessageport")
BrightScript Debugger> cr.setmessageport(port)
BrightScript Debugger> ?cr.getmessageport()
Member function not found in BrightScript Component or interface. (runtime error &hf4) in $LIVECOMPILE(16)


- Joel
0 Kudos
EnTerr
Level 9

Re: Bug? roCaptionRenderer has no ifGetMessagePort/ifSetMess

"RokuJoel" wrote:
You can use SetMessagePort(port), but from my testing, it appears that GetMessagePort is not implemented, even though it is documented as being a valid method.

Indeed. And as you see from my example above, it does not return ifGetMessagePort/ifSetMessagePort interfaces - which documentations says it supports and therefore should have. In case you have not used getInterface() before, it returns something non-invalid for objects that support particular interfaces. I have used it on many objects and roCaptionRenderer is the only exception i have seen.

So it is either a bug to file or documentation to fix (which will be interesting to see, documenting getMessagePort() without ifGetMessagePort )
0 Kudos