Page 1 of 1

setting the rec of a player object

Posted: Tue Feb 23, 2010 2:50 am
by reelstuff
I have been experimenting with a player object, setting the source from the available media in a folder.

Code: Select all

command setupsource
   get fld "playersource"
   put it into sourceVar
   ## set the filename of player "Player1" to sourceVar
  ## find a way to get the rec of the video 
   ##set the rec of player1 to tRec
   send mouseUp to control "List Sorted Files"
end setupsource
I managed to get the object to switch the media, from video to mp3 and back again but I have an issue
with video that is of a different size than the first player object, so I tried to set the rec of the player object, which failed.
any thoughts or suggestions, are always very welcomed.

Re: setting the rec of a player object

Posted: Tue Feb 23, 2010 9:17 am
by Klaus
Hi reelstuff,

after setting the filename of a player you can query "the formattedheigth of player x" and "the formattedwidth of player x".
Then you can calculate the neccessary rect, but keep the height of the controller in mind (16 pixels if I remember right)!
If it is a sound file like MP3 then these values are 0 (zero).

Hope that helps.


Best

Klaus