Black screen instead of mp4 video

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Black screen instead of mp4 video

Post by chelling » Mon Sep 13, 2021 2:21 pm

An existing app recently stopped playing video's. I am certain it's due to an iOS update, but haven't been able to it track down. Can anyone help or point me in the direction to resolve this? The card script is below. On openStack, the acceleratedRendering is true & fullScreenMode is "showAll".

global gActivity --used in a case statement for activity selection

on preOpenCard
put "myVideo" into gActivity
end preOpenCard

on openCard
if the environment is "mobile" then
if "videoControl" is among the lines of mobileControls() then
controlDelete
end if
mobileControlCreate "player", "videoControl"

mobileControlSet "videoControl", "filename", specialFolderPath("engine") & "/Video/myVideo.mp
mobileControlSet "videoControl", "showController", false
mobileControlSet "videoControl", "visible", true
mobileControlSet "videoControl", "rect", "83,61,941,705"
mobileControlSet "videoControl", "preserveAspect", true
mobileControlDo "videoControl", "play"
end if
end openCard

on closeCard
controlDelete
end closeCard

on controlDelete
if the environment is "mobile" then mobileControlDelete "videoControl"
end controlDelete

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Black screen instead of mp4 video

Post by jacque » Mon Sep 13, 2021 10:02 pm

I assume the video is included in the Copy Files pane in standalone settings, right? It looks like there's a quotation mark missing at the end of the file name, though that may be a typo here in the forum. And should there be a number after "mp"? Once you're sure the file name is correct, try this syntax using the resources folder instead of the engine folder:

Code: Select all

mobileControlSet "videoControl", "filename", (specialFolderPath("resources") & "/Video/myVideo.mp") -- mp4?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Black screen instead of mp4 video

Post by chelling » Mon Sep 13, 2021 10:38 pm

The videos are included in the Copy Files pane in standalone settings. The missing quotation mark and mp4 are typos. mobileControlSet "videoControl", "filename", (specialFolderPath("resources") & "/Video/myVideo.mp") had no affect - it's still showing the black screen. This app has been working for several years...evidently the last iOS update caused this to happen.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Black screen instead of mp4 video

Post by jacque » Tue Sep 14, 2021 12:23 am

What version of LC are you using?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Black screen instead of mp4 video

Post by chelling » Tue Sep 14, 2021 12:27 am

LiveCode 9.6.4

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Black screen instead of mp4 video

Post by jacque » Tue Sep 14, 2021 5:19 pm

I'm not sure what that might be. A black screen often means the file path isn't correct or the location isn't permissible. You could try copying the video to the documents folder and see if accessing from there works,. Or maybe go back a version to LC 9.6.3. Otherwise I'm out of ideas.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Black screen instead of mp4 video

Post by chelling » Wed Sep 15, 2021 12:13 am

I think I have it worked out. I know this has happened to other programs, so in case anyone else is having the same problem, this is what I did--I had audio files in wav format, and learned that it's not a preferred iOS format, so changed those to mp3. I had a card animation on the title card and took that out. That seemed to help a lot. I was still having intermittent fail to play, so I recompiled the videos to m4v. That worked consistently, but the file size was huge, so I went back to the original movie export from Moho and recompiled to mp4 in Handbrake. So far so good!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Black screen instead of mp4 video

Post by jacque » Wed Sep 15, 2021 4:47 pm

There is a "prepare" command that preloads a video into memory so it will play immediately when needed. If you preload on the first card that may help too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

SteveB
Posts: 40
Joined: Mon Sep 30, 2019 4:49 pm

Re: Black screen instead of mp4 video

Post by SteveB » Sat Sep 25, 2021 5:57 pm

I think you may be experiencing the random bug I describe here:

viewtopic.php?f=49&t=35247

It was supposed to be fixed in 9.6.3, but still isn't fixed in the latest release.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Black screen instead of mp4 video

Post by Klaus » Sat Sep 25, 2021 6:17 pm

Just to be sure:
iOS and Android are CASE SENSITIVE OS, so -> myVideo.mp4 <> myvideo.mp4
Make sure to spell the filename and path correctly.

Post Reply

Return to “iOS Deployment”