AVPlayer-将秒添加到CMTime [英] AVPlayer - Add Seconds to CMTime

查看:144
本文介绍了AVPlayer-将秒添加到CMTime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将我的当前播放时间增加5秒?
实际上这是我的代码:

How can I add 5 seconds to my current playing Time?
Actually this is my code:

CMTime currentTime = music.currentTime;

我不能使用CMTimeGetSeconds(),因为我需要CMTime格式.

I can´t use CMTimeGetSeconds() , because I need the CMTime format.

谢谢您的回答...

如何为CMTime设置变量?

How can I set a variable for CMTime?

推荐答案

这是一种方法:

CMTimeMakeWithSeconds(CMTimeGetSeconds(music.currentTime) + 5, music.currentTime.timescale);

这篇关于AVPlayer-将秒添加到CMTime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆