Share via


AVSampleBufferAudioRenderer.Notifications.ObserveAudioRendererWasFlushedAutomatically Method

Definition

Overloads

ObserveAudioRendererWasFlushedAutomatically(EventHandler<AudioRendererWasFlushedAutomaticallyEventArgs>)

Strongly typed notification for the AudioRendererWasFlushedAutomaticallyNotification constant.

public static Foundation.NSObject ObserveAudioRendererWasFlushedAutomatically(EventHandler<AVFoundation.AudioRendererWasFlushedAutomaticallyEventArgs> handler);
static member ObserveAudioRendererWasFlushedAutomatically : EventHandler<AVFoundation.AudioRendererWasFlushedAutomaticallyEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<AudioRendererWasFlushedAutomaticallyEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to AudioRendererWasFlushedAutomaticallyNotification notifications.

// Listen to all notifications posted for any object
var token = AVSampleBufferAudioRenderer.Notifications.ObserveAudioRendererWasFlushedAutomatically ((notification) => {
  Console.WriteLine ("Observed AudioRendererWasFlushedAutomaticallyNotification!");
};

// Stop listening for notifications
token.Dispose ();

Applies to

ObserveAudioRendererWasFlushedAutomatically(NSObject, EventHandler<AudioRendererWasFlushedAutomaticallyEventArgs>)

Strongly typed notification for the AudioRendererWasFlushedAutomaticallyNotification constant.

public static Foundation.NSObject ObserveAudioRendererWasFlushedAutomatically(Foundation.NSObject objectToObserve, EventHandler<AVFoundation.AudioRendererWasFlushedAutomaticallyEventArgs> handler);
static member ObserveAudioRendererWasFlushedAutomatically : Foundation.NSObject * EventHandler<AVFoundation.AudioRendererWasFlushedAutomaticallyEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<AudioRendererWasFlushedAutomaticallyEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to AudioRendererWasFlushedAutomaticallyNotification notifications.

// Listen to all notifications posted for a single object
var token = AVSampleBufferAudioRenderer.Notifications.ObserveAudioRendererWasFlushedAutomatically (objectToObserve, (notification) => {
  Console.WriteLine ($"Observed AudioRendererWasFlushedAutomaticallyNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

Applies to