Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
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.SetPositionNotificationPeriod(1)
player.SetMaxVideoDecodeResolution(1920, 1080)


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

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