Page 1 of 1

Android player controls disappear

Posted: Thu Oct 12, 2017 1:59 pm
by jim1001
I’m playing some audio on Android using the mobileControlSet “player”. Yes, I know there are other ways of playing mobile audio but I’d like to get this way to work better.

I find that player controls disappear when the media has stopped playing leaving a black rectangle. Clicking on the black rectangle brings them back (with video, the video remains visible but the controls still disappear)

Is this well known & is there an elegant solution that may be more obvious to a user?

The best I have up to now is a button to the right of the player which when clicked does a

Code: Select all

mobileControlSet <playerID>, "showController", true
- this also brings the controls back.

I’ve tried handling the the playerFinished message on its card script with the above command but the message doesn’t seem to fire. (aside: the dictionary says playerFinished is for ios & android whereas playerStopped is only for ios)

Thanks for any replies.

Re: Android player controls disappear

Posted: Thu Mar 22, 2018 6:59 pm
by Volkmar
Hello,

I have a simular topic.

I put the player into the card of the livecode application.
Afterwards i try the function of the player in the LiveCode application and it is all ok.
If I create a standalone application "apk" for android. The player isn't shown and have also no function. Only the border of the player is shown.(see picture)

Do you know the mistake?

Thanks a lot
Volkmar

Re: Android player controls disappear

Posted: Thu Mar 22, 2018 7:10 pm
by Klaus
Hallo Volkmar,

the answer is simple (as the Dictionary clearly shows, HINT, HINT):
PLAYER objects are not supported on iOS and Android!

Use something like this to play a video.
If you added the video in the standalone builder settings via the "Copy files" tab, you will find all these files and folder in -> specialfolderpath("resources")
...
put specialfolderpath("resources") & "/your video file here.mp4" into tVideoFile
play video tVideoFile
...

Or, the longer way, create a native videoplayer object on the fly with:
...
mobileControlCreate "player", "YourPlayer"
mobileControlSet "YourPlayer", "visible", true
## Check the video first to get its dimensions, you need to supply them here:
mobileControlSet "YourPlayer", "rect", "50,50,500,500"
mobileControlSet "YourPlayer", "filename",specialfolderpath("resources") & "/your video file here.mp4"
mobileControlDo "YourPlayer", "play"
...

Best

Klaus

P.S.
Volkmar sounds german :-), if you ARE in fact german, we also have a german LC forum here:
http://www.livecode-blog.de/forums/foru ... ode-forum/

Re: Android player controls disappear

Posted: Thu Mar 22, 2018 7:37 pm
by Volkmar
Thanks a lot for the quick response :D