Android Video Player

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
burkec
Posts: 9
Joined: Fri Jun 22, 2018 3:48 pm

Android Video Player

Post by burkec » Thu Sep 20, 2018 11:00 am

Hi all,
I'm back again. I need to have a player on my App that I'm moving from Windows/Mac deployment. I know how to play a movie file "embedded" in the bundle. However, I need the user to be able to select a movie on their mobile device (testing on Samsung Galaxy 10) to play. I cannot see how to do this anywhere (please forgive me if I've missed it :o )!
I've attached a screen shot of the app. It's pretty simple. Basically, the user can select a movie to play and while it's playing they can press the buttons. These are coded and write to a text file. The user then copies the results text off their device.
Any help greatly appreciated.
Thanks,
Colin
Attachments
Screen Shot 2018-09-20 at 10.57.05.png

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android Video Player

Post by Klaus » Thu Sep 20, 2018 11:23 am

Hi Colin,

due to "sanboxing" there is no "answer file..." or something like that on the mobile platform!
And we cannot fake this somehow or "roll our won".

We can e.g. use "mobilepickmedia" and only access all the supported specialfolderpath() on Android.


Best

Klaus

burkec
Posts: 9
Joined: Fri Jun 22, 2018 3:48 pm

Re: Android Video Player

Post by burkec » Thu Sep 20, 2018 2:06 pm

Hi Klaus,
Thanks for responding to one of my queries (yet again :wink: ). I have to say that I'm really disappointed that this is not possible :(
I thought I could even try to see if it was possible to allow the users copy their movie clips to the specialpathfolder documents and resources, and they must use the same filename each time eg "testmovie.mp4". Then in my app can" put specialFolderPath("documents or resources") & "/testmovie.mp4" into VideoFile" and play it? This way they could copy the files one at at time and carry out the testing on the video and extract their txt file. Unfortunately this does not work either way (resources or documents) :(
Is there anything else you could suggest before I admit defeat? I developed the program years ago for PC/Mac (and it's used all over) and would hate to go back to the academic now with a no....AND we spent a grand on updating Livecode to do it :roll:
Cheers,
Colin

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android Video Player

Post by Klaus » Thu Sep 20, 2018 3:07 pm

Hi Colin,

sorry, I do not own any mobile device, no tablet or cell-phone, yes, that's me, so I don't know much about the "guts" of the Android file-system. However I doubt that your users can copy anything into the documents or resources folder inside of your app.

Hope others will chime in soon...


Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Video Player

Post by jacque » Thu Sep 20, 2018 6:08 pm

I haven't tried this at all, so you're on your own, but I have a theoretical solution. There is a specialFolderPath("external documents") that accesses files outside the sandbox. You could use "the files" to get a list of available files from that location and display them in your app. When the user selects one, rebuild the file name using that specialFolderPath as the root location.

The downside is that files may be inside other folders and you'd basically need to write your own interface to display the file structure. But try it and see what you get. I've meant to explore this for a while but there's never enough time.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Mon Jul 31, 2006 1:39 am
Location: New Zealand, Australia, Germany, Japan
Contact:

Re: Android Video Player

Post by strongbow » Fri Sep 21, 2018 6:06 am

Could you import the video from Dropbox?

If it was on iOS you could prob use mergAV (I think).

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Android Video Player

Post by JereMiami » Thu Jun 02, 2022 9:24 pm

Curious if this was ever resolved. Still no way to select video either via mobilePickPhoto or mobilePickMedia?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Video Player

Post by jacque » Fri Jun 03, 2022 6:22 pm

I just did a quick test. MobilePickMedia works on Android 8 as long as I choose a file in a publicly accessible folder (I chose an mp3 in the system Music folder.) It does not work in Android 12.

This probably needs a bug report.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Android Video Player

Post by JereMiami » Sat Jun 04, 2022 8:43 am

Thanks Jacque

It works on my end for mp3 too, but it shades out videos such as mp4s (mobilepickphoto) or simply does not include mp4s (mobilepickmedia). My thought was maybe there is a workaround, such as obtaining the file path for a jpeg located on internal storage or external storage and then using the launch command using a modified file path to get to the (e.g. phone/..../videos) video location.

Do you think there is a way to obtain the file path from mobilepickphoto to access the video folder?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Video Player

Post by jacque » Sat Jun 04, 2022 8:09 pm

Mp4 files are dimmed on my phone too. It does sound like you should submit a bug report, since "media" should return all types of media, not just audio files.

You might be able to construct a file path based on a known file, provided you can work out whether your target video is in the folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”