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: 
Beyond
Reel Rookie

Pass URL as a parameter to Video node

Hello,

I am able to pass URL as a parameter to roVideoScreen following this blog post:
https://blog.roku.com/developer/2011/10/06/using-launch-parameters

Unfortunately roVideoScreen is deprecated and my channel will be rejected during certification if I use it.

Now I am trying to pass URL as a parameter to Video node using this example:
https://github.com/rokudev/samples/tree/master/media/VideoExample

I tried to use m.global to access Video node from Main function but it was unsuccessful.
Any help how to achieve this will be highly appreciated.

Thanks!

0 Kudos
2 REPLIES 2
renojim
Community Streaming Expert

Re: Pass URL as a parameter to Video node

You want to access the video node through the scene variable.  Following that example, it would be something like this:

screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("VideoExample")
screen.show()
video_node = scene.FindNode("exampleVideo")
videocontent = createObject("RoSGNode", "ContentNode")
videocontent.title = "Example Video"
videocontent.streamformat = "mp4"
videocontent.url = "https://roku-webdev-opus.s3.amazonaws.com/public-videos/big+stream+trimmed.mp4"
video_node.content = videocontent
video_node.setFocus(true)
video_node.control = "play"
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Beyond
Reel Rookie

Re: Pass URL as a parameter to Video node

It works! Thank you very much!

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.