Android Video Player - cannot get it to work
Posted: 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). 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. I would really appreciate if someone can point out where I am going wrong.
Col
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). 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. I would really appreciate if someone can point out where I am going wrong.
Col