rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

BW::Media.play crashes when specifying MPMovieSourceTypeStreaming #450

Closed markrickert closed 9 years ago

markrickert commented 9 years ago
BW::Media.play_modal("http://techslides.com/demos/sample-videos/small.mp4", {
  movie_source_type: MPMovieSourceTypeStreaming
})

crashes with:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000104d5df35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001010a3bb7 objc_exception_throw + 45
    2   AVFoundation                        0x00000001055cb34f -[AVPlayerItem _attachToFigPlayer] + 0
    3   AVFoundation                        0x00000001055be592 -[AVPlayer _attachItem:andPerformOperation:withObject:] + 298
    4   AVFoundation                        0x00000001055de4f8 -[AVQueuePlayer insertItem:afterItem:] + 142
    5   MediaPlayer                         0x0000000102e2532a -[MPQueuePlayer insertItem:afterItem:] + 191
    6   MediaPlayer                         0x0000000102e04b41 __89-[MPAVQueuePlayerFeeder _updatePlayerQueueWithRemovedItems:addedItems:removeCurrentItem:]_block_invoke368 + 844
    7   libdispatch.dylib                   0x00000001064a8af6 _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x00000001064c2af4 _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00000001064ae265 _dispatch_main_queue_callback_4CF + 490
    10  CoreFoundation                      0x0000000104cc5fe9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    11  CoreFoundation                      0x0000000104c88eeb __CFRunLoopRun + 2043
    12  CoreFoundation                      0x0000000104c88486 CFRunLoopRunSpecific + 470
    13  GraphicsServices                    0x0000000107a279f0 GSEventRunModal + 161
    14  UIKit                               0x00000001038a2420 UIApplicationMain + 1282
    15  AppName                           0x000000010013e685 main + 117
    16  libdyld.dylib                       0x00000001064f3145 start + 1
    17  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException