I’m developing an app for iPad (using Titanium Appcelerator) that is designed to record and plays back multiple video files. At this point, I can record videos endlessly but when I to play them back, the app will crash, seemingly at random. For example: play video A, then video B, then C, then go back to A and the app crashes back to the home screen while in the middle of playback. Re-start the app and do the exact same thing, and it will be fine, and let me play another couple of videos, then crash when I go back to the list of videos. The crash logs often start with this:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x4650974c
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33adbca4 0x33ad9000 + 11428
1 MediaPlayer 0x354469d6 0x353d9000 + 448982
2 Foundation 0x333dd7c6 0x3334d000 + 591814
3 CoreFoundation 0x3712ea40 0x370b9000 + 481856
4 CoreFoundation 0x37130ec4 0x370b9000 + 491204
5 CoreFoundation 0x3713183e 0x370b9000 + 493630
6 CoreFoundation 0x370c1ebc 0x370b9000 + 36540
7 CoreFoundation 0x370c1dc4 0x370b9000 + 36292
8 GraphicsServices 0x36ffc418 0x36ff8000 + 17432
9 GraphicsServices 0x36ffc4c4 0x36ff8000 + 17604
10 UIKit 0x35009d62 0x34fdb000 + 191842
11 UIKit 0x35007800 0x34fdb000 + 182272
12 VideoRiver 0x000042bc 0x1000 + 12988
13 VideoRiver 0x00003b60 0x1000 + 11104
- iOS SDK 4.3,
- XCode 3.2.6,
- Titanium SDK 1.7.1,
- iPad 2, 32GB 3G,
- iPad iOS 4.3.3
I believe I’ve found a workaround. So far, no crashes under the same circumstances outlined in my question. The difference is that rather than creating a separate window for the video, I am putting the video player on a view, then hiding and showing it as needed. Here’s some code for Titanium Appcelerator that works:
To use this, do the following:
Enjoy!