Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Handheld.PlayFullScreenMovie crashes when video over or "CancelOnInput"

Discussion in 'iOS and tvOS' started by Naamani, Feb 5, 2016.

  1. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
    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:eek:bject:userInfo:] + 72
    4 Foundation 0x2e08a316 -[NSNotificationCenter postNotificationName:eek:bject:] + 26
    5 <myApp> 0x00033662 AppController_SendUnityViewControllerNotification(NSString*) (UnityAppController.mm:360)
    6 <myApp> 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 <myApp> 0x00019d7a main (main.mm:32)
    22 libdyld.dylib 0x38421ab4 start + 0
     
    Last edited: Feb 8, 2016
  2. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    Same here. Anyone?
     
  3. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
  4. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    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
     
  5. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
    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:
    http://forum.unity3d.com/threads/bu...lscreenmovie-no-done-or-cancel-button.374189/
    where they say it's working since 5.3.2p2 - still, same problem.
     
  6. Acrilige

    Acrilige

    Joined:
    May 6, 2013
    Posts:
    50
    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
    Code (CSharp):
    1. if (!UnityEngine.iOS.Device.systemVersion.StartsWith("7"))
    2. {
    3.      Handheld.PlayFullScreenMovie("Movie.mp4", Color.black , FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFill);
    4. }
     
  7. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
    o_O 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

    @aetfi - could you please elaborate on this issue?

    Thanks.
     
  8. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
  9. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    Unity has replied to my ticket and says it will be fixed in Unity 5.5