Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6893] iOS: Media - notification from another app crashes Titanium app that is playing video

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionHold
Resolution Date2012-01-23T16:52:19.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sSprint 2011-52
ComponentsiOS
Labelsandroid
ReporterZsombor Papp
AssigneeStephen Tramer
Created2011-12-22T16:00:17.000+0000
Updated2012-02-01T02:51:26.000+0000

Description

Problem

Notification from other app crashes app playing video

Test case

* Create a mobile project using the attached app.js file * Place a movie file that includes sound at Resources/movie.mov and run the app on the iPhone * Arrange for a notification from another app while the movie is playing. You can use the built-in Reminders app * Open the app that sent the notification via the notification's alert dialog, then return to the sample app * At this point the sample app will crash. See also stack trace below. NOTE: The notification has to come in the form of an alert dialog; banners don't trigger this problem.
var win = Ti.UI.createWindow({
  backgroundColor: 'white',
  orientationModes: [ Ti.UI.PORTRAIT ]
});

var videoPlayerView = Ti.Media.createVideoPlayer({
  media: 'movie.mov',
  movieControlMode: Ti.Media.VIDEO_CONTROL_EMBEDDED,
  mediaControlStyle: Ti.Media.VIDEO_CONTROL_EMBEDDED,
  scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
  autoplay: false,
  top:60
});

win.add(videoPlayerView);

win.open();

Logs

Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: [ERROR] The application has crashed with an unhandled exception. Stack trace:
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 0   CoreFoundation                      0x340fa8bf __exceptionPreprocess + 162
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 1   libobjc.A.dylib                     0x3434a1e5 objc_exception_throw + 32
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 2   AVFoundation                        0x36d81cb5 -[AVPlayerItem _attachToPlayer:forImmediateEnqueueing:shouldAppendItem:] + 340
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 3   AVFoundation                        0x36d721f7 -[AVPlayer _insertPlaybackItemOfItem:inPlayerQueueAfterPlaybackItemOfItem:] + 42
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 4   AVFoundation                        0x36d79bf3 __-[AVPlayer _attachItem:andPerformOperation:withObject:]_block_invoke_2 + 1098
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 5   libdispatch.dylib                   0x36d23d55 _dispatch_call_block_and_release + 12
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 6   libdispatch.dylib                   0x36d2ee8d _dispatch_main_queue_callback_4CF$VARIANT$up + 196
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 7   CoreFoundation                      0x340cd2dd __CFRunLoopRun + 1268
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 8   CoreFoundation                      0x340504dd CFRunLoopRunSpecific + 300
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 9   CoreFoundation                      0x340503a5 CFRunLoopRunInMode + 104
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 10  GraphicsServices                    0x308d4fcd GSEventRunModal + 156
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 11  UIKit                               0x374d1743 UIApplicationMain + 1090
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 12  babyfaces tests                     0x0000453b babyfaces tests + 13627
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 13  babyfaces tests                     0x00003dc0 babyfaces tests + 11712

Comments

  1. Paul Dowsett 2011-12-23

    Thank you for raising this issue, Zsombor. Please note the changes that were necessary in order for me to be able to escalate it, as described in [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist). Would you test this problem with the official release from yesterday, just in case it's been solved? I will mark this resolved for now. Once you have let me know about the above, reopen it, and I will then move it to the main project.
  2. Zsombor Papp 2011-12-23

    It does crash with official release SDK 1.8.0.1.
  3. Zsombor Papp 2011-12-23

    I don't seem to have permission to change the status of the ticket.
  4. Stephen Tramer 2011-12-27

    Unable to reproduce iPod 4GT iOS 5.0.1 (which does not come with Reminders, I used another alarm app which sends scheduled notifications). Reassigning to Blain since he has access to a 4S device.
  5. Stephen Tramer 2011-12-27

    Assigning back to me; can dupe on an iPad 2. This appears to be a dual-core/A5-specific problem. Crash message indicates that it could actually be an Apple bug.
  6. Blain Hamon 2011-12-28

    Could not find pull request, but manually pulled. Unfortunately, the same crasher still happens. Perhaps we should make a radar about it? Can we recreate it outside of titanium?
  7. Stephen Tramer 2011-12-28

    I was both able to recreate and possibly resolve outside Titanium; this is going to get looked at again. The sample app resolution may be different due to multithreading concerns, but this is definitely going to get a radar.
  8. Stephen Tramer 2011-12-29

    Bug filed with Apple; Radar # is 10631746. A workaround may be viable; investigating it.
  9. Stephen Tramer 2011-12-29

    Must HOLD this ticket as it is an Apple bug. The workaround that I discovered in an independent app may not be working for several reasons: * Overloaded notification center * Notification center delivery order * Multithreading Going to make an attempt to reduce the possibility of multithread issues (movie object managed off main thread) but that will be a last-ditch attempt.
  10. Stephen Tramer 2011-12-29

    After numerous attempts to get the known workaround to behave appropriately, still getting the crash. We filed the Radar # as above and hopefully this issue is significant enough for Apple to address it within a near timeframe.
  11. Thomas Huelbert 2012-01-23

    closing as this is an apple bug that we cannot address

JSON Source