Control of Video player

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

Control of Video player

Post by Ron Zellner » Thu Oct 30, 2008 4:15 pm

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?

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

I think I solved it

Post by Ron Zellner » Thu Oct 30, 2008 5:01 pm

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

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Thu Oct 30, 2008 6:51 pm

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

Post Reply