Card wont refresh after video plays
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Card wont refresh after video plays
My Script
on mouseUp
show player "happy"
play video "/happy/ht/happy.mov"
hide player "happy"
end mouseUp
Problem: After the video plays the last frame stays on the screen , and the card does not refresh, unless you start clicking around.
Is there a way to make the video completely go away after playing?
Max
on mouseUp
show player "happy"
play video "/happy/ht/happy.mov"
hide player "happy"
end mouseUp
Problem: After the video plays the last frame stays on the screen , and the card does not refresh, unless you start clicking around.
Is there a way to make the video completely go away after playing?
Max
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Card wont refresh after video plays
maxs..
use the 'playerFinished' message...
Dixie
use the 'playerFinished' message...
Code: Select all
on mouseUp
show player "happy"
play video "/happy/ht/happy.mov"
end mouseUp
on playerFinished
hide player "happy"
end playerFinished
Re: Card wont refresh after video plays
Thanks Dixie,
It don't seem to work on the Mac. playerFinished doesn't get called. In the documentation, playerFinished says it is supported on ios and Android only.
Any Mac solution?
Max
It don't seem to work on the Mac. playerFinished doesn't get called. In the documentation, playerFinished says it is supported on ios and Android only.
Any Mac solution?
Max
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Card wont refresh after video plays
Maxs...
You posted in the 'Rich Media' section of the forum so I assumed you were working on the desktop... the 'player finished' message does get sent under iOS but you will have to display your movie using a 'MPMoviePlayerController' control, not a player from the liveCode 'tool palette' in the IDE.
However, my apologies... it would have been 'playerStopped' message that would have helped on the desktop...
be well
Dixie
You posted in the 'Rich Media' section of the forum so I assumed you were working on the desktop... the 'player finished' message does get sent under iOS but you will have to display your movie using a 'MPMoviePlayerController' control, not a player from the liveCode 'tool palette' in the IDE.
However, my apologies... it would have been 'playerStopped' message that would have helped on the desktop...
be well
Dixie
Re: Card wont refresh after video plays
Hi Max,
sounds like the video does NOT actually play in the player!
"play videoclip XYZ" does NOT use the player object on the desktop
and will leave an image of the last frame on the screen!
Check the dicionary for "play videoclip".
Try this (desktop only, mobield needs another syntax!):
Best
Klaus
sounds like the video does NOT actually play in the player!
"play videoclip XYZ" does NOT use the player object on the desktop
and will leave an image of the last frame on the screen!
Check the dicionary for "play videoclip".
Try this (desktop only, mobield needs another syntax!):
Code: Select all
on mouseUp
show player "happy"
set the filename of player "happy" to "/happy/ht/happy.mov"
START player "happy"
end mouseUp
on playstopped
set the filename of player "happy" to empty
hide player "happy"
end playstopped
Klaus
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Card wont refresh after video plays
Klaus...
Oh Yes !... That will teach me to read posts a little more carefully before I reply..
Dixie
Oh Yes !... That will teach me to read posts a little more carefully before I reply..
Dixie
Re: Card wont refresh after video plays
Yahooo! It works.
Thanks Klaus and Dixie.
I had to put "Playstopped" into the script of the player to make it work.
And play videoclip and start player are 2 different things.
Max
Thanks Klaus and Dixie.
I had to put "Playstopped" into the script of the player to make it work.
And play videoclip and start player are 2 different things.
Max
Re: Card wont refresh after video plays
The release notes for ios do not tell exactly how to call MPMoviePlayerController. (Am I mistaken?)
How do I actually play a movie in IOS?
Max
How do I actually play a movie in IOS?
Max
Re: Card wont refresh after video plays
My movies play on the simulator fine, but it appears I need to use MPMoviePlayerController to play on an actual ipad. Max
Re: Card wont refresh after video plays
Hi Max,
if you do not post to the correct forum, yes we have a dedicated iOS forum here, you should at least
note what platform your are targeting, would save a lot of our time
Check e.g. "Video playback support" in the "iOS Release Notes"
Do this to play a video WITH controller:
...
set the showController of the templatePlayer to TRUE
play video "happy path/here..."
## Hint this will play the video FULLSCREEN
...
If you need more control over the playback you should look up "Player control – MPMoviePlayerController."
in the Release Notes. That will require some scripting however.
Best
Klaus
if you do not post to the correct forum, yes we have a dedicated iOS forum here, you should at least
note what platform your are targeting, would save a lot of our time
Check e.g. "Video playback support" in the "iOS Release Notes"
Do this to play a video WITH controller:
...
set the showController of the templatePlayer to TRUE
play video "happy path/here..."
## Hint this will play the video FULLSCREEN
...
If you need more control over the playback you should look up "Player control – MPMoviePlayerController."
in the Release Notes. That will require some scripting however.
Best
Klaus
Re: Card wont refresh after video plays
This post describes my problem. I want to launch the main stack of my desktop application using a standalone named "launcher" as a splash screen. I am using the method prescribed in an online LC lesson. My standalone just has a player object and the following stack script:
The movie plays as intended from beginning to end. The LC Dictionary says "playerfinished" is sent when the content has finished playing," whereas regarding "playerstopped" it says "sent when the user exits playing." Since I want the 5-second movie to play from beginning to end automatically without user intervention, I use "playerfinished."
But neither the "playerstopped" nor "playerfinished" seems to be sent to the stack. The second handler does not run. Nothing visible happens. I just see what I hope is the last frame of the movie. Is the problem the .mp4 format of my movie? Windows? (I am in using the IDE on a Windows 10 platform.) Wrong code? The movie doesn't actually finish? Something else?
Thanks for any suggestion(s).
Monty
Code: Select all
on openstack
set the filename of player "player" to "filepath/movie.mp4">
start player "player"
end openstack
on playerfinished
open stack "main application"
close stack "launcher"
end playerfinished
But neither the "playerstopped" nor "playerfinished" seems to be sent to the stack. The second handler does not run. Nothing visible happens. I just see what I hope is the last frame of the movie. Is the problem the .mp4 format of my movie? Windows? (I am in using the IDE on a Windows 10 platform.) Wrong code? The movie doesn't actually finish? Something else?
Thanks for any suggestion(s).
Monty
Re: Card wont refresh after video plays
Hi Monty,
playerstopped and playerfinished are only for MOBILE, for desktop you need to catch the
-> playstopped message. Check the dictionary for further infos!
This should do the trick:
Best
Klaus
playerstopped and playerfinished are only for MOBILE, for desktop you need to catch the
-> playstopped message. Check the dictionary for further infos!
This should do the trick:
Code: Select all
on openstack
set the filename of player "player" to "filepath/movie.mp4">
start player "player"
end openstack
on playstopped
open stack "main application"
close stack "launcher"
end playstopped
Klaus
Re: Card wont refresh after video plays
Thanks, Klaus, for your reply. I made the change in the code and it worked. The second thing I learned is when using the LC dictionary to notice for which platform the message is intended. Sometimes there is no clue in the body of the entry. The reader has to look at the first line of the book entry or the fifth or sixth line of the online dictionary.
Monty
Monty