FMLiveSwitchLocalMedia Class Reference

A collection of local audio/video tracks. More...

Instance Methods

(void) - addAudioTrack:
 Adds the audio track. More...
 
(void) - addOnAudioMuted:
 Adds a handler that is raised when the audio source is muted. More...
 
(void) - addOnAudioStarted:
 Adds a handler that is raised when the first audio track is started. More...
 
(void) - addOnAudioStopped:
 Adds a handler that is raised when the first audio track is stopped. More...
 
(void) - addOnAudioUnmuted:
 Adds a handler that is raised when the audio source is unmuted. More...
 
(void) - addOnVideoMuted:
 Adds a handler that is raised when the video source is muted. More...
 
(void) - addOnVideoStarted:
 Adds a handler that is raised when the first video track is started. More...
 
(void) - addOnVideoStopped:
 Adds a handler that is raised when the first video track is stopped. More...
 
(void) - addOnVideoUnmuted:
 Adds a handler that is raised when the video source is unmuted. More...
 
(void) - addVideoTrack:
 Adds the video track. More...
 
(NSMutableArray *) - arrayFromAudioTracks:
 Creates an array of tracks from a list of audio tracks. More...
 
(NSMutableArray *) - arrayFromVideoTracks:
 Creates an array of tracks from a list of video tracks. More...
 
(FMLiveSwitchAudioSource *) - audioSource
 Gets the audio source. More...
 
(FMLiveSwitchSourceInput *) - audioSourceInput
 Gets the current audio source input of the audio track. More...
 
(NSMutableArray *) - audioSources
 Gets the audio sources. More...
 
(FMLiveSwitchFuture< id > *) - changeAudioSourceInput:
 Changes the audio source input of the audio track while the media is active. More...
 
(FMLiveSwitchFuture< id > *) - changeVideoSourceInput:
 Changes the video source input of the video track while the media is active. More...
 
(NSMutableArray< FMLiveSwitchAudioTrack * > *) - createAudioTrackCollection
 Creates an audio track collection. More...
 
(NSMutableArray< FMLiveSwitchVideoTrack * > *) - createVideoTrackCollection
 Creates a video track collection. More...
 
(NSMutableArray *) - doGetAudioEncodings
 Gets the array of local audio encoding configurations. More...
 
(NSMutableArray *) - doGetVideoEncodings
 Gets the local video encodings. More...
 
(void) - doSetAudioEncodings:
 Sets the local audio encodings. More...
 
(void) - doSetVideoEncodings:
 Sets the local video encodings. More...
 
(FMLiveSwitchFuture< FMLiveSwitchLocalMedia * > *) - doStart
 Starts the local media. More...
 
(FMLiveSwitchFuture< FMLiveSwitchLocalMedia * > *) - doStop
 Stops the local media. More...
 
(FMLiveSwitchFuture< NSMutableArray * > *) - getAudioSourceInputs
 Gets a list of the names and IDs of currently available audio devices. More...
 
(FMLiveSwitchFuture< NSMutableArray * > *) - getVideoSourceInputs
 Gets a list of the names and IDs of currently available video devices. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class. More...
 
(NSMutableArray *) - mediaSources
 Gets the audio/video sources. More...
 
(bool) - removeAudioTrack:
 Removes the audio track. More...
 
(void) - removeOnAudioMuted:
 Removes a handler that is raised when the audio source is muted. More...
 
(void) - removeOnAudioStarted:
 Removes a handler that is raised when the first audio track is started. More...
 
(void) - removeOnAudioStopped:
 Removes a handler that is raised when the first audio track is stopped. More...
 
(void) - removeOnAudioUnmuted:
 Removes a handler that is raised when the audio source is unmuted. More...
 
(void) - removeOnVideoMuted:
 Removes a handler that is raised when the video source is muted. More...
 
(void) - removeOnVideoStarted:
 Removes a handler that is raised when the first video track is started. More...
 
(void) - removeOnVideoStopped:
 Removes a handler that is raised when the first video track is stopped. More...
 
(void) - removeOnVideoUnmuted:
 Removes a handler that is raised when the video source is unmuted. More...
 
(bool) - removeVideoTrack:
 Removes the video track. More...
 
(void) - setAudioSourceInput:
 Sets the current audio source input of the audio track. More...
 
(void) - setVideoSourceInput:
 Sets the current video source input of the video track. More...
 
(FMLiveSwitchVideoSource *) - videoSource
 Gets the video source. More...
 
(FMLiveSwitchSourceInput *) - videoSourceInput
 Gets the current video source input of the video track. More...
 
(NSMutableArray *) - videoSources
 Gets the video sources. More...
 
- Instance Methods inherited from FMLiveSwitchLocalMediaBase
(void) - abortStartWithPromise:exception:
 Aborts the start. More...
 
(FMLiveSwitchAudioEncodingConfig *) - audioEncoding
 Gets the local audio encoding configuration. More...
 
(NSMutableArray *) - audioEncodings
 Gets the local audio encoding configurations. More...
 
(bool) - audioSimulcastDisabled
 Gets whether audio simulcast is disabled. More...
 
(int) - audioSimulcastEncodingCount
 Gets the maximum number of simulcast encodings that this media produces for the audio stream. More...
 
(int) - audioSimulcastPreferredBitrate
 Gets the preferred audio simulcast bitrate, in kbps. More...
 
(void) - lockAudioEncodings
 Locks the audio encodings in prior to initialization. More...
 
(void) - lockVideoEncodings
 Locks the video encodings in prior to initialization. More...
 
(void) - lockVideoEncodingsWithSourceType:
 Locks the video encodings in prior to initialization. More...
 
(void) - lockVideoEncodingsWithSourceType:sourceWidth:sourceHeight:sourceFrameRate:
 Locks the video encodings in prior to initialization. More...
 
(void) - setAudioEncodings:
 Sets the local audio encoding configurations. More...
 
(void) - setAudioSimulcastDisabled:
 Sets whether audio simulcast is disabled. More...
 
(void) - setAudioSimulcastEncodingCount:
 Sets the maximum number of simulcast encodings that this media produces for the audio stream. More...
 
(void) - setAudioSimulcastPreferredBitrate:
 Sets the preferred audio simulcast bitrate, in kbps. More...
 
(void) - setVideoEncodings:
 Sets the local video encoding configurations. More...
 
(void) - setVideoSimulcastBitsPerPixel:
 Sets the video simulcast bits per pixel (bpp). More...
 
(void) - setVideoSimulcastDegradationPreference:
 Sets the video’s simulcast degradation preference. More...
 
(void) - setVideoSimulcastDisabled:
 Sets whether video simulcast is disabled. More...
 
(void) - setVideoSimulcastEncodingCount:
 Sets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. More...
 
(void) - setVideoSimulcastPreferredBitrate:
 Sets the preferred bitrate of a video simulcast in Kbps. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - start
 Starts media track sources. More...
 
(FMLiveSwitchLocalMediaState) - state
 Gets the current state of this media. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - stop
 Stops media track sources. More...
 
(FMLiveSwitchVideoEncodingConfig *) - videoEncoding
 Gets the local video encoding configuration. More...
 
(NSMutableArray *) - videoEncodings
 Gets the local video encoding configurations. More...
 
(double) - videoSimulcastBitsPerPixel
 Gets the video simulcast bits per pixel (bpp). More...
 
(FMLiveSwitchVideoDegradationPreference) - videoSimulcastDegradationPreference
 Gets the video’s simulcast degradation preference. More...
 
(bool) - videoSimulcastDisabled
 Gets whether video simulcast is disabled. More...
 
(int) - videoSimulcastEncodingCount
 Gets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. More...
 
(int) - videoSimulcastPreferredBitrate
 Gets the preferred bitrate of a video simulcast in Kbps. More...
 

Class Methods

(FMLiveSwitchLocalMedia *) + localMedia
 
- Class Methods inherited from FMLiveSwitchLocalMediaBase
(double) + defaultVideoBitsPerPixel
 Gets the default bits-per-pixel for video. More...
 
(FMLiveSwitchLocalMediaBase *) + localMediaBase
 Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class. More...
 
(void) + setDefaultVideoBitsPerPixel:
 Sets the default bits-per-pixel for video. More...
 

Additional Inherited Members

- Protected Attributes inherited from FMLiveSwitchLocalMediaBase
 __pad0__: FMLiveSwitchMedia<TAudioTrack
 

Detailed Description

A collection of local audio/video tracks.

Method Documentation

◆ addAudioTrack:

- (void) addAudioTrack: (FMLiveSwitchAudioTrack *)  audioTrack

Adds the audio track.

Parameters
audioTrackThe audio track.

◆ addOnAudioMuted:

- (void) addOnAudioMuted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the audio source is muted.

◆ addOnAudioStarted:

- (void) addOnAudioStarted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the first audio track is started.

◆ addOnAudioStopped:

- (void) addOnAudioStopped: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the first audio track is stopped.

◆ addOnAudioUnmuted:

- (void) addOnAudioUnmuted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the audio source is unmuted.

◆ addOnVideoMuted:

- (void) addOnVideoMuted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the video source is muted.

◆ addOnVideoStarted:

- (void) addOnVideoStarted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the first video track is started.

◆ addOnVideoStopped:

- (void) addOnVideoStopped: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the first video track is stopped.

◆ addOnVideoUnmuted:

- (void) addOnVideoUnmuted: (FMLiveSwitchAction0 *)  value

Adds a handler that is raised when the video source is unmuted.

◆ addVideoTrack:

- (void) addVideoTrack: (FMLiveSwitchVideoTrack *)  videoTrack

Adds the video track.

Parameters
videoTrackThe video track.

◆ arrayFromAudioTracks:

- (NSMutableArray*) arrayFromAudioTracks: (NSMutableArray< FMLiveSwitchAudioTrack * > *)  tracks

Creates an array of tracks from a list of audio tracks.

Parameters
tracksThe list of tracks.

◆ arrayFromVideoTracks:

- (NSMutableArray*) arrayFromVideoTracks: (NSMutableArray< FMLiveSwitchVideoTrack * > *)  tracks

Creates an array of tracks from a list of video tracks.

Parameters
tracksThe list of tracks.

◆ audioSource

- (FMLiveSwitchAudioSource*) audioSource

Gets the audio source.

◆ audioSourceInput

- (FMLiveSwitchSourceInput*) audioSourceInput

Gets the current audio source input of the audio track.


If there are multiple audio tracks in a custom media stack, this property is bound to the first audio track.
The audio source input can only be set before the media has started. If the audio source input is not set, then the default input device is used.
If you want to change the input after the media has started, call ChangeAudioSourceInput instead. ChangeAudioSourceInput stops the current audio input and switch to the new input.

◆ audioSources

- (NSMutableArray*) audioSources

Gets the audio sources.

◆ changeAudioSourceInput:

- (FMLiveSwitchFuture<id>*) changeAudioSourceInput: (FMLiveSwitchSourceInput *)  audioSourceInput

Changes the audio source input of the audio track while the media is active.

If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.
For example, this method can be used to change the audio source's input on a laptop from the device microphone to a USB headset.

Parameters
audioSourceInputThe audio source input.

◆ changeVideoSourceInput:

- (FMLiveSwitchFuture<id>*) changeVideoSourceInput: (FMLiveSwitchSourceInput *)  videoSourceInput

Changes the video source input of the video track while the media is active.

If there are multiple video tracks in a custom media stack, this method calls into the first video track.
For example, this method can be used to change the video source’s input on a mobile device from a front to a back camera.

Parameters
videoSourceInputThe video source input.

◆ createAudioTrackCollection

- (NSMutableArray<FMLiveSwitchAudioTrack*>*) createAudioTrackCollection

Creates an audio track collection.

◆ createVideoTrackCollection

- (NSMutableArray<FMLiveSwitchVideoTrack*>*) createVideoTrackCollection

Creates a video track collection.

◆ doGetAudioEncodings

- (NSMutableArray*) doGetAudioEncodings

Gets the array of local audio encoding configurations.

Returns
The local audio encodings.

Implements FMLiveSwitchLocalMediaBase.

◆ doGetVideoEncodings

- (NSMutableArray*) doGetVideoEncodings

Gets the local video encodings.

Returns
The local video encodings.

Implements FMLiveSwitchLocalMediaBase.

◆ doSetAudioEncodings:

- (void) doSetAudioEncodings: (NSMutableArray *)  encodings

Sets the local audio encodings.

Parameters
encodingsThe local audio encodings.

Implements FMLiveSwitchLocalMediaBase.

◆ doSetVideoEncodings:

- (void) doSetVideoEncodings: (NSMutableArray *)  encodings

Sets the local video encodings.

Parameters
encodingsThe local video encodings.

Implements FMLiveSwitchLocalMediaBase.

◆ doStart

Starts the local media.

Implements FMLiveSwitchLocalMediaBase.

◆ doStop

Stops the local media.

Implements FMLiveSwitchLocalMediaBase.

◆ getAudioSourceInputs

- (FMLiveSwitchFuture<NSMutableArray*>*) getAudioSourceInputs

Gets a list of the names and IDs of currently available audio devices.


Returns
A future with an array of audio source inputs.

◆ getVideoSourceInputs

- (FMLiveSwitchFuture<NSMutableArray*>*) getVideoSourceInputs

Gets a list of the names and IDs of currently available video devices.


Returns
A future with an array of video source inputs.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class.

Implements FMLiveSwitchLocalMediaBase.

◆ localMedia

+ (FMLiveSwitchLocalMedia*) localMedia

◆ mediaSources

- (NSMutableArray*) mediaSources

Gets the audio/video sources.

◆ removeAudioTrack:

- (bool) removeAudioTrack: (FMLiveSwitchAudioTrack *)  audioTrack

Removes the audio track.

Parameters
audioTrackThe audio track.

◆ removeOnAudioMuted:

- (void) removeOnAudioMuted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the audio source is muted.

◆ removeOnAudioStarted:

- (void) removeOnAudioStarted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the first audio track is started.

◆ removeOnAudioStopped:

- (void) removeOnAudioStopped: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the first audio track is stopped.

◆ removeOnAudioUnmuted:

- (void) removeOnAudioUnmuted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the audio source is unmuted.

◆ removeOnVideoMuted:

- (void) removeOnVideoMuted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the video source is muted.

◆ removeOnVideoStarted:

- (void) removeOnVideoStarted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the first video track is started.

◆ removeOnVideoStopped:

- (void) removeOnVideoStopped: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the first video track is stopped.

◆ removeOnVideoUnmuted:

- (void) removeOnVideoUnmuted: (FMLiveSwitchAction0 *)  value

Removes a handler that is raised when the video source is unmuted.

◆ removeVideoTrack:

- (bool) removeVideoTrack: (FMLiveSwitchVideoTrack *)  videoTrack

Removes the video track.

Parameters
videoTrackThe video track.

◆ setAudioSourceInput:

- (void) setAudioSourceInput: (FMLiveSwitchSourceInput *)  value

Sets the current audio source input of the audio track.


If there are multiple audio tracks in a custom media stack, this property is bound to the first audio track.
The audio source input can only be set before the media has started. If the audio source input is not set, then the default input device is used.
If you want to change the input after the media has started, call ChangeAudioSourceInput instead. ChangeAudioSourceInput stops the current audio input and switch to the new input.

◆ setVideoSourceInput:

- (void) setVideoSourceInput: (FMLiveSwitchSourceInput *)  value

Sets the current video source input of the video track.


If there are multiple video tracks in a custom media stack, this property is bound to the first video track.
The video source input can only be set before the media has started. If the video source input is not set, then the default input device is used.
If you want to change the input after the media has started, call ChangeVideoSourceInput instead. ChangeVideoSourceInput stops the current audio input and switch to the new input.

◆ videoSource

- (FMLiveSwitchVideoSource*) videoSource

Gets the video source.

◆ videoSourceInput

- (FMLiveSwitchSourceInput*) videoSourceInput

Gets the current video source input of the video track.


If there are multiple video tracks in a custom media stack, this property is bound to the first video track.
The video source input can only be set before the media has started. If the video source input is not set, then the default input device is used.
If you want to change the input after the media has started, call ChangeVideoSourceInput instead. ChangeVideoSourceInput stops the current audio input and switch to the new input.

◆ videoSources

- (NSMutableArray*) videoSources

Gets the video sources.