Video on Android

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Video on Android

Post by joel.epsteinBUS31vi » Thu Dec 04, 2014 3:56 pm

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

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: Video on Android

Post by sefrojones » Thu Dec 04, 2014 4:38 pm

I've read that Nexus 7 devices have trouble with .wmv files. Have you tried converting it to a different format?

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: Video on Android

Post by joel.epsteinBUS31vi » Thu Dec 04, 2014 7:28 pm

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

maulinarmananda
Posts: 14
Joined: Thu Mar 24, 2016 12:13 pm

Re: Video on Android

Post by maulinarmananda » Thu Mar 24, 2016 12:38 pm

do you have to create player first, or just let the code on your card script?

I dont know how to put the code

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: Video on Android

Post by joel.epsteinBUS31vi » Fri Mar 25, 2016 2:37 am

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

maulinarmananda
Posts: 14
Joined: Thu Mar 24, 2016 12:13 pm

Re: Video on Android

Post by maulinarmananda » Fri Mar 25, 2016 4:47 am

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

Post Reply

Return to “Android Deployment”