about movie player on iOS and Android
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
about movie player on iOS and Android
hello,
I read somewhere that we could not play a video sequence in a stack or application intended to be used on iOS or Android.
Can anyone confirm or deny this?
On Macs or PC, I create a stack in LiveCode creates a video player by depositing the control for this purpose on the card from the stack and adds buttons and scripts to active or desactive the player.
if it works what video formats mov, avi, mp4 etc ..
Same question for the sound player , and the display of a web browser
on iOS or android?
Should we store the media on the server, download them to the mobile
-in the installation package of the application or at the first execution of the application.
thanks for your answers
I read somewhere that we could not play a video sequence in a stack or application intended to be used on iOS or Android.
Can anyone confirm or deny this?
On Macs or PC, I create a stack in LiveCode creates a video player by depositing the control for this purpose on the card from the stack and adds buttons and scripts to active or desactive the player.
if it works what video formats mov, avi, mp4 etc ..
Same question for the sound player , and the display of a web browser
on iOS or android?
Should we store the media on the server, download them to the mobile
-in the installation package of the application or at the first execution of the application.
thanks for your answers
Re: about movie player on iOS and Android
Hi Fred,
1. welcome to the forum!
2. If you mean that we cannot play IMPORTED (into the stack) audio and video files on mobile,
that is true unfortunately.
On Windows Livecode still requires QuickTime to be installed on the target PC for multimedia playback.
Please check the dictionary for "dontuseqt", but I never could make multimedia work satisfyingly on Windows
without Quicktime!
And yes, on the desktop we can (pre-) create a "player" object and use it alter (set filename etc.)
On the mobile platform we need to create "native" objects on-the-fly, see "mobilecreate" in the dictionary.
Providing media with your standalone:
Even on the desktop it is a good idea to provide media files outside of the stack, since Livecode will
always load the complete stack (WITH eventual imported audio/video clips) into memory and that can
sum up with lots of video/audio files.
For this purpose you can add your (folders with) mediafiles via the "Copy files..." tab in the standalone
builder settings. Then you can access them in your standalone here -> specialfolderpath("resources")
This is the same for desktop and mobile.
Hope that helps, please don't hesitate to ask question as they arise, and they will!
Here some great learning resources for the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
1. welcome to the forum!

2. If you mean that we cannot play IMPORTED (into the stack) audio and video files on mobile,
that is true unfortunately.
On Windows Livecode still requires QuickTime to be installed on the target PC for multimedia playback.
Please check the dictionary for "dontuseqt", but I never could make multimedia work satisfyingly on Windows
without Quicktime!
And yes, on the desktop we can (pre-) create a "player" object and use it alter (set filename etc.)
On the mobile platform we need to create "native" objects on-the-fly, see "mobilecreate" in the dictionary.
Providing media with your standalone:
Even on the desktop it is a good idea to provide media files outside of the stack, since Livecode will
always load the complete stack (WITH eventual imported audio/video clips) into memory and that can
sum up with lots of video/audio files.
For this purpose you can add your (folders with) mediafiles via the "Copy files..." tab in the standalone
builder settings. Then you can access them in your standalone here -> specialfolderpath("resources")
This is the same for desktop and mobile.
Hope that helps, please don't hesitate to ask question as they arise, and they will!

Here some great learning resources for the very basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: about movie player on iOS and Android
my question how to play a movie or sound in a livecode stack on mobile platform iOS or android ?
i want to renew my license for livecode (in 7 or
, but if i can't create a player for my customers movie (or all available movie on internet) or sound the product isn't the good tool.
i want to renew my license for livecode (in 7 or

Re: about movie player on iOS and Android
Hi Fred,
you're welcome!
On mobile you can use (examples from the dictionary):
...
put specialFolderPath("engine) & "/intro_movie.mp4" into tVideoFile
play video tVideoFile
...
play video "http://www.livecode.com/buildanapp.mp4"
...
Or, for having more control over the player, you can create a native mobile video player object with:
...
mobileControlCreate "player", "your_video_player"
## and then set a lot of properties to fit your needs...
## see the dictionary for "mobilecontrolcreate"!
...
Best
Klaus
you're welcome!

On mobile you can use (examples from the dictionary):
...
put specialFolderPath("engine) & "/intro_movie.mp4" into tVideoFile
play video tVideoFile
...
play video "http://www.livecode.com/buildanapp.mp4"
...
Or, for having more control over the player, you can create a native mobile video player object with:
...
mobileControlCreate "player", "your_video_player"
## and then set a lot of properties to fit your needs...
## see the dictionary for "mobilecontrolcreate"!
...
Best
Klaus
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
can you please give me an example? I still don't understand with your code
Re: about movie player on iOS and Android
Please stick to ONE posting for one problem, thank you!maulinarmananda wrote:can you please give me an example? I still don't understand with your code
http://forums.livecode.com/viewtopic.php?f=53&t=13231
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
what if I put these code?
put specialFolderPath("engine") & "/video/myVideo.m4a" into tVidFile
mobileControlCreate "player", "myPlayer"
put the result into sPlayerID -- save the control id
mobileControlSet sPlayerID, "filename", tVidFile
mobileControlSet sPlayerID, "visible", true
mobileControlSet sPlayerID, "rect", "100,50,820,350"
mobileControlSet sPlayerID, "showController", true
mobileControlSet sPlayerID, "preserveAspect", true
I tried to put this on my card. when I save as standalone for android, video doesn't show, there's only rectangle come up.
How to fix this problem? and where should I put the right code? thank you
put specialFolderPath("engine") & "/video/myVideo.m4a" into tVidFile
mobileControlCreate "player", "myPlayer"
put the result into sPlayerID -- save the control id
mobileControlSet sPlayerID, "filename", tVidFile
mobileControlSet sPlayerID, "visible", true
mobileControlSet sPlayerID, "rect", "100,50,820,350"
mobileControlSet sPlayerID, "showController", true
mobileControlSet sPlayerID, "preserveAspect", true
I tried to put this on my card. when I save as standalone for android, video doesn't show, there's only rectangle come up.
How to fix this problem? and where should I put the right code? thank you
Re: about movie player on iOS and Android
.m4a is an audio codec, no video in it!?
It stands for MPEG4 Audio, so what do you exspect?
It stands for MPEG4 Audio, so what do you exspect?
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
I mean mp4. It still not working
Re: about movie player on iOS and Android
Ah, OK
So you added the folder "video" inclusive content to your standalone
via the "Copy files" tab in the standalone builder settings?
Add this line (maybe in a separate button?) to see if the video is really present in your standalone:
...
put specialFolderPath("resources") & "/video/myVideo.m4a" into tVidFile
answer (there is a file tVidFile)
## Should display TRUE if video is present
...

So you added the folder "video" inclusive content to your standalone
via the "Copy files" tab in the standalone builder settings?
Add this line (maybe in a separate button?) to see if the video is really present in your standalone:
...
put specialFolderPath("resources") & "/video/myVideo.m4a" into tVidFile
answer (there is a file tVidFile)
## Should display TRUE if video is present
...
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
so,first I have to create player on my card, then put the code on player or on my card?
I get a bit confuse here. Can you give me all lines of the code?
I had put my video files in "copy files" but still nothing works.
and here is my code that I put in my card.
on openCard
if the environment = "mobile" then
put specialFolderPath("engine") & "/qtimun.mp4" into tVidFile
mobileControlCreate "player", "myPlayer"
put the result into sPlayerID -- save the control id
mobileControlSet sPlayerID, "filename", tVidFile
mobileControlSet sPlayerID, "visible", true
mobileControlSet sPlayerID, "rect", "30,32,414,330"
mobileControlSet sPlayerID, "showController", false
mobileControlSet sPlayerID, "preserveAspect", false
--mobileControlDo "myPlayer", "play"
--mobileControlDo "myPlayer", "pause"
end if
end openCard
mobileControlSet sPlayerID, "visible", false
on closeCard
end closeCard
is there something wrong?
I get a bit confuse here. Can you give me all lines of the code?
I had put my video files in "copy files" but still nothing works.
and here is my code that I put in my card.
on openCard
if the environment = "mobile" then
put specialFolderPath("engine") & "/qtimun.mp4" into tVidFile
mobileControlCreate "player", "myPlayer"
put the result into sPlayerID -- save the control id
mobileControlSet sPlayerID, "filename", tVidFile
mobileControlSet sPlayerID, "visible", true
mobileControlSet sPlayerID, "rect", "30,32,414,330"
mobileControlSet sPlayerID, "showController", false
mobileControlSet sPlayerID, "preserveAspect", false
--mobileControlDo "myPlayer", "play"
--mobileControlDo "myPlayer", "pause"
end if
end openCard
mobileControlSet sPlayerID, "visible", false
on closeCard
end closeCard
is there something wrong?
Re: about movie player on iOS and Android
The path should be:
put specialFolderPath("resources") & "/qtimun.mp4" into tVidFile
Files in the Copy Files pane of the standalone settings are no longer stored in the engine folder.
put specialFolderPath("resources") & "/qtimun.mp4" into tVidFile
Files in the Copy Files pane of the standalone settings are no longer stored in the engine folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
waw thank you so much. it works! 
But I have one problem, when I click back button (go to the prev card), my video is still on the screen, doesn't want to go. How do I fix it?

But I have one problem, when I click back button (go to the prev card), my video is still on the screen, doesn't want to go. How do I fix it?
Re: about movie player on iOS and Android
If you go back and read Klaus' reply, he suggested the same specialFolder. 
You need to delete all instances of mobile controls on closeCard, and recreate them on openCard. Mobile controls are not card objects, they are drawn on top of the stack and you have to manage them yourself.

You need to delete all instances of mobile controls on closeCard, and recreate them on openCard. Mobile controls are not card objects, they are drawn on top of the stack and you have to manage them yourself.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 14
- Joined: Thu Mar 24, 2016 12:13 pm
Re: about movie player on iOS and Android
waw thank you 
but can we play video on android fullscreen?

but can we play video on android fullscreen?