Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Methods

Abstract enableAux

  • enableAux(enable: boolean): Promise<void>
  • Whether to mix the player's sound into the stream being published.

    This interface will only mix the media player sound into the main channel

    Parameters

    • enable: boolean

      Aux audio flag. The default is false.

    Returns Promise<void>

Abstract enableRepeat

  • enableRepeat(enable: boolean): Promise<void>
  • Whether to repeat playback.

    Parameters

    • enable: boolean

      repeat playback flag. The default is false.

    Returns Promise<void>

Abstract getAudioTrackCount

  • getAudioTrackCount(): Promise<number>
  • Get the number of audio tracks of the playback file.

    Returns Promise<number>

    Number of audio tracks

Abstract getCurrentProgress

  • getCurrentProgress(): Promise<number>
  • Get current playing progress.

    You should load resource before invoking this function, otherwise the return value is 0

    Returns Promise<number>

    current progress

Abstract getCurrentRenderingProgress

  • getCurrentRenderingProgress(): Promise<number>
  • Get current rendering progress.

    You should load resource before invoking this function, otherwise the return value is 0

    Returns Promise<number>

    current rendering progress

Abstract getCurrentState

  • Get the current playback status.

    Returns Promise<ZegoMediaPlayerState>

    current state

Abstract getIndex

  • getIndex(): number
  • Get media player index.

    Description: Get media player index. When to call: It can be called after [createMediaPlayer]. Restrictions: None.

    Returns number

    Media player index.

Abstract getPlayVolume

  • getPlayVolume(): Promise<number>
  • Gets the current local playback volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.

    Returns Promise<number>

    current volume

Abstract getPublishVolume

  • getPublishVolume(): Promise<number>
  • Gets the current publish volume of the mediaplayer, the range is 0 ~ 200, with the default value of 60.

    Returns Promise<number>

    current volume

Abstract getTotalDuration

  • getTotalDuration(): Promise<number>
  • Get the total progress of your media resources.

    You should load resource before invoking this function, otherwise the return value is 0

    Returns Promise<number>

    Unit is millisecond

Abstract loadResource

  • Load local or network media resource.

    Available: since 1.3.4 Description: Load media resources. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming. When to call: It can be called after the engine by [createEngine] has been initialized and the media player has been created by [createMediaPlayer]. Related APIs: Resources can be loaded through the [loadResourceWithPosition] or [loadResourceFromMediaData] function. Caution: If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.

    Parameters

    • path: string

      The absolute resource path or the URL of the network resource and cannot be null or "". Android can set this path string with Uri.

    Returns Promise<ZegoMediaPlayerLoadResourceResult>

    Callback result of loading media resource.

Abstract loadResourceWithConfig

  • Load local or network media resource with config.

    Available: since 3.3.0 Description: Load media resources. Use case: Developers can load the absolute path to the local resource or the URL of the network resource incoming. When to call: Called after the engine [createEngine] has been initialized and the media player [createMediaPlayer] has been created. Related APIs: Support for loading resources through the [loadResourceWithPosition] or [loadResourceFromMediaData] interface. Caution: If the mediaplayer has already loaded resources or is in the process of playing, please first call the [stop] interface to halt the playback, and then proceed to call the interface to load the media resources; failure to do so will result in an unsuccessful load.

    Parameters

    Returns Promise<ZegoMediaPlayerLoadResourceResult>

    Callback result of loading media resource.

Abstract muteLocal

  • muteLocal(mute: boolean): Promise<void>
  • Whether to play locally silently.

    If [enableAux] switch is turned on, there is still sound in the publishing stream. The default is false.

    Parameters

    • mute: boolean

      Mute local audio flag, The default is false.

    Returns Promise<void>

Abstract off

  • off<MediaPlayerEventType>(event: MediaPlayerEventType, callback: undefined | ZegoMediaPlayerListener[MediaPlayerEventType]): void
  • Unregister the event handler of mediaplayer

    Type parameters

    Parameters

    • event: MediaPlayerEventType

      Event type.

    • callback: undefined | ZegoMediaPlayerListener[MediaPlayerEventType]

      Call back.

    Returns void

Abstract on

  • on<MediaPlayerEventType>(event: MediaPlayerEventType, callback: ZegoMediaPlayerListener[MediaPlayerEventType]): void
  • Register the event handler of mediaplayer

    Type parameters

    Parameters

    • event: MediaPlayerEventType

      Event type.

    • callback: ZegoMediaPlayerListener[MediaPlayerEventType]

      Call back.

    Returns void

Abstract pause

  • pause(): Promise<void>
  • Pause playing.

    Returns Promise<void>

Abstract resume

  • resume(): Promise<void>
  • Resume playing.

    Returns Promise<void>

Abstract seekTo

  • Set the specified playback progress.

    Unit is millisecond

    Parameters

    • millisecond: number

      Point in time of specified playback progress

    Returns Promise<ZegoMediaPlayerSeekToResult>

    The result notification of set the specified playback progress

Abstract setAudioTrackIndex

  • setAudioTrackIndex(index: number): Promise<void>
  • Set the audio track of the playback file.

    Parameters

    • index: number

      Audio track index, the number of audio tracks can be obtained through the [getAudioTrackCount] function.

    Returns Promise<void>

Abstract setPlaySpeed

  • setPlaySpeed(speed: number): Promise<void>
  • Set the speed of play.

    Available since: 2.12.0 Description: Set the playback speed of the player. When to call: You should load resource before invoking this function. Restrictions: None. Related APIs: Resources can be loaded through the [loadResource] function.

    Parameters

    • speed: number

      The speed of play. The default is 1.0. Versions 2.12.0 to 3.15.1: The range is 0.5 ~ 4.0. Versions 3.16.0 and above: The range is 0.3 ~ 4.0.

    Returns Promise<void>

Abstract setPlayVolume

  • setPlayVolume(volume: number): Promise<void>
  • Set mediaplayer local playback volume.

    Parameters

    • volume: number

      The range is 0 ~ 200. The default is 60.

    Returns Promise<void>

Abstract setPlayerView

  • setPlayerView(view: ZegoView): Promise<void>
  • Set the view of the player playing video. Note: This function is only available in ZegoExpressVideo SDK!

    Parameters

    • view: ZegoView

      Video rendered canvas object

    Returns Promise<void>

Abstract setProgressInterval

  • setProgressInterval(millisecond: number): Promise<void>
  • Set playback progress callback interval.

    This function can control the callback frequency of [onMediaPlayerPlayingProgress]. When the callback interval is set to 0, the callback is stopped. The default callback interval is 1s This callback are not returned exactly at the set callback interval, but rather at the frequency at which the audio or video frames are processed to determine whether the callback is needed to call

    Parameters

    • millisecond: number

      Interval of playback progress callback in milliseconds

    Returns Promise<void>

Abstract setPublishVolume

  • setPublishVolume(volume: number): Promise<void>
  • Set mediaplayer publish volume.

    Parameters

    • volume: number

      The range is 0 ~ 200. The default is 60.

    Returns Promise<void>

Abstract setVolume

  • setVolume(volume: number): Promise<void>
  • Set mediaplayer volume. Both the local play volume and the publish volume are set.

    Parameters

    • volume: number

      The range is 0 ~ 200. The default is 60.

    Returns Promise<void>

Abstract start

  • start(): Promise<void>
  • Start playing.

    You need to load resources before playing

    Returns Promise<void>

Abstract stop

  • stop(): Promise<void>
  • Stop playing.

    Returns Promise<void>

Generated using TypeDoc