Can't get Android Mediaplayer to work

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Contact:

Can't get Android Mediaplayer to work

Post by charms » Mon Feb 10, 2014 6:30 pm

Hello,

I have LiveCode Community 6.5.2 and try to run a mp4 video in the Android Emulator over an URL from a website.

I have created an empty Stack window and inserted following code which should play the video:

on openCard
mobileControlCreate "player", "movie"
put the result into sPlayerID
mobileControlSet sPlayerID, "showController", true
mobileControlSet sPlayerID, "h t t p : / / clips . vorwaerts-gmbh . de / big_buck_bunny . mp4", tMoviePath
mobileControlDo sPlayerID, "play"
end openCard

I have activated Internet in the Android Standalone Application Settings.

When I deploy to the emulator which runs Android 4.2.2 then I only get a white screen and the controller is also not showing up.

Does anybody know where the problem could be located?

Thanks,
Chris

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can't get Android Mediaplayer to work

Post by Klaus » Mon Feb 10, 2014 7:22 pm

Hi Chirs,

try this:
...
mobileControlSet sPlayerID, "filename", "h t t p : / / clips . vorwaerts-gmbh . de / big_buck_bunny . mp4"
...
8)


Best

Klaus

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Can't get Android Mediaplayer to work

Post by LCNeil » Mon Feb 10, 2014 7:35 pm

Showing the player and setting a rect is a must as well-

Code: Select all

local sPlayerID

on openCard
   mobileControlCreate "player", "movie"
   put the result into sPlayerID
   mobileControlSet sPlayerID, "rect", "0,0,320,240"
   mobileControlSet sPlayerID, "visible", true
   mobileControlSet sPlayerID, "showController", true
   mobileControlSet sPlayerID, "filename","http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
   mobileControlDo sPlayerID, "play"
end openCard
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can't get Android Mediaplayer to work

Post by Klaus » Mon Feb 10, 2014 7:45 pm

Oh well! :D

charms
Posts: 122
Joined: Mon Feb 10, 2014 6:21 pm
Contact:

Re: Can't get Android Mediaplayer to work

Post by charms » Tue Feb 11, 2014 9:05 pm

Thanks for the fast reply. The posted code works works perfectly.

Kind regards,
Chris

Post Reply