1
我正在下載視頻並使用MPMoviePlayercontroller進行播放,當視頻正在下載時,我想在mpmovieplayercontroller中顯示uiactivityindicatorview,就像在YouTube應用程序中一樣。 我如何實現這一目標?MPMoviePlayerController中的UIActivityindicatorView
我正在下載視頻並使用MPMoviePlayercontroller進行播放,當視頻正在下載時,我想在mpmovieplayercontroller中顯示uiactivityindicatorview,就像在YouTube應用程序中一樣。 我如何實現這一目標?MPMoviePlayerController中的UIActivityindicatorView
像這樣的事情?:
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activityIndicator.center = myMPMoviePlayercontroller.center;
activityIndicator.hidesWhenStopped = YES;
[activityIndicator startAnimating];
[myMPMoviePlayercontroller.view addSubview:activityIndicator];
myMPMoviePlayercontroller addSubview:activityIndicator];
我試過我們的代碼,但是當視頻開始播放時,activityindicator必須隱藏,但它仍在運行。 –
使用'[activityIndicator stopAnimating];'在播放視頻之前或在視頻開始時調用的委託方法中。這會隱藏'activityIndicator'。 – chown
感謝chown它爲我工作。乾杯!! –