Android Video Player - cannot get it to work

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
col
Posts: 2
Joined: Tue Oct 02, 2018 5:03 am

Android Video Player - cannot get it to work

Post by col » Wed Oct 03, 2018 2:07 am

I have tried many things to get a video playing in an Android app. I found some code on StackOverflow which looked promising and I have been trying to get that working. I am a newbie to LiveCode so I am sure I am just doing something basically wrong.

I am using LiveCode version 9.0.1.

I have added the code below to a button and when running on BlueStacks emulator, a black rectangle is created but the video does not play.

This is the code for the button:

on mouseUp
lock screen
mobileControlCreate "player","videoControl"
mobileControlSet "videoControl","filename",(specialFolderpath("engine") & "/test.mp4")
mobileControlSet "videoControl","preserveAspect",true
mobileControlSet "videoControl","showController",true
mobileControlSet "videoControl","visible",true
mobileControlSet "videoControl","rect","50,50,720,405"
mobileControlDo "videoControl","play"
unlock screen
end mouseUp

I have included the test.mp4 file in the Copy Files tab of the Standalone Application Settings (see attachment).
CopyFilesDialog.jpg
Under the Android tab of the Standalone Application Settings I have selected "Signing: Sign for development only". Could that be an issue?

When I install and run the app on BlueStacks the navigation buttons and other objects all operate as expected (buttons, cards etc).

I have attached two other screen shots to show the navigation screen for the app and the result I get when I press the button.
NavigationCard.jpg
AfterMouseUp_Showing_Video_player.jpg
I would really appreciate if someone can point out where I am going wrong.

Col

col
Posts: 2
Joined: Tue Oct 02, 2018 5:03 am

Re: Android Video Player - cannot get it to work

Post by col » Wed Oct 03, 2018 9:45 am

I got it working on the emulator but installation on a Samsung Tab S2 (running Android version 7.0) would not play.

The mp4 just does not play - I substituted an mov version of the movie and it worked without problem (using the BlueStacks emulator).

Anyway, I am happy to make progress. If anyone has any suggestions why it won't play on the tablet your suggestions would be welcomed. The rest of the app works OK.

Update:

I have created a certificate and have managed to install the app on a Galaxy S9+ (running Android version 8.0.0). The app runs but the video will still not play. The same version of the app works fine on the BlueStacks emulator. The video plays and the video controls work as expected.

Post Reply

Return to “Android Deployment”