AVPlayer.AddPeriodicTimeObserver Method

Definition

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
queue
DispatchQueue

To be added.

This parameter can be null.

handler
Action<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>