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: 

roVideoPlayer.SetDestinationRect() not working

Even though I have set roVideoPlayer to show in a specific portion of screen but it still is showing in fullscreen. It was working fine but for some feature I had to invalidate the roVideoPlayer and then create it again in 3 to 4 places in my application's workflow. But every time for creation of roVideoPlayer I am using same method. So I am not able to understand why it was working fine previously but not now as I have done no change in the method I am using to create roVideoPlayer object. So if anybody can tell any reason for which roVideoPlayer.SetDesticationRect() might not work?????

Here is the method that I am using to create roVideoPlayer every time:


function getVideoPlayer(port as object, playerRect as object)
player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetDestinationRect(playerRect)
' player.SetPositionNotificationPeriod(1)
player.SetMaxVideoDecodeResolution(1920, 1080)
player.SetLoop(false)

player.SetCertificatesFile("common:/certs/ca-bundle.crt")
player.SetCertificatesDepth(4)
player.InitClientCertificates()

return player
end function


In between this invalidation of roVideoPlayer and its creation again, I am playing some audio using roAudioPlayer. But the problem is now the player runs in full screen even from start i.e. before its invalidation and re-creation.

playerRect has correct values I have checked...
0 Kudos
1 REPLY 1

Re: roVideoPlayer.SetDestinationRect() not working

Ok, I found out what the issue was, so I am posting in case someone else faces it too,

As I was using both roAudioPlayer and roVideoPlayer so I was doing something like this:

m.videoplayer = MyVideoPlayer()
m.audioplayer = MyAudioPlayer()

So what happens here is when I create roAudioPlayer, roVideoPlayer I don't know why but somehow sets its properties to defaults i.e. it will show in the full screen no matter you have set it to show in a portoin of screen using roVideoPlayer.SetDestinationRect(). So the issue was resolved when I did this:

m.audioplayer = MyAudioPlayer()
m.videoplayer = MyVideoPlayer()
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.