Page 1 of 1

Video on Android

Posted: Thu Dec 04, 2014 3:56 pm
by joel.epsteinBUS31vi
Hi all -

I'm totally stumped and would appreciate any advice you might have. I'm using LiveCode 7.01rc2.

This code:

Code: Select all

on openCard
   if the environment = "development" then exit openCard
   if "mobilecontrol" is among the lines of mobileControls() then
      controlDelete
   end if   
   mobileControlCreate "player", "videoControl"
   mobileControlSet "videoControl", "filename", specialFolderPath("engine") & "/movies/small.wmv"
   mobileControlSet "videoControl", "showController", true
   mobileControlSet "videoControl", "visible", true
   mobileControlSet "videoControl", "rect", "0,0,1104,621"
   mobileControlSet "videoControl", "backgroundColor", "0,0,0,25"
   mobileControlDo "videoControl", "play"
end openCard
is working perfectly on my Samsung Galaxy 5 but nothing plays on my Nexus 7. I've used "the files" to check to verify that the file actually has been copied to the device and it has. It just isn't playing.

I'm hoping I'm missing something very basic.

Please let me know if you can think of what I might do to get the video playing on bot devices.

Thanks so much.

Joel

Re: Video on Android

Posted: Thu Dec 04, 2014 4:38 pm
by sefrojones
I've read that Nexus 7 devices have trouble with .wmv files. Have you tried converting it to a different format?

Re: Video on Android

Posted: Thu Dec 04, 2014 7:28 pm
by joel.epsteinBUS31vi
Fantastic! Thanks for your speedy and helpful reply.

I converted to .mp4 and the movie now plays on both devices (and iOS as well).

Thanks so much.

Joel

Re: Video on Android

Posted: Thu Mar 24, 2016 12:38 pm
by maulinarmananda
do you have to create player first, or just let the code on your card script?

I dont know how to put the code

Re: Video on Android

Posted: Fri Mar 25, 2016 2:37 am
by joel.epsteinBUS31vi
It's super easy. Take a look at the code above. Just paste that into your card script and change relevant variables. It will automatically create a native player on your card.

Let me know how it goes.

Joel

Re: Video on Android

Posted: Fri Mar 25, 2016 4:47 am
by maulinarmananda
still nothing works :(

here is my code
on openCard
if the environment = "development" then exit openCard
if "mobilecontrol" is among the lines of mobileControls() then
controlDelete
end if
mobileControlCreate "player", "videoControl"
mobileControlSet "videoControl", "filename", specialFolderPath("engine") & "/qtimun.mp4"
mobileControlSet "videoControl", "showController", true
mobileControlSet "videoControl", "visible", true
mobileControlSet "videoControl", "rect", "70,72,,380,324"
mobileControlSet "videoControl", "backgroundColor", "0,0,0,25"
mobileControlDo "videoControl", "play"
end openCard

is there something wrong?
I only get blank screen, no controler, no video