GPUImageMovie播放控件 [英] GPUImageMovie playback controls
问题描述
我正在尝试控制GPUImageMovie的播放。
我想要存档的是从一个帧跳到另一个帧(seekToTime后退和前进,滑动控制)而不是播放视频,但我不明白它是否为此用途而设计的组件。
I'm trying to control the playback of a GPUImageMovie. What I would like to archive is jump from a frame to another (seekToTime back and forward, swipe controlled) rather then play the video, but I don't understand if the component it's designed for this use.
GPUImageMovie - > filters - > GPUImageView
GPUImageMovie -> filters -> GPUImageView
我试过在playerItem上使用AVPlayer,但显然它是null。
I've tried to use an AVPlayer on playerItem, but apparetly it's null.
推荐答案
您可以使用 AVPlayer
获取控制视频:create GPUImageMovie
使用 AVPlayerItem
,这样你就可以使用 AVPlayer
来控制你的视频方法。
You can use AVPlayer
for control video: create GPUImageMovie
by using AVPlayerItem
, so you can control your video by using AVPlayer
methods.
示例:
NSURL *mediaURL = ...
AVPlayer *mainPlayer = [[AVPlayer alloc] init];
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithURL:mediaUrl];
[mainPlayer replaceCurrentItemWithPlayerItem:playerItem];
GPUImageMovie *currentMovieFile = [[GPUImageMovie alloc] initWithPlayerItem:playerItem];
[currentMovieFile addTarget:...];
[currentMovieFile startProcessing];
这篇关于GPUImageMovie播放控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!