views:

138

answers:

1

I want to use the method Seek of the class AVPlayer. But this method take a parameter CMTime. Could anyone knows about this object.

In order to move the playback cursor to a given time.

A: 

The Apple documentation contains information on the CMTime struct.

As I understand it, you set the "TimeScale" to a timescale suitable for the media (e.g. 44100 = 1/44100 sec - which might be suitable for a CD). Then the "Value" represents units of that timescale. So, a value of 88200 would be 2 secs.

CMTime cmTime = new CMTime();
cmTime.TimeScale = 44100;
cmTime.Value = 88200;

Isn't too clear though, I'll grant you.

dommer
Not It's very clear !! i have tested it this morning and it's work well !!! Thank you for your help
Kalonji