AVPlayer - Add Seconds to CMTime

前端 未结 4 1039
说谎
说谎 2021-02-12 15:21

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

CMTime currentTime = music.currentTime;

I can´t use CMTimeGet

4条回答
  •  情歌与酒
    2021-02-12 15:22

    Here is one way:

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

提交回复
热议问题