9

I am trying to get the MPMovieplayerController to work. I load a video everything goes wel i even see the first frame but then it automatically pauses, if i press play it pauses again. In the simulator it works perfectly but on the ipad device it gives the problem. I can even seek through the video and i see the frame i seeked to but nothing plays. This is some output from the console:

2010-06-08 22:16:13.145 app[3089:207] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
[Switching to thread 12803]
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/VCH263.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/H264H2.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/MP4VH2.videodecoder" (file not found).
warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.2 (7B367)/Symbols/System/Library/VideoDecoders/JPEGH1.videodecoder" (file not found).
2010-06-08 22:16:15.145 app[3089:207] setting file:///private/var/mobile/Applications/46CE5456-6338-4BBF-A560-DCEFF700ACE0/tmp/MediaCache/

I dont get those warning when using the simulator BTW.

Does anyone know how to fix this ?

slayerIQ
  • 1,488
  • 2
  • 13
  • 25
  • Yes, this happens on my 3.2 simulator and device(iPad). Videos play consistently for either in html5 OR natively in the MoviePlayerViewController, but not a combination of both. iOS 4+ works fine, though. i.e., I can't play a video in my UIWebView and then programmatically play the video in the iOS movieviewcontroller – cipherz Dec 15 '10 at 22:18

5 Answers5

11

Set the property "useApplicationAudioSession" of the MPMoviePlayerController to "NO" to resolve the problem.

xwwxy
  • 166
  • 1
  • 2
  • If u not use application audio session.. if user plays ipod in background what happens...? both audio mixes together. http://cocoabugs.blogspot.com/2010/08/troubleshoting-iphone.html –  Dec 24 '10 at 11:50
  • @xwwwxy Your solution solve the video freezing problem but now the sound is stopped when video is playing... Any idea why ? – CedricSoubrie Nov 16 '11 at 11:09
  • Hey buddy you solved my problem i m making video using avassetwriter and when i was trying to play it stucks up. but after adding this line it works superb. thnxx a lot... – Amrit Trivedi Jan 04 '13 at 09:16
7

Found the solution just restart the ipad and it works again weird but thats it :)

slayerIQ
  • 1,488
  • 2
  • 13
  • 25
  • 2
    Kinda hard to tell your users to restart their devices all of the time. We play a video on app startup, and this causes the app to hang. Anyone got any bright ideas as to how to recover? – tobyc Aug 15 '10 at 22:30
  • Has anyone found a solution to this other then restarting the device yet?? – gabaum10 Oct 14 '10 at 19:05
0

Avaudioplayer was causing my problem. Apperently on the iPad Avaudioplayer and Mpmovieplayercontroller cannot both play at the same time.

If an Avaudioplayer object is open the Mpmovieplayer will only display a frame and immediately stop playing.

As far as I can tell this only happens with iPad device 3.2.1 and SDK 4.0.1; simulators and the iPhone work fine

I switched back to Audioservices since I need Audioplayer and Movieplayer to play at the same time.

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
chrisg
  • 1
0

Had the same problem. Video was playing ok on simulation but not on device. The problem was either on my HTML5 code embeded in the UIView or on the mp4 video compression, I don't know what fixed it but I suggest you try both. I am still getting the error when I am testing the video on the device, but the video plays just fine!

DuMmWiaM
  • 71
  • 4
0

I had an issue on the device where the video would show up but not play. I could scrub. The fix for me was that I was using the avaudiorecorder, and I was releasing it before playing the video without stopping the audio recorder. My solution was to add the stop call to the recorder before starting the video:

[recorder stop];
[recorder release];
Anthony Blake
  • 5,328
  • 2
  • 25
  • 24
Edward
  • 148
  • 2
  • 7