AVPlayer.AddPeriodicTimeObserver Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes handler
every interval
seconds, as well as on playback start, stop, and jump.
[Foundation.Export("addPeriodicTimeObserverForInterval:queue:usingBlock:")]
public virtual Foundation.NSObject AddPeriodicTimeObserver (CoreMedia.CMTime interval, CoreFoundation.DispatchQueue queue, Action<CoreMedia.CMTime> handler);
abstract member AddPeriodicTimeObserver : CoreMedia.CMTime * CoreFoundation.DispatchQueue * Action<CoreMedia.CMTime> -> Foundation.NSObject
override this.AddPeriodicTimeObserver : CoreMedia.CMTime * CoreFoundation.DispatchQueue * Action<CoreMedia.CMTime> -> Foundation.NSObject
Parameters
- interval
- CMTime
Returns
An opaque object that must be passed as the observer
argument to RemoveTimeObserver(NSObject) .
- Attributes
Remarks
The handler
may be invoked on a background thread. It is the application developer's responsibility to ensure that any UI manipulation performed by the handler
is done on the main thread (see InvokeOnMainThread(Selector, NSObject)).
handler
is additionally invoked whenever time jumps during playback and when playback starts or stops.
Applies to
See also
- <xref:AVFoundation.AVPlayer.RemoveTimeObserver>
- <xref:AVFoundation.AVPlayer.AddBoundaryTimeObserver>