如何更改视频播放的速度 [英] How to change the speed of video playback
问题描述
我想知道是否可以在 iphone 应用程序中更改视频播放速度.我们希望用户对着麦克风大喊大叫以加快播放速度并播放到最后.
I'm wondering if it's possible to change the video playback speed in an iphone application. we want users to yell in the microphone to speed up the playback and get to the end.
推荐答案
AVPlayer
有一个 rate
属性.
如果您在资源部分采用 Apple 的名为avPlayerDemo"的示例,那么您只需设置 mplayer.rate
.它对我有用,我在 xib 文件中创建了一个新滑块,在 AVPlayerDemoPlaybackViewController
中实现了该滑块,然后简单地将 mPlayer.rate
设置为滑块值.
If you take the example from Apple called "avPlayerDemo" in the resource section, you then simply have to set the mplayer.rate
. It worked for me, I created a new slider in the xib files, implemented that slider in the AVPlayerDemoPlaybackViewController
and simply set mPlayer.rate
to the slider value.
这篇关于如何更改视频播放的速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!