iPhone 3.0 MPMoviePlayerController 在屏幕上顯示視頻播放器的等待時間長有問題嗎? (Problem with iPhone 3.0 MPMoviePlayerController long wait time to display the video player on screen?)


問題描述

iPhone 3.0 MPMoviePlayerController 在屏幕上顯示視頻播放器的等待時間長有問題嗎? (Problem with iPhone 3.0 MPMoviePlayerController long wait time to display the video player on screen?)

Anybody is seeing this behavior on iPhone 3.0?

On my app, touching on the video link/button will take about 4-5 seconds before the movie player will show up on the screen. This doesn't look right.

Anybody have any suggestion to decrease this "wait time"?


參考解法

方法 1:

I saw that behavior too. I wonder if the wait time might be the time to find the appropriate decoder for the video format (because I saw some logs in the console at that moment indicating that some codec was not found).

Anyway, I set a waiting screen in my app, and wait for the MPMoviePlayerContentPreloadDidFinishNotification notification. Then I launch [myMoviePlayerController play].

Hope that will help.

方法 2:

In order to get the MPMoviePlayerController to display immediately, you have to call the [myPlayer play] method right away.  It is the play method that actually establishes the view on the screen and you probably don't want to wait until loading completes to call this.

You still may want to use your own waiting screen as mentioned by Unfalkster.  There are a few intermittent pauses depending on the video source and having a waiting screen helps tighten up the presentation.

If you call [myPlayer setBackgroundColor: [UIColor clearColor]] then the video control will be transparent when it does appear so that your waiting screen and any logos or messages displayed on it will show all the way up until the video starts playing.

This is by far the cleanest approach and is consistent with what the YouTube application is doing.  

Barney

方法 3:

I'm seeing this as well - anyone here or otherwise find a workaround or solution? video works beautifully on 2.2.1 and below, but has a delay before playing on 3.0 and above.

(by Teo Choong PingUnfalksterBarney Mattoxtiki)

參考文件

  1. Problem with iPhone 3.0 MPMoviePlayerController long wait time to display the video player on screen? (CC BY-SA 3.0/4.0)

#iphone #iphone-sdk-3.0






相關問題

iPhone 3.0 MPMoviePlayerController 在屏幕上顯示視頻播放器的等待時間長有問題嗎? (Problem with iPhone 3.0 MPMoviePlayerController long wait time to display the video player on screen?)

將 NavigationBar 背景更改為圖像 (Changing the NavigationBar background to image)

如何將以下行添加到我的 plist 文件中? (How can I add the following lines to my plist file?)

iPhone SDK:檢查 UITableView 中每個對象的 ID 號並相應地更改徽章號 (iPhone SDK: Checking the ID number for each object in a UITableView and change the badge number accordingly)

無法在不崩潰的情況下設置 ABPeoplePickerNavigationController 的 addressBook 屬性 (Can't set the addressBook property of ABPeoplePickerNavigationController without crashing)

嵌套 XML 示例? (Nested XML Example?)

提交應用程序 - 添加本地化,但我的語言未列在組合框中? (Submitting app - Add Localizations, but my language is not listed in the combo box?)

如何從移動瀏覽器直接訪問移動設備的硬件功能 (How to gain direct access to the hardware capabilities of mobile devices from mobile browsers)

Cocos2d 中的粒子碰撞檢測 (Collision detection with particles in Cocos2d)

捕捉返回按鈕導航事件 (Catching back button navigation event)

iphone初學者問題:畫一個矩形。我究竟做錯了什麼? (Beginner iphone question: drawing a rectangle. What am I doing wrong?)

帶有 UITableView 的 UIPopoverController (UIPopoverController with UITableView)







留言討論