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: 
thdev
Channel Surfer

Displaying video inside a 2dapi game channel

Hi all.

I've been developing a roku game channel using 2dAPI with roScreen element.

One of the features I'm trying to implement is: showing a 400*600 video within the game (during the game. not full screen).

From what I understand so far:
1. Scene graph components dont work with 2dapi 
2. roVideoPlayer is deprecated since 2017

Is there any way to implement this? 

0 Kudos
7 REPLIES 7
renojim
Community Streaming Expert

Re: Displaying video inside a 2dapi game channel

roVideoScreen was deprecated.  I don't think roVideoPlayer was.

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
thdev
Channel Surfer

Re: Displaying video inside a 2dapi game channel

roVideoPlayer is deprecated according to the logs from the device.
When I create the object it sends the log that it's deprecated. 

Any other options you can think of? 

0 Kudos
necrotek
Roku Guru

Re: Displaying video inside a 2dapi game channel

If you are unable to use roVideoPlayer (it may be deprecated but sometimes exceptions can be made for games) you cannot mix Scenegraph and roScreen components but you can switch between them. If you just need to play a video, spin up a Scenegraph context to play the video and drop back to roScreen on closing scenegraph.

0 Kudos
thdev
Channel Surfer

Re: Displaying video inside a 2dapi game channel

I need to show a video within the game. In the same time.

You've mentioned that sometimes exceptions can be made for games regarding roVideoPlayer. 
Can you expand on this? How can I use it anyway within my game? 

0 Kudos
necrotek
Roku Guru

Re: Displaying video inside a 2dapi game channel

I do not see rovideoplayer in the list of deprecated 

https://developer.roku.com/docs/references/deprecated-apis.md

and does not mention deprecated on the doc page

https://developer.roku.com/docs/references/brightscript/components/rovideoplayer.md

roVideoplayer may have become un-deprecated according to this thread

https://community.roku.com/t5/Roku-Developer-Program/Is-roVideoPlayer-Not-Depreciated/td-p/510580

The warning may be a false flag that was not removed.  Contact roku partnersuccess for clarification and have them flag for updating the warning message.

0 Kudos
thdev
Channel Surfer

Re: Displaying video inside a 2dapi game channel

Thanks for the reply. 

I did manage to start playing a video with roVideoPlayer but I could only hear the sound.

I've found this blog post from 2012 where the use roImageCanvas  - which is deprecated.
Also the sample channels are not available in the links in the blog post.

 

Can someone share an example of how to work with roVideoPlayer?


Basically what happens is: 
1. I get the messages from the port from the player
2. I can hear the video sound
3. when I leave the channel the video itself flashes for a second as if it was rendering behind the splash screen or behind the roscreen if I render an image.

 

Any thoughts or examples would be great. Thanks again

0 Kudos
renojim
Community Streaming Expert

Re: Displaying video inside a 2dapi game channel

As I recall, when using roImageCanvas you had to punch a hole in the canvas for the video to appear since the canvas is displayed over the video.  I'm pretty sure roScreen acts the same, so try screen.Clear(0) (assuming your roScreen is named "screen") to set the whole screen to transparent.

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.
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.