Page 1 of 1
Stop player: pause the player and doesn't fire playStopped
Posted: Fri Apr 25, 2025 11:45 am
by trevix
Hello. Thanks for any help on this.
I have a Player, on OSX IDE, which should fire "playStopped" at the end of the video or if the user clicks on it (controls are hidden).
While everything is fine at the end of the video, clicking on the player instead put it on pause and, off course, does not fire "playStopped".
This is the player script
Code: Select all
on mouseDown
stop player "ThePlayer"
put the paused of player "ThePlayer" & cr after msg
end mouseDown
EXPECETD RESULT: should get "false" on the msg and the "playStopped" command, placed on the card, should fire.
OBTAINED RESULT: I get "true" on the msg and the "playStopped" command is not fired.
What am I missing?
Re: Stop player: pause the player and doesn't fire playStopped
Posted: Fri Apr 25, 2025 6:12 pm
by stam
I might be completely wrong here, but my impression is that if pausing you should check the playPaused and if stopping you should check the playStopped of the player.
Not sure if stopping the player you should check the playPaused of the player. I suspect you meant to say playStopped?
Perhaps check both the playPaused and the playStopped of the player?
S.
Re: Stop player: pause the player and doesn't fire playStopped
Posted: Fri Apr 25, 2025 6:23 pm
by stam
Further to this I happen to be working on an app for medical imaging right now and checked this (it was on my to-do list

Seems the documentation on playPaused/playStopped isn't really correct.
So far, the 'pause' command doesn't seem to do anything, while the 'stop' command does. Checking the "paused" or the playPaused of the movie does not seem to do anything.
What did work was:
Code: Select all
stop player "movie"
if the paused of player "movie" then answer "stopped" --> answer dialog pops up
So none of my previous post is correct (and unless I greatly misread the documentation, much of that isn't correct either...)
Putting the paused, the stopped, the playPaused, the playStopped into the messageBox does nothing, it does not seem to return a value as such, but you can do boolean operations with it like in the example above... not sure I understand that tbh...
Re: Stop player: pause the player and doesn't fire playStopped
Posted: Sat Apr 26, 2025 9:10 am
by trevix
stam wrote: ↑Fri Apr 25, 2025 6:12 pm
I might be completely wrong here, but my impression is that if
pausing you should check the
playPaused and if
stopping you should check the
playStopped of the player.
Not sure if stopping the player you should check the playPaused of the player. I suspect you meant to say
playStopped?
Perhaps check both the
playPaused and the
playStopped of the player?
S.
Thanks for answering.
What I was trying to do was to be able to stop the player with a mouse click.
I was assuming that, as from the dictionary, the "stop player" would stop the video and, after that, the "playStopped" command would fire (in order to move to the next card or else).
What I found was that the "Stop player" command actually pauses the video. It doesn't stop it.
(The "put the paused of player "ThePlayer" & cr after msg" was just used to check if the video was stopped or paused).
At the end, I can easily solve my problem firing the playStopped from the mousedown code, but I cared to understand if it was another LC bug or was it me.
Thanks anyway.
Re: Stop player: pause the player and doesn't fire playStopped
Posted: Sat Apr 26, 2025 5:12 pm
by jacque
As you noticed, playStopped is only sent when the media reaches the end. It should probably have been called playEnded. You could change the card handler to trap playPaused instead.