Black screen instead of mp4 video
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Black screen instead of mp4 video
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
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
-
- VIP Livecode Opensource Backer
- Posts: 7239
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Black screen instead of mp4 video
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
HyperActive Software | http://www.hyperactivesw.com
Re: Black screen instead of mp4 video
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.
-
- VIP Livecode Opensource Backer
- Posts: 7239
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Black screen instead of mp4 video
What version of LC are you using?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Black screen instead of mp4 video
LiveCode 9.6.4
-
- VIP Livecode Opensource Backer
- Posts: 7239
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Black screen instead of mp4 video
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
HyperActive Software | http://www.hyperactivesw.com
Re: Black screen instead of mp4 video
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!
-
- VIP Livecode Opensource Backer
- Posts: 7239
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Black screen instead of mp4 video
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
HyperActive Software | http://www.hyperactivesw.com
Re: Black screen instead of mp4 video
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.
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.
Re: Black screen instead of mp4 video
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.
iOS and Android are CASE SENSITIVE OS, so -> myVideo.mp4 <> myvideo.mp4
Make sure to spell the filename and path correctly.