gpt4 book ai didi

iphone - MPMoviePlayerController 中 prepareToPlay 和 Play 的区别

转载 作者:可可西里 更新时间:2023-11-01 17:08:57 26 4
gpt4 key购买 nike

请告诉我视频播放时 MPMoviePlayerControllerprepareToPlayplay 方法的区别。

语法是:

[moviePlayer prepareToPlay];

[moviePlayer play];

最佳答案

正如方法所说

prepareToPlay - 尚未开始播放,但正在播放任何(视频/音频)

play - 表示播放任何(视频/音频)

正如文档所说:

播放

Initiates playback of the current item. (required)

- (void)play  

Discussion
If playback was previously paused, this method resumes playback where it left off; otherwise, this method plays the first available item, from the beginning.

If a movie player is not prepared for playback when you call this method, this method first prepares the movie player and then starts playback. To minimize playback delay, call the prepareToPlay method before you call this method.

To be notified when a movie player is ready to play, register for the MPMoviePlayerLoadStateDidChangeNotification notification. You can then check load state by accessing the movie player’s loadState property.

Availability Available in iOS 3.2 and later. Declared In MPMediaPlayback.h

准备播放

准备电影播放器​​进行播放。 (必填)

- (void)prepareToPlay

Discussion
If a movie player is not already prepared to play when you call the play method, that method automatically calls this method. However, to minimize playback delay, call this method before you call play.

Calling this method may interrupt the movie player’s audio session. For information on interruptions and how to resond to them, see Audio Session Programming Guide.

Availability Available in iOS 3.2 and later.

Declared In MPMediaPlayback.h

了解更多信息 read This Official Documentation.

关于iphone - MPMoviePlayerController 中 prepareToPlay 和 Play 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15810644/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com