Page 1 of 1

IOS Native player

Posted: Mon Dec 12, 2016 7:14 pm
by pr1de
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.

Re: IOS Native player

Posted: Mon Dec 12, 2016 8:48 pm
by LiveCode_Panos
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
--

Re: IOS Native player

Posted: Thu Dec 15, 2016 1:45 am
by pr1de
Tried that as well. Nothing happens, black rect doesn't appear, seems like it waits for the video to upload but it takes ages......

Re: IOS Native player

Posted: Thu Dec 15, 2016 1:39 pm
by LiveCode_Panos
Hmm, maybe it is worth doing a

Code: Select all

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