Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Roku Guru

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 2
RokuJoel
Binge Watcher

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.