Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

播放进度条 #9

Closed
lyatcomit opened this issue Aug 26, 2016 · 1 comment
Closed

播放进度条 #9

lyatcomit opened this issue Aug 26, 2016 · 1 comment

Comments

@lyatcomit
Copy link

我想播放的时候有播放进度条,拖动进度条改变视频播放的位置,怎么弄?多谢!

@casatwy
Copy link
Owner

casatwy commented Aug 26, 2016

CTVideoView有一个time的category

你通过- (void)setShouldObservePlayTime:(BOOL)shouldObservePlayTime withTimeGapToObserve:(CGFloat)timeGapToObserve设置shouldObservePlayTime为YES,以及监听的间隔(每隔0.5秒告知一次当前播放时间还是每隔1秒告知一次播放时间,这个间隔你可以自己定)。

然后把timeDelegate赋值过去,这样你就会知道当前视频总时长、当前视频播放的时间,根据这个你就能绘制出进度条。

最后这个category下有- (void)moveToSecond:(CGFloat)second shouldPlay:(BOOL)shouldPlay方法,拖动进度条之后,把要跳转的秒数,和跳转之后是否要播放传给这个函数就可以了。

@casatwy casatwy closed this as completed Aug 26, 2016
@hoowang hoowang mentioned this issue Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants