Handheld.PlayFullScreenMovie crashes when video over or "CancelOnInput"

Hi,

I’m used to play a short video with this command:
Handheld.PlayFullScreenMovie(“video.mp4”,Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);

And quit the video when the user touches the screen. After the last update (5.3.2p2) the app crashes when the user touches the screen or the video is over. the error:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xb195cf4e
Triggered by Thread: 0

Thread 0 name: main
Thread 0 Crashed:
0 libobjc.A.dylib 0x37f1e626 objc_msgSend + 6
1 CoreFoundation 0x2d72619e CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 10
2 CoreFoundation 0x2d69a4ea _CFXNotificationPost + 1714
3 Foundation 0x2e085a38 -[NSNotificationCenter postNotificationName:hushed:bject:userInfo:] + 72
4 Foundation 0x2e08a316 -[NSNotificationCenter postNotificationName:hushed:bject:] + 26
5 0x00033662 AppController_SendUnityViewControllerNotification(NSString*) (UnityAppController.mm:360)
6 0x000391a6 -[UnityViewControllerBase viewDidLayoutSubviews] (UnityViewControllerBaseiOS.mm:81)
7 UIKit 0x2ff80e2a -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 590
8 QuartzCore 0x2fbfe626 -[CALayer layoutSublayers] + 138
9 QuartzCore 0x2fbf9e36 CA::Layer::layout_if_needed(CA::Transaction*) + 346
10 QuartzCore 0x2fbf9cc8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 12
11 QuartzCore 0x2fbf96da CA::Context::commit_transaction(CA::Transaction*) + 226
12 QuartzCore 0x2fbf94ea CA::Transaction::commit() + 310
13 UIKit 0x2ff843dc _UIApplicationHandleEventQueue + 8228
14 CoreFoundation 0x2d72f208 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 12
15 CoreFoundation 0x2d72e6d6 __CFRunLoopDoSources0 + 202
16 CoreFoundation 0x2d72ceca __CFRunLoopRun + 618
17 CoreFoundation 0x2d697eba CFRunLoopRunSpecific + 518
18 CoreFoundation 0x2d697c9e CFRunLoopRunInMode + 102
19 GraphicsServices 0x3259d65e GSEventRunModal + 134
20 UIKit 0x2ffe4148 UIApplicationMain + 1132
21 0x00019d7a main (main.mm:32)
22 libdyld.dylib 0x38421ab4 start + 0

Same here. Anyone?

I’m starting to think it’s related to the fact I’ve upgraded both unity admob plugin and unity google play services plugins:

Maybe related to the issue I’ve opened here:

@Acrilige - do you use any of these plugins?

No, I don’t use these… actually, I have such an error on 5.3.2p2 but the same project built with 5.3.2p1 doesn’t have that issue. It also seems to be reproducible only on ios 7

Same here - worked on 5.3.2p1, doesn’t work since 5.3.2p2. Tested only on IPhone 4 (IOS7 indeed).
I thought it’s related to Google play services because I saw a class of it mentioned when debugging with xcode on the device, breakpoint on exception, but not sure (I’m kind of new to Xcode and its debugging methods).

I also tried using the method withhout “CancelOnInput”, as I read this:

where they say it’s working since 5.3.2p2 - still, same problem.

This part of the post from that topic kind of explains it:
"Internally, Handheld.PlayFullScreenMovie comes with two different implementations these days,
one targeting iOS 8 or later (AVKit) and one for older ones (MPMoviePlayer)"

Anyway, sadly, but my best shot right now is

if (!UnityEngine.iOS.Device.systemVersion.StartsWith("7"))
{
     Handheld.PlayFullScreenMovie("Movie.mp4", Color.black , FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFill);
}

:eyes: didn’t notice that sentence!

OK, but there is a different implementation for the older ones… it used to work before the last update. And in the patch release notes, the only thing relevant is:
iOS: Handheld.PlayFullScreenMovie only allows playing one movie at a time

@aet - could you please elaborate on this issue?

Thanks.

It looks like I’m getting a crash in unity 5.4.0f3 and 5.4.0p4 when calling PlayFullScreenMovie on my iPhone 4 with iOS 7. I filed a bug to unity at https://fogbugz.unity3d.com/default.asp?828508_qo66q5fi5dbnqomb if anyone is still concerned with this issue. I will be using the workaround by @Acrilige in the mean time.

Unity has replied to my ticket and says it will be fixed in Unity 5.5