A collection of audio/video tracks. More...
Public Member Functions | |
void | addOnAudioDestroyed (fm.liveswitch.IAction0 value) |
Adds a handler that is raised when the audio track is destroyed. More... | |
void | addOnAudioLevel (fm.liveswitch.IAction1< Double > value) |
Adds a handler that is raised periodically when the audio's level is calculated. More... | |
void | addOnVideoDestroyed (fm.liveswitch.IAction0 value) |
Adds a handler that is raised when the video track is destroyed. More... | |
void | addOnVideoSize (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Adds a handler that is raised whenever the video's frame size is known, once per frame. More... | |
void | addOnVideoSizeChange (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Adds a handler that is raised whenever the video's frame size changes. More... | |
void | destroy () |
Destroys all non-persistent internal objects encapsulated by the Media class. More... | |
int | getAudioLevelInterval () |
Gets the interval in milliseconds between fm.liveswitch.Media#addOnAudioLevel events. More... | |
TAudioTrack[] | getAudioTracks () |
Gets all audio tracks from this media. More... | |
boolean | getIsRecordingAudio () |
Gets whether audio is being recorded locally. More... | |
boolean | getIsRecordingVideo () |
Gets whether video is being recorded locally. More... | |
fm.liveswitch.Size | getVideoSize () |
Gets the size of the video track. More... | |
TVideoTrack[] | getVideoTracks () |
Gets all video tracks from this media. More... | |
fm.liveswitch.Future< fm.liveswitch.VideoBuffer > | grabVideoFrame () |
Gets the next frame from the video track once it is rendered. More... | |
Media () | |
Initializes a new instance of the fm.liveswitch.Media class. More... | |
void | removeOnAudioDestroyed (fm.liveswitch.IAction0 value) |
Removes a handler that is raised when the audio track is destroyed. More... | |
void | removeOnAudioLevel (fm.liveswitch.IAction1< Double > value) |
Removes a handler that is raised periodically when the audio's level is calculated. More... | |
void | removeOnVideoDestroyed (fm.liveswitch.IAction0 value) |
Removes a handler that is raised when the video track is destroyed. More... | |
void | removeOnVideoSize (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Removes a handler that is raised whenever the video's frame size is known, once per frame. More... | |
void | removeOnVideoSizeChange (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Removes a handler that is raised whenever the video's frame size changes. More... | |
void | setAudioLevelInterval (int value) |
Sets the interval in milliseconds between fm.liveswitch.Media#addOnAudioLevel events. More... | |
Public Member Functions inherited from fm.liveswitch.MediaBase< TAudioTrack, TVideoTrack > | |
abstract void | addOnAudioDestroyed (fm.liveswitch.IAction0 value) |
Adds a handler that is raised when the audio track is destroyed. More... | |
abstract void | addOnAudioLevel (fm.liveswitch.IAction1< Double > value) |
Adds a handler that is raised periodically when the audio's level is calculated. More... | |
abstract void | addOnVideoDestroyed (fm.liveswitch.IAction0 value) |
Adds a handler that is raised when the video track is destroyed. More... | |
abstract void | addOnVideoSize (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Adds a handler that is raised whenever the video's frame size is known, once per frame. More... | |
abstract void | addOnVideoSizeChange (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Adds a handler that is raised whenever the video's frame size changes. More... | |
abstract void | destroy () |
Destroys this media stack. More... | |
double | getAudioGain () |
Gets the gain (input amplification) of the audio track. More... | |
abstract int | getAudioLevelInterval () |
Gets the interval in milliseconds between fm.liveswitch.MediaBase#addOnAudioLevel events. More... | |
boolean | getAudioMuted () |
Gets a value indicating whether the audio is muted. More... | |
TIAudioTrack | getAudioTrack () |
Gets the audio track from this media. More... | |
abstract TIAudioTrack[] | getAudioTracks () |
Gets all audio tracks from this media. More... | |
double | getAudioVolume () |
Gets the audio volume on the audio track. More... | |
String | getId () |
Gets the unique identifier of this media. More... | |
boolean | getVideoMuted () |
Gets a value indicating whether the video track is muted. More... | |
abstract fm.liveswitch.Size | getVideoSize () |
Gets the size of the last processed video frame, if known. More... | |
TIVideoTrack | getVideoTrack () |
Gets the video track from this media. More... | |
abstract TIVideoTrack[] | getVideoTracks () |
Gets all video tracks from this media. More... | |
abstract fm.liveswitch.Future< fm.liveswitch.VideoBuffer > | grabVideoFrame () |
Gets the next raw video frame. More... | |
MediaBase () | |
Initializes a new instance of the fm.liveswitch.MediaBase class. More... | |
abstract void | removeOnAudioDestroyed (fm.liveswitch.IAction0 value) |
Removes a handler that is raised when the audio track is destroyed. More... | |
abstract void | removeOnAudioLevel (fm.liveswitch.IAction1< Double > value) |
Removes a handler that is raised periodically when the audio's level is calculated. More... | |
abstract void | removeOnVideoDestroyed (fm.liveswitch.IAction0 value) |
Removes a handler that is raised when the video track is destroyed. More... | |
abstract void | removeOnVideoSize (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Removes a handler that is raised whenever the video's frame size is known, once per frame. More... | |
abstract void | removeOnVideoSizeChange (fm.liveswitch.IAction1< fm.liveswitch.Size > value) |
Removes a handler that is raised whenever the video's frame size changes. More... | |
void | setAudioGain (double value) |
Sets the gain (input amplification) of the audio track. More... | |
abstract void | setAudioLevelInterval (int value) |
Sets the interval in milliseconds between fm.liveswitch.MediaBase#addOnAudioLevel events. More... | |
void | setAudioMuted (boolean value) |
Sets a value indicating whether the audio is muted. More... | |
void | setAudioVolume (double value) |
Sets the audio volume on the audio track. More... | |
void | setId (String value) |
Sets the unique identifier of this media. More... | |
void | setVideoMuted (boolean value) |
Sets a value indicating whether the video track is muted. More... | |
Protected Member Functions | |
void | addAudioTrack (TAudioTrack audioTrack) |
Adds an audio track. More... | |
void | addVideoTrack (TVideoTrack videoTrack) |
Adds a video track. More... | |
abstract TAudioTrack[] | arrayFromAudioTracks (java.util.ArrayList< TAudioTrack > tracks) |
Creates an array of tracks from a list of audio tracks. More... | |
abstract TVideoTrack[] | arrayFromVideoTracks (java.util.ArrayList< TVideoTrack > tracks) |
Creates an array of tracks from a list of video tracks. More... | |
abstract java.util.ArrayList< TAudioTrack > | createAudioTrackCollection () |
Creates an audio track collection. More... | |
abstract java.util.ArrayList< TVideoTrack > | createVideoTrackCollection () |
Creates a video track collection. More... | |
boolean | removeAudioTrack (TAudioTrack audioTrack) |
Removes an audio track. More... | |
boolean | removeVideoTrack (TVideoTrack videoTrack) |
Removes a video track. More... | |
void | setIsRecordingAudio (boolean value) |
Sets whether audio is being recorded locally. More... | |
void | setIsRecordingVideo (boolean value) |
Sets whether video is being recorded locally. More... | |
A collection of audio/video tracks.
fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.Media | ( | ) |
Initializes a new instance of the fm.liveswitch.Media class.
|
protected |
Adds an audio track.
audioTrack | The audio track. |
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.addOnAudioDestroyed | ( | fm.liveswitch.IAction0 | value | ) |
Adds a handler that is raised when the audio track is destroyed.
If there are multiple audio tracks in a custom media stack, only the first audio track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.addOnAudioLevel | ( | fm.liveswitch.IAction1< Double > | value | ) |
Adds a handler that is raised periodically when the audio's level is calculated.
When the media is in the Started state, the function runs multiple times per second. The frequency depends on the audio sampling rate.
Use this method to determine which audio streams are active.
If there are multiple audio tracks in a custom media stack, only the first audio track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.addOnVideoDestroyed | ( | fm.liveswitch.IAction0 | value | ) |
Adds a handler that is raised when the video track is destroyed.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.addOnVideoSize | ( | fm.liveswitch.IAction1< fm.liveswitch.Size > | value | ) |
Adds a handler that is raised whenever the video's frame size is known, once per frame.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.addOnVideoSizeChange | ( | fm.liveswitch.IAction1< fm.liveswitch.Size > | value | ) |
Adds a handler that is raised whenever the video's frame size changes.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
|
protected |
Adds a video track.
videoTrack | The video track. |
|
abstractprotected |
Creates an array of tracks from a list of audio tracks.
tracks | The list of tracks. |
|
abstractprotected |
Creates an array of tracks from a list of video tracks.
tracks | The list of tracks. |
|
abstractprotected |
Creates an audio track collection.
Reimplemented in fm.liveswitch.LocalMedia.
|
abstractprotected |
Creates a video track collection.
Reimplemented in fm.liveswitch.LocalMedia.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.destroy | ( | ) |
Destroys all non-persistent internal objects encapsulated by the Media class.
This method iterates over all audio and video tracks and calls each track's Destroy method for non-persistent tracks.
Reimplemented in fm.liveswitch.RtcLocalMedia< TView >.
int fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getAudioLevelInterval | ( | ) |
Gets the interval in milliseconds between fm.liveswitch.Media#addOnAudioLevel events.
Defaults to 200.
TAudioTrack [] fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getAudioTracks | ( | ) |
Gets all audio tracks from this media.
boolean fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getIsRecordingAudio | ( | ) |
Gets whether audio is being recorded locally.
boolean fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getIsRecordingVideo | ( | ) |
Gets whether video is being recorded locally.
fm.liveswitch.Size fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getVideoSize | ( | ) |
Gets the size of the video track.
If there are multiple video tracks in a custom media stack, this property is bound to the first video track.
If you need to adjust a UI’s layout, use this property to check video dimensions. You can also use OnVideoSize to ensure that the code is responsive.
TVideoTrack [] fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.getVideoTracks | ( | ) |
Gets all video tracks from this media.
fm.liveswitch.Future<fm.liveswitch.VideoBuffer> fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.grabVideoFrame | ( | ) |
Gets the next frame from the video track once it is rendered.
If there are multiple video tracks in a custom media stack, this method calls into the first video track.
This method could be used for asynchronous video processing or analysis.
|
protected |
Removes an audio track.
audioTrack | The audio track. |
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.removeOnAudioDestroyed | ( | fm.liveswitch.IAction0 | value | ) |
Removes a handler that is raised when the audio track is destroyed.
If there are multiple audio tracks in a custom media stack, only the first audio track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.removeOnAudioLevel | ( | fm.liveswitch.IAction1< Double > | value | ) |
Removes a handler that is raised periodically when the audio's level is calculated.
When the media is in the Started state, the function runs multiple times per second. The frequency depends on the audio sampling rate.
Use this method to determine which audio streams are active.
If there are multiple audio tracks in a custom media stack, only the first audio track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.removeOnVideoDestroyed | ( | fm.liveswitch.IAction0 | value | ) |
Removes a handler that is raised when the video track is destroyed.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.removeOnVideoSize | ( | fm.liveswitch.IAction1< fm.liveswitch.Size > | value | ) |
Removes a handler that is raised whenever the video's frame size is known, once per frame.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.removeOnVideoSizeChange | ( | fm.liveswitch.IAction1< fm.liveswitch.Size > | value | ) |
Removes a handler that is raised whenever the video's frame size changes.
If there are multiple video tracks in a custom media stack, only the first video track triggers this event.
|
protected |
Removes a video track.
videoTrack | The video track. |
void fm.liveswitch.Media< TAudioTrack extends fm.liveswitch.AudioTrack, TVideoTrack extends fm.liveswitch.VideoTrack >.setAudioLevelInterval | ( | int | value | ) |
Sets the interval in milliseconds between fm.liveswitch.Media#addOnAudioLevel events.
Defaults to 200.
|
protected |
Sets whether audio is being recorded locally.
|
protected |
Sets whether video is being recorded locally.