Beyond
Reel Rookie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2022
10:04 AM
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!
2 REPLIES 2
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2022
03:25 PM
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.
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.
Beyond
Reel Rookie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022
03:21 AM
Re: Pass URL as a parameter to Video node
It works! Thank you very much!