gpt4 book ai didi

ios - 将 currentPlaybackTime 与 MPMoviePlayerController 一起用于 mp3 文件

转载 作者:行者123 更新时间:2023-11-29 13:11:51 24 4
gpt4 key购买 nike

我在我的应用中使用了MPMoviePlayerController来播放音频和视频,现在我遇到了一个非常焦虑的问题。当我播放 mp3 文件时,我无法在播放过程中设置 currentPlaybackTime。当我更改 currentPlaybackTime 时,播放器停止并发布 MPMoviePlayerPlaybackDidFinishNotification 通知。当我重新启动 player 时,它播放了 0 秒。

我使用了 MPMoviePlayerController,因为它可以从远程 url 流式传输文件,而我在播放视频时不需要更改播放器。

我发现它适用于多个 mp3 文件。但我无法指出区别。有没有人有任何经验?我什至不知道这是否是一个可行的计划。

非常感谢。

最佳答案

currentPlaybackTime 似乎适用于视频。以下是 Apple Docs 中对该函数的描述。

For video-on-demand or progressively downloaded content, this value is measured in seconds from the beginning of the current item. Changing the value of this property moves the playhead to the new location. For content streamed live from a server, this value represents the time from the beginning of the playlist when it was first loaded.

你可以尝试使用[player setInitialPlaybackTime:xx.xx];

关于ios - 将 currentPlaybackTime 与 MPMoviePlayerController 一起用于 mp3 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17084257/

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