IOS Native player

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pr1de
Posts: 3
Joined: Sat Sep 03, 2016 6:27 pm

IOS Native player

Post by pr1de » Mon Dec 12, 2016 7:14 pm

Greetings

Would someone give me a hand to solve my problem with getting native ios player to play video from a URL?

I've tried this code:
on mouse up
mobileControlCreate "player", "videoControl"
mobileControlSet "videoControl", "filename", "my link"
mobileControlSet "videoControl", "preserveAspect", true
mobileControlSet "videoControl", "showController", true
mobileControlSet "videoControl", "visible", true
mobileControlSet "videoControl", "rect", "222,120,804,586"

mobileControlDo "videoControl", "play"
end mouse up

tried the same thing with **mobileControlSet "videoControl", "URL", ........**

tried to launch via creating browser, still didn't work. The only thing i get is a black square and nothing more.

However it works for me if I use code:
Launch url "......" so it runs via safari, but it's not what i want)

Thank you.

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: IOS Native player

Post by LiveCode_Panos » Mon Dec 12, 2016 8:48 pm

Hi pr1de,

The remote video needs some time to load, so if you do

Code: Select all

mobileControlDo "videoControl", "play"
immediately, you'll get a black screen.

See the "loadState" property of the native player in the Dictionary.

You need to do something like:

Code: Select all

on mouseUp
   mobilecontrolcreate "player"
   put the result into tempMovieID
   mobilecontrolset tempMovieID, "rect", tRect
   mobilecontrolset tempMovieID, "filename", tFilename
   wait until mobileControlGet(tempMovieID,"loadstate") contains "playthrough"
   mobilecontrolset tempMovieID, "visible", true
   mobileControlDo tempMovieID, "play"
end mouseUp
Best,
Panos
--

pr1de
Posts: 3
Joined: Sat Sep 03, 2016 6:27 pm

Re: IOS Native player

Post by pr1de » Thu Dec 15, 2016 1:45 am

Tried that as well. Nothing happens, black rect doesn't appear, seems like it waits for the video to upload but it takes ages......

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: IOS Native player

Post by LiveCode_Panos » Thu Dec 15, 2016 1:39 pm

Hmm, maybe it is worth doing a

Code: Select all

mobileControlDo "videoControl", "prepareToPlay"
after setting the filename.

Post Reply

Return to “iOS Deployment”