Page 1 of 1

Control of Video player

Posted: Thu Oct 30, 2008 4:15 pm
by Ron Zellner
I have a scrollbar to control the speed that a movie plays at- but I don't want the movie to play when the scrollbar is changed; that currently happens with the script:

on scrollbarDrag newValue
divide newValue by 100
add .75 to newValue
put newValue into field "PlaySpeed"
set the playRate of player "MovieScreen" to newValue
end scrollbarDrag

If it is playing I want it to continue playing, if it is paused I want it to stay paused.

I assume that if I can determine the status of the player I can test for it.
I am currently trying to determine the status of the various attributes of the video player ("MovieScreen"). Where can I view that information?

I think I solved it

Posted: Thu Oct 30, 2008 5:01 pm
by Ron Zellner
This seems to do the trick:

Code: Select all

on scrollbarDrag newValue
   Put the paused of player "MovieScreen" into WhatIs -- Added this
   divide newValue by 100
   add .75 to newValue
   put newValue into field "PlaySpeed"
   set the playRate of player "MovieScreen" to newValue  
   
  if WhatIs = "true" then                      --Added this
      play pause videoClip "MovieScreen"
   else
      play videoClip "MovieScreen"
   end if
   
end scrollbarDrag

Posted: Thu Oct 30, 2008 6:51 pm
by Klaus
Hi Ron,

please don't mix players with "play videoclip"!
May cause unexspected results :-)

See the docs for "play videoclip".

Use "start/stop player X" instead.

Code: Select all

...
  if WhatIs = "true" then                      --Added this 
      stop player "MovieScreen" 
   else 
      start player "MovieScreen" 
   end if 
...
Problem is that setting the playrate of a player object to any value but 0 will immediately start that player.


Best

Klaus