Play movie automatically

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Es124
Posts: 26
Joined: Sat Apr 30, 2011 3:48 pm

Play movie automatically

Post by Es124 » Sun Aug 21, 2011 11:25 am

Hi,

how do i let a movie ( mov. file ) start automatically when i go to that specific card ? ( without using the play buttom )

thanks,
Enno

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Play movie automatically

Post by jmburnod » Sun Aug 21, 2011 12:16 pm

Hi Enno,

You can play it at opencard like this :

Code: Select all

on opencard
   start player "myPlayer"
end opencard
Best regards

Jean-Marc
https://alternatic.ch

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Play movie automatically

Post by kevin11 » Sun Aug 21, 2011 5:05 pm

I have tried to use "start player whatever", with a .mov file loaded and visible on a card.
It doesn't however play, just sits there at the first frame. I can use the cursor to drag through the frames, which tells me the .mov is loaded correctly, it displayers correctly, I just can't get "start player" to do anything.

Any ideas anyone please ?

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

Re: Play movie automatically

Post by Klaus » Sun Aug 21, 2011 5:29 pm

Hi Kevin,

this should work in any case!

Can you start the player with the (QuickTime) controller?
Does it work, when you put the script into a button:

Code: Select all

on mouseup
  start player XYZ
end mouseup
and click the button?
Do you have anything else in your "opencard" script?


Best

Klaus

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Play movie automatically

Post by kevin11 » Mon Aug 22, 2011 12:25 am

using a new card, your script, and a player named to match, won't play the movie atomatically.
It will allow me to cycle through frames by dragging the mouse.
The controller has no play button, just back, zoom out, zoom in, and zoom dragged object.

In edit mode, I can change the animation speed and the movie will play at different speeds, but in browse mode it won't play. Answer statements in scripts tell me the code is executing.

basically, the animation plays in edit mode, but in bwose mode there is no play button, and you can't trigger playing.

using livecode 4.6.3 on windows xp sp2

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

Re: Play movie automatically

Post by Klaus » Mon Aug 22, 2011 11:12 am

Hi Kevin,

could you please answer my questions abvove?

And:
Is QuickTime in the latest version installed on that machine?
What file format does the movie have?
Could you post a screenshot eventually?

This is whart is puzzling me:
The controller has no play button, just back, zoom out, zoom in, and zoom dragged object.
Ah, wait, is this a QuickTIme VR movie?
If yes this is not intended to "play" in any way, you need to script this!
Check "pan" and "tilt" in the LiveCode dictionary!


Best

Klaus

Es124
Posts: 26
Joined: Sat Apr 30, 2011 3:48 pm

Re: Play movie automatically

Post by Es124 » Mon Aug 22, 2011 11:50 am

Hi,

i try
on opencard
start player "Player"
end opencard

but it's just play when i push the play buttom, also when i test it on the IOS simulator, the card with the movie is grey . ( no movie )

see pict.
Attachments
Schermafbeelding 2011-06-25 om 12.45.26.jpg

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

Re: Play movie automatically

Post by Klaus » Mon Aug 22, 2011 12:00 pm

Hi Es124,

thanks for the screenshot, it clarifies things!

1. a player does NOT get the "opencard" message (as the name might suggest!),
so you need to put this handler into the script of the CARD! That will work!

2. playback of video is completely different on iOS than on the desktop!
Please check the "iOS Release Notes" (menu: Help) for more info.


Best

Klaus

Es124
Posts: 26
Joined: Sat Apr 30, 2011 3:48 pm

Re: Play movie automatically

Post by Es124 » Mon Aug 22, 2011 12:40 pm

Hi Klaus,

Yes ! it works now, thanks .

So if i want to play the movie's on different devices ( iPad, iPhone, Android tablet, Android phone , windows and Mac ) it will be always different.

greetings,
Enno
Belgium

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

Re: Play movie automatically

Post by Klaus » Mon Aug 22, 2011 12:46 pm

Hi Enno,
So if i want to play the movie's on different devices ( iPad, iPhone, Android tablet, Android phone , windows and Mac ) it will be always different.
Yes, unfortunately!
Although I am not sure if Android and iOS have different syntax for this.

But you can check "the platform" to act accordingly:

Code: Select all

...
put the platform into tPlat
switch tPlat
  case "MacOS"
  case "Win32"
    ## Desktop
    start player "player
  break
  case "mobile"
   ## do your mobile stuff here
  break
   ### etc...
end switch
...
Groetjes

Klaus

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Play movie automatically

Post by kevin11 » Mon Aug 22, 2011 2:39 pm

Hi Klaus,

>could you please answer my questions abvove?

I believe I did, above ! ???

Your script does not activate the player.
It's a brand new card, as I said, and therefore there is no other script on the card.
The qt controller, although visible, has no play button, only back, zoom, etc, so cannot play from the controller.
The mouse only allows me to drag through frames, it does not start playing.
A mouse click does not start the animation.
The script does not start the animation.

"start player ZYX" or whatever the player name is, does not start the animation.

Livecode appears to be complete unable to play this animation.

However, if I use the inspector to change the loop speed, it will play through the loop when in edit-mode, each time I change the speed setting.

There is nothing that can be done to make the animation play in browse mode, but it seems happy in edit mode.

Regards

Kevin

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

Re: Play movie automatically

Post by Klaus » Mon Aug 22, 2011 2:58 pm

Hi Kevin,

yes, please forget the lines BEFORE I found that this may be a QT VR movie :)

Just tested this here with a QT VR and it works as exspected:
NO automatic animation!

QT VR movies do not "play" in any way, they are supposed to be user-controlled!
So they can be "start"ed, but this does not do anything until the user moves the mouse inside of the VR movie!
Open it in the QuickTime Movie Player and see yourself!

So if you want any animation, you need to script it!
As I already mentioned, check "tilt", "pan" and "zoom" in the liveCode dictionary!


Best

Klaus

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Play movie automatically

Post by kevin11 » Mon Aug 22, 2011 3:51 pm

Hi Klaus,

>QT VR movies do not "play" in any way, they are supposed to be user-controlled !

Yes, of course, I knew this all along, I was just testing you. :oops:

Seriously, thanks, this puts my mind at rest.

Regards

Kevin

kevin11
Posts: 101
Joined: Thu Aug 11, 2011 5:02 pm

Re: Play movie automatically

Post by kevin11 » Mon Aug 22, 2011 3:58 pm

Hello again,

Actually, I was thinking it would behave more like the html equivalent :

EMBED src="anisamples/AEA_0090.mov" AUTOSTART="true"

which of course plays the animation in a browser, and is what we do with our animation samples on our website. Once the animation is loaded, it plays, without requiring the user to click on a play button. Not sure why livecode doesn't support this....?

Kevin

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

Re: Play movie automatically

Post by Klaus » Mon Aug 22, 2011 4:24 pm

Hi Kevin,

you can of course use an iOS "browser" object to display your movie, if that works for you!
Check the release notes!


Best

Klaus

Post Reply