I can’t seem to figure out how to convert TimeInterval to CMTime. Does it need more than just a simple conversion method?
You can write something like this:
let timeIntvl: TimeInterval = 60
let cmTime = CMTime(seconds: timeIntvl, preferredTimescale: 1000000)
1000000
represents that the preferred Timescale is 1μsec (1/1000000 sec).
When you convert between some types, there's usually no simple conversion method and you may need to find an initializer of the destination type.
init(seconds: Double, preferredTimescale: CMTimeScale)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With