Problem with mobilecontrol player object
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Problem with mobilecontrol player object
Hi all,
I have a problem with an app that is driving me mad. The app works fine if built with Livecode Indy 9-5, but keeps freezing in later versions. I’ve tried it in all versions of Indy, and Community, from 9-6-1 up to 9-6-2 RC2 with the same result.
The problem I’m having is with the mobileControlCreate player object. I filed a bug report about this when 9-6-1 came out, but Panos was unable to replicate the fault, so I’m hoping that some of you kind people could give it a try.
The fault appears both in the simulator and on a real device. I’ve tried it on 2 different model iMacs, and 3 different model iPads, and they all have the same fault.
To test this, create a New Stack > iPad/Tablet Landscape. Add a button and position it at location 100,50 with the following script.
on mouseUp
if "TestPlayer" is not among the lines of mobileControls() then
mobileControlCreate "player", "TestPlayer"
wait until "TestPlayer" is among the lines of mobileControls()
mobileControlSet "TestPlayer", "visible", true
mobileControlSet "TestPlayer", "showController", true
mobileControlSet "TestPlayer", "rect", "100,100,740,460"
end if
mobileControlDo "TestPlayer", "stop"
mobileControlSet "TestPlayer", "filename", "ht tps://commondata storage. google apis. com/gtv-videos-bucket/sample/BigBuckBunny. mp4" mobileControlDo "TestPlayer", "play"
end mouseUp
Note that due to forum rules the filename contains spaces which need deleting in order for the script to run.
As you can see, the first click creates a player object, and then launches the player. Subsequent clicks simply reload the video.
The fault is that at some point, maybe the first click of the button or maybe the tenth click, the simulator or iPad will lock up and stop responding to the button. If the video is playing then it continues to play, but the app will no longer respond.
If you do try this on your setup and get the same result, please post back here and maybe I can get the development team to investigate further.
Thanks
Steve
I have a problem with an app that is driving me mad. The app works fine if built with Livecode Indy 9-5, but keeps freezing in later versions. I’ve tried it in all versions of Indy, and Community, from 9-6-1 up to 9-6-2 RC2 with the same result.
The problem I’m having is with the mobileControlCreate player object. I filed a bug report about this when 9-6-1 came out, but Panos was unable to replicate the fault, so I’m hoping that some of you kind people could give it a try.
The fault appears both in the simulator and on a real device. I’ve tried it on 2 different model iMacs, and 3 different model iPads, and they all have the same fault.
To test this, create a New Stack > iPad/Tablet Landscape. Add a button and position it at location 100,50 with the following script.
on mouseUp
if "TestPlayer" is not among the lines of mobileControls() then
mobileControlCreate "player", "TestPlayer"
wait until "TestPlayer" is among the lines of mobileControls()
mobileControlSet "TestPlayer", "visible", true
mobileControlSet "TestPlayer", "showController", true
mobileControlSet "TestPlayer", "rect", "100,100,740,460"
end if
mobileControlDo "TestPlayer", "stop"
mobileControlSet "TestPlayer", "filename", "ht tps://commondata storage. google apis. com/gtv-videos-bucket/sample/BigBuckBunny. mp4" mobileControlDo "TestPlayer", "play"
end mouseUp
Note that due to forum rules the filename contains spaces which need deleting in order for the script to run.
As you can see, the first click creates a player object, and then launches the player. Subsequent clicks simply reload the video.
The fault is that at some point, maybe the first click of the button or maybe the tenth click, the simulator or iPad will lock up and stop responding to the button. If the video is playing then it continues to play, but the app will no longer respond.
If you do try this on your setup and get the same result, please post back here and maybe I can get the development team to investigate further.
Thanks
Steve
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobilecontrol player object
I didn't try it but my guess is that you need to remove the wait. It isn't necessary, and I suspect the player can't be created until it knows what properties to set, so it's waiting forever.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobilecontrol player object
The script runs the same with or without the wait command. The reason that I put the 'wait until' command in is that the script sometimes fails on first click, so the wait is there to prove that the player is being correctly created. I did this anticiating that someone may suggest that the reason that the script is failing is that parameters are being set before the player exists, but the player object always gets created correctly.
Having spent many hours trying to figure out where this is failing I know it is the 'set filename' command that fails, which is why the script creates the player just once on first run. Subsequent clicks on the button just stops the player, reloads the URL with the 'set filename' command, then restarts the player.
Having spent many hours trying to figure out where this is failing I know it is the 'set filename' command that fails, which is why the script creates the player just once on first run. Subsequent clicks on the button just stops the player, reloads the URL with the 'set filename' command, then restarts the player.
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobilecontrol player object
I'll assume that this is actually two lines, right?
Have you tried testing with a different online file? It may be an issue with the test file URL. That's all I can think of.
Code: Select all
mobileControlSet "TestPlayer", "filename", "ht tps://commondata storage. google apis. com/gtv-videos-bucket/sample/BigBuckBunny. mp4" mobileControlDo "TestPlayer", "play"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobilecontrol player object
Yes, it should be 2 lines. Not sure why it came out as one line.jacque wrote: ↑Sun Jan 17, 2021 11:45 pmI'll assume that this is actually two lines, right?Have you tried testing with a different online file? It may be an issue with the test file URL. That's all I can think of.Code: Select all
mobileControlSet "TestPlayer", "filename", "ht tps://commondata storage. google apis. com/gtv-videos-bucket/sample/BigBuckBunny. mp4" mobileControlDo "TestPlayer", "play"
Code: Select all
on mouseUp
if "TestPlayer" is not among the lines of mobileControls() then
mobileControlCreate "player", "TestPlayer"
wait until "TestPlayer" is among the lines of mobileControls()
mobileControlSet "TestPlayer", "visible", true
mobileControlSet "TestPlayer", "showController", true
mobileControlSet "TestPlayer", "rect", "100,100,740,460"
end if
mobileControlDo "TestPlayer", "stop"
mobileControlSet "TestPlayer", "filename", "ht tps://commondata storage. google apis. com/gtv-videos-bucket/sample/BigBuckBunny. mp4"
mobileControlDo "TestPlayer", "play"
end mouseUp
Yes, I've tried other online files with the same result. If you Google 'mp4 test video' you will find plenty of examples that you can use.
Re: Problem with mobilecontrol player object
I've made a video showing the issue that I get. If you watch the video you will see the 3 faults modes that the player gets in to. You will also see that the fault is random. Sometimes the fault will appear on the first click, and sometimes after a number of clicks. The most clicks I've ever had before the fault appears is 12 clicks.
Machine is an iMac 14-2 running Catalina, Livecode 6-5-2 RC2, Xcode 12-1, but I get the same fault in High Sierra and Mojave, and with all versions of Livecode Indy or Community from 9-6-0 onwards (when Livecode changed to using AVKIT for the player). The same project built in previous versions is stable.
https://youtu. be/aWTMcQmAyCM
Take the space out of the link to view. Sorry for the low audio level!
Machine is an iMac 14-2 running Catalina, Livecode 6-5-2 RC2, Xcode 12-1, but I get the same fault in High Sierra and Mojave, and with all versions of Livecode Indy or Community from 9-6-0 onwards (when Livecode changed to using AVKIT for the player). The same project built in previous versions is stable.
https://youtu. be/aWTMcQmAyCM
Take the space out of the link to view. Sorry for the low audio level!
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Problem with mobilecontrol player object
I can't test right now, but there was a similar but not identical problem with the mobile player in one of my apps. The first thing you can try is to set the filename to empty before displaying or reloading the player.
If that doesn't work, try it in the latest 9.6.2rc2 version of LC. There are some fixes there for player issues.
Code: Select all
mobileControlSet "TestPlayer", "filename", empty
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Problem with mobilecontrol player object - confirmed bug
The LiveCode software team have emailed me to say that they have replicated the fault, and that this is now a confirmed bug. Hopefully it can be sorted in the next release as I'm waiting to update 2 apps in the store.
Re: Problem with mobilecontrol player object
Hi Steve,
I believe I encounetred a similar issue, I posted it here:
viewtopic.php?f=10&t=35772
before I found your forum post. Could you share the link to the bug report, perhaps I can add to it if needed.
Have you tried your stack with MergAV? It seemed to work fine and I changed my app in such a way that it uses mergAV on iOS and the native mobilecontrol player for android and the player object on macosx. It is of cause moving away from the principle "one code to rule all platforms", but since it is just for a player object the changes are managable.
Best
Oliver
I believe I encounetred a similar issue, I posted it here:
viewtopic.php?f=10&t=35772
before I found your forum post. Could you share the link to the bug report, perhaps I can add to it if needed.
Have you tried your stack with MergAV? It seemed to work fine and I changed my app in such a way that it uses mergAV on iOS and the native mobilecontrol player for android and the player object on macosx. It is of cause moving away from the principle "one code to rule all platforms", but since it is just for a player object the changes are managable.
Best
Oliver
Re: Problem with mobilecontrol player object
Hi Oliver,
Yes, it's the same bug. In my original bug report I thought that it was a networking issue and reported it as such, but later realised it to be a player fault. Original bug report is here:
https://quality.livecode.com/show_bug.cgi?id=22650
Target fix is Livecode 9.6.3 so not sure how long it will be before we get there.
Yes, I did the same as you and switched to MergAV for iOS. I put it into a load/play/delete loop and it was still working after 2500 iterations compared to less than 20 for mobilecontrol player. Pity you have to write your own controller!
Best
Steve
Yes, it's the same bug. In my original bug report I thought that it was a networking issue and reported it as such, but later realised it to be a player fault. Original bug report is here:
https://quality.livecode.com/show_bug.cgi?id=22650
Target fix is Livecode 9.6.3 so not sure how long it will be before we get there.
Yes, I did the same as you and switched to MergAV for iOS. I put it into a load/play/delete loop and it was still working after 2500 iterations compared to less than 20 for mobilecontrol player. Pity you have to write your own controller!
Best
Steve
Re: Problem with mobilecontrol player object
What a relief that it is a known bug. Thanks for creating the bug report, nice that it is on the road-map. I spent quite some hours with this, it was hard to narrow it down since it was so random. Btw. I couldnt figure out if MergAV can display a native controller for the video? Something like this:
Best
Oliver
Code: Select all
mergAVPlayerSet playerID, "controller", "true"
Oliver
Re: Problem with mobilecontrol player object
I tried all combinations of controller as a property that I could think of without success. I took a peek inside the extension source code but couldn't find any refrence to controller so I guess it was never implemented. I built a controller using the duration and current time properties to move a graphic along a line.
I found that 'ready for display' crashes the app, and could never figure what the option 2 and 3 values for seek were.
Re: your question of hiding the player until the video starts, I did pretty much the same as you except I used a wait until command, so:
put mergAVPlayerCreateFromURL(pURL) into pPlayerPointer
mergAVPlayerSet pPlayerPointer, "visible", "false"
// show the spinner
mergAVPlayerDo pPlayerPointer, "play"
wait until mergAVPlayerGet(pPlayerPointer, "current time") > 0 with messages
// hide the spinner
mergAVPlayerSet pPlayerPointer, "visible", "true"
Best
Steve
I found that 'ready for display' crashes the app, and could never figure what the option 2 and 3 values for seek were.
Re: your question of hiding the player until the video starts, I did pretty much the same as you except I used a wait until command, so:
put mergAVPlayerCreateFromURL(pURL) into pPlayerPointer
mergAVPlayerSet pPlayerPointer, "visible", "false"
// show the spinner
mergAVPlayerDo pPlayerPointer, "play"
wait until mergAVPlayerGet(pPlayerPointer, "current time") > 0 with messages
// hide the spinner
mergAVPlayerSet pPlayerPointer, "visible", "true"
Best
Steve
Re: Problem with mobilecontrol player object
Hi SteveB,
did you by any chance noticed any synch issues with the mobilecontrol player object on Android? I play my videos from a server and audio and video track are slightly out of synch on Android devices, it is not much, but noticable enough to be annyoying, perhaps 4 frames. The videos on the server are in perfect synch, and on iOS and on desktop the audio and video are playing in synch as well.
Best
Oliver
did you by any chance noticed any synch issues with the mobilecontrol player object on Android? I play my videos from a server and audio and video track are slightly out of synch on Android devices, it is not much, but noticable enough to be annyoying, perhaps 4 frames. The videos on the server are in perfect synch, and on iOS and on desktop the audio and video are playing in synch as well.
Best
Oliver
Re: Problem with mobilecontrol player object
Hi Oliver,
Yes, I noticed the same - a slight loss of sync. As you say it's just a few frames out. My videos are 25 fps MP4, and I would estimate it is 2 frames out.
Best
Steve
Yes, I noticed the same - a slight loss of sync. As you say it's just a few frames out. My videos are 25 fps MP4, and I would estimate it is 2 frames out.
Best
Steve
Re: Problem with mobilecontrol player object
Thanks! Do you think this would qualify for a bug-report? Best. O