2010-06-08 118 views
9

我想讓MPMovieplayerController工作。我加載視頻一切順利,我什至看到第一幀,但然後它會自動暫停,如果我按播放它再次暫停。在模擬器中,它可以很好地工作,但是在ipad設備上它可以解決問題。我甚至可以通過視頻尋找,我看到我尋找的框架,但沒有播放。這是從控制檯的一些輸出:Ipad MPMovieplayerController視頻加載但播放時自動暫停

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/ 

我沒有得到那些警告,當使用模擬器順便說一句。

有誰知道如何解決這個問題?

+0

是的,這發生在我的3.2模擬器和設備(iPad)上。視頻在HTML5中或在MoviePlayerViewController中本地播放,但不是兩者的組合。不過,iOS 4 +可以正常工作。即我無法在我的UIWebView中播放視頻,然後以編程方式在iOS視頻播放器中播放視頻 – cipherz 2010-12-15 22:18:48

回答

11

將MPMoviePlayerController屬性「useApplicationAudioSession」設置爲「NO」來解決問題。

+0

如果你不使用應用音頻會話..如果用戶在後臺播放ipod會發生什麼...?兩個音頻混合在一起。 http://cocoabugs.blogspot.com/2010/08/troubleshoting-iphone.html – 2010-12-24 11:50:08

+0

@xwwwxy您的解決方案解決了視頻凍結問題,但現在播放視頻時聲音已停止......任何想法爲什麼? – CedricSoubrie 2011-11-16 11:09:18

+0

嘿,你好,你解決了我的問題,我使用avassetwriter製作視頻,當我試圖播放它的時候。但是在添加這條線之後,它的效果非常好。 thnxx很多... – 2013-01-04 09:16:13

7

找到解決方案只需重新啓動iPad和它的作品再次奇怪,但多數民衆贊成:)

+0

我也有這個問題,謝謝! – hellozimi 2010-06-09 11:38:06

+0

我花了6個小時才找到這個主題...謝謝! :) – 2010-06-23 13:05:57

+2

有點難以告訴您的用戶在任何時候重新啓動設備。 我們在應用程序啓動時播放視頻,這會導致應用程序掛起。 任何人有任何明智的想法如何恢復? – tobyc 2010-08-15 22:30:55

0

Avaudioplayer引起了我的問題。在iPad上顯示Avadidioplayer和Mpmovieplayercontroller不能同時播放。

如果Avaudioplayer對象打開,Mpmovieplayer將只顯示一個框架並立即停止播放。

據我可以告訴這隻發生在iPad設備3.2.1和SDK 4.0.1;模擬器和iPhone工作正常

我切換回Audioservices,因爲我需要Audioplayer和Movieplayer同時播放。

0

有同樣的問題。視頻在模擬上播放正常,但沒有在設備上播放。這個問題或者是我的HTML5代碼嵌入在UIView中,或者是mp4視頻壓縮,我不知道是什麼修復了它,但我建議你同時嘗試這兩種。當我在設備上測試視頻時,我仍然遇到錯誤,但視頻播放效果還不錯!

0

我在設備上有問題,視頻會顯示但不能播放。我可以擦洗。對我來說,解決方法是我使用了avaudiorecorder,並且在播放視頻之前我先釋放它,而不停止錄音機。我的解決方案是在開始視頻之前將停止呼叫添加到錄像機:

[recorder stop]; 
[recorder release]; 
相關問題