Options
All
  • Public
  • Public/Protected
  • All
Menu

The MediaStore class is used for processing media streams.

Hierarchy

Index

Constructors

constructor

Properties

audioPlaybackDevices

audioPlaybackDevices: AGRtcDeviceInfo[]

The audio playback devices

audioRecordingDevices

audioRecordingDevices: AGRtcDeviceInfo[]

The audio sampling devices

Optional cameraDeviceId

cameraDeviceId?: string

The ID of the current video capturing device

Optional currentScreenShareDevice

currentScreenShareDevice?: AGScreenShareDevice

Currently capturing screen device

isMirror

isMirror: boolean

Whether the video is mirrored

localCameraTrackState

localCameraTrackState: AgoraRteMediaSourceState

The state of the local video capturing device

localLoopbackDeviceState

localLoopbackDeviceState: AgoraRteMediaSourceState

The state of the local loopback audio capturing device

localMicAudioVolume

localMicAudioVolume: number

Local mic audio volume range from [0,1]

localMicTrackState

localMicTrackState: AgoraRteMediaSourceState

The state of the local audio sampling device

localPlaybackTestVolume

localPlaybackTestVolume: number

Local playback test volume Range from [0,1]

localPreviewCameraTrackState

localPreviewCameraTrackState: AgoraRteMediaSourceState

The state of the local preview video capturing device

localPreviewMicAudioVolume

localPreviewMicAudioVolume: number

local preview mic audio volume range from [0,1]

localPreviewMicTrackState

localPreviewMicTrackState: AgoraRteMediaSourceState

The state of the local preview audio sampling device

localScreenShareAudioTrackState

localScreenShareAudioTrackState: AgoraRteMediaSourceState

The state of screen sharing of sound capturing device

localScreenShareTrackState

localScreenShareTrackState: AgoraRteMediaSourceState

The state of the local screen capturing device

Optional playbackDeviceId

playbackDeviceId?: string

The ID of the current video playback device

Optional recordingDeviceId

recordingDeviceId?: string

The ID of the current audio sampling device

videoCameraDevices

videoCameraDevices: AGRtcDeviceInfo[]

The video capturing devices

Methods

addAudioRawDataObserver

addCameraProcessors

  • addCameraProcessors(processors: IBaseProcessor[]): void
  • Parameters

    • processors: IBaseProcessor[]

      preprocessor for the camera track Adds the pre-processors to the local camera track

    Returns void

addMicrophoneProcessors

  • addMicrophoneProcessors(processors: IBaseProcessor[]): void
  • Adds the pre-processors to the local microphone track

    Parameters

    • processors: IBaseProcessor[]

      preprocessor for the microphone track

    Returns void

addPreviewCameraProcessors

  • addPreviewCameraProcessors(processors: IBaseProcessor[]): void
  • Parameters

    • processors: IBaseProcessor[]

      Adds the pre-processors to the local camera track(For preview)

    Returns void

addPreviewMicrophoneProcessors

  • addPreviewMicrophoneProcessors(processors: IBaseProcessor[]): void
  • Adds the pre-processors to the local microphone track(For preview)

    Parameters

    • processors: IBaseProcessor[]

    Returns void

addRawDataListener

  • addRawDataListener(cb: (buffer: AudioBuffer) => void): void
  • deprecated

    Add an audio raw data observer

    Parameters

    • cb: (buffer: AudioBuffer) => void

      订阅者

        • (buffer: AudioBuffer): void
        • Parameters

          • buffer: AudioBuffer

          Returns void

    Returns void

enableDualStream

  • Enables dual stream

    Parameters

    Returns Promise<void>

enableLocalAudio

  • enableLocalAudio(value: boolean): void
  • Enables or disables the local audio

    Parameters

    • value: boolean

      boolean

    Returns void

enableLocalPlayback

  • enableLocalPlayback(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

enableLocalVideo

  • enableLocalVideo(value: boolean): void
  • Enables or disables the local video

    Parameters

    • value: boolean

      boolean

    Returns void

getDisplayDevices

  • Gets a list of display devices that can be captured

    Returns Promise<AGScreenShareDevice[]>

    A list of application windows

getMediaTrackPlayer

  • getMediaTrackPlayer(streamUrl: string): undefined | StreamMediaPlayer
  • Get a stream media track by stream URL

    Parameters

    • streamUrl: string

      Video URL to play

    Returns undefined | StreamMediaPlayer

    Video player object that controls audio and video playback

getSnapshot

  • getSnapshot(channel: string, streamUuid: number, filePath: string): Promise<void | AGSnapshotInfo>
  • Takes a snapshot from a video stream (Only for Electron). The snapshot is saved to the local folder that you specify in the JPG format.

    Parameters

    • channel: string

      The ID of the RTC channel. You can set this parameter as roomUuid.

    • streamUuid: number

      The stream ID.

    • filePath: string

      The absolute path for saving the snapshot.

    Returns Promise<void | AGSnapshotInfo>

    Snapshot info

getSnapshotRgba

  • getSnapshotRgba(channel: string, streamUuid: number): undefined | ImageData
  • Takes a snapshot from a video stream (Only for Web). This method returns an ImageData object, which contains the data in the RGBA order.

    Parameters

    • channel: string

      The ID of the RTC channel. You can set this parameter as roomUuid.

    • streamUuid: number

      The stream ID.

    Returns undefined | ImageData

    Snapshot info

getWindowDevices

  • Gets a list of application windows that can be captured

    Returns Promise<AGScreenShareDevice[]>

    A list of application windows

hasScreenSharePermission

  • hasScreenSharePermission(): boolean
  • Check whether the permission of screen capture is granted

    Returns boolean

    Whether the permission for screen capture is granted

isScreenDeviceEnumerateSupported

  • isScreenDeviceEnumerateSupported(): boolean
  • Checks whether a list of screen capture devices can be obtained

    Returns boolean

    Whether a list of screen capture devices can be obtained

onDestroy

  • onDestroy(): void

onInstall

  • onInstall(): void

removeAudioRawDataObserver

removeCameraProcessors

  • removeCameraProcessors(): void
  • Removes all camera track processors

    Returns void

removeMicrophoneProcessors

  • removeMicrophoneProcessors(): void
  • Removes all microphone track processors

    Returns void

removePreviewCameraProcessors

  • removePreviewCameraProcessors(): void
  • Removes all camera track processors(For preview)

    Returns void

removePreviewMicrophoneProcessors

  • removePreviewMicrophoneProcessors(): void
  • Removes all microphone track processors(For preview)

    Returns void

removeRawDataListener

  • removeRawDataListener(cb: (buffer: AudioBuffer) => void): void
  • deprecated

    Remove an audio raw data observer

    Parameters

    • cb: (buffer: AudioBuffer) => void
        • (buffer: AudioBuffer): void
        • Parameters

          • buffer: AudioBuffer

          Returns void

    Returns void

setAudioRawDataConfig

setCameraDevice

  • setCameraDevice(id: string): void
  • Sets the local camera device ID

    Parameters

    • id: string

      Device ID

    Returns void

setCurrentScreenShareDevice

  • Set the device that is currently screen sharing

    Parameters

    Returns void

setLowStreamParameter

  • Sets resolution and frame rate of the low-quality stream

    Parameters

    Returns void

setMirror

  • setMirror(v: boolean): void
  • Set mirror

    Parameters

    • v: boolean

      Enable mirror for local video or not

    Returns void

setPlaybackDevice

  • setPlaybackDevice(id: string): void
  • set playback device ID

    Parameters

    • id: string

      Device ID

    Returns void

setRecordingDevice

  • setRecordingDevice(id: string): void
  • Sets the local recording device ID

    Parameters

    • id: string

      Device ID

    Returns void

setupLocalScreenShare

  • setupLocalScreenShare(dom: HTMLElement): void
  • Sets a node for rendering the local screen-sharing stream

    Parameters

    • dom: HTMLElement

      The rendering node

    Returns void

setupLocalVideo

  • setupLocalVideo(dom: HTMLElement, mirror: boolean, renderMode?: AGRenderMode): void
  • Setup local video

    Parameters

    • dom: HTMLElement

      render node

    • mirror: boolean

      enable mirror

    • Optional renderMode: AGRenderMode

    Returns void

setupMediaStream

  • setupMediaStream(streamUrl: string, dom: HTMLElement, mirror: boolean, playVideo: boolean, playAudio: boolean): void
  • Play a media stream

    Parameters

    • streamUrl: string

      hls url

    • dom: HTMLElement
    • mirror: boolean
    • playVideo: boolean
    • playAudio: boolean

    Returns void

startLoopbackRecording

  • startLoopbackRecording(params?: { audioDeviceName?: string; connType?: AGRtcConnectionType }): void
  • Start loopback recording

    Parameters

    • Optional params: { audioDeviceName?: string; connType?: AGRtcConnectionType }

      Optional parameter object, including audio device name and connection type

    Returns void

startPlaybackDeviceTest

  • startPlaybackDeviceTest(url: string): void
  • Starts the playback device test Base64 audio data not support on Electron platform

    Parameters

    • url: string

      resouce url

    Returns void

startRecordingDeviceTest

  • startRecordingDeviceTest(indicateInterval: number): void
  • Starts the audio device test

    Parameters

    • indicateInterval: number

      The indication interval (ms).

    Returns void

startScreenShareCapture

  • startScreenShareCapture(params?: { audioDeviceName?: string; id?: string; type?: AGScreenShareType; withAudio?: boolean }): void
  • Parameters

    • Optional params: { audioDeviceName?: string; id?: string; type?: AGScreenShareType; withAudio?: boolean }
      • Optional audioDeviceName?: string
      • Optional id?: string
      • Optional type?: AGScreenShareType
      • Optional withAudio?: boolean

    Returns void

stopLoopbackRecording

  • Stop loopback recording

    Parameters

    Returns void

stopPlaybackDeviceTest

  • stopPlaybackDeviceTest(): void
  • Stops the playback device test

    Returns void

stopRecordingDeviceTest

  • stopRecordingDeviceTest(): void
  • Stops the audio device test

    Returns void

stopScreenShareCapture

  • stopScreenShareCapture(params?: { withAudio?: boolean }): void
  • Stops sharing the screen withAudio: whether to close loopback recording simultaneously, Default to: True

    Parameters

    • Optional params: { withAudio?: boolean }
      • Optional withAudio?: boolean

    Returns void

updateLocalMediaState