com.aliyun.player

## Interface IPlayer

- All Known Subinterfaces:
    AliLiveShiftPlayer

      public interface IPlayer

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `IPlayer.ConvertURLCallback` URL conversion callback.
    `static class` | `IPlayer.IPResolveType` IP resolve type
    `static class` | `IPlayer.MirrorMode` Mirroring modes
    `static interface` | `IPlayer.OnChooseTrackIndexListener` 选择要播放的流。此回调在多清晰度情况下，获取到视频信息后，SDK无法判断使用哪个清晰度播放时回调。
    `static interface` | `IPlayer.OnCompletionListener` Playback completion callback.
    `static interface` | `IPlayer.OnErrorListener` Error callback.
    `static interface` | `IPlayer.OnInfoListener` Notification callback.
    `static interface` | `IPlayer.OnLoadingStatusListener` Loading status callback.
    `static interface` | `IPlayer.OnPreparedListener` Preparation success callback.
    `static interface` | `IPlayer.OnPreRenderFrameCallback` Prerender frame callback.
    `static interface` | `IPlayer.OnRenderFrameCallback` Render frame callback
    `static interface` | `IPlayer.OnRenderingStartListener` Rendering start callback.
    `static interface` | `IPlayer.OnReportEventListener` report event listener
    `static interface` | `IPlayer.OnSeekCompleteListener` Seeking completion callback.
    `static interface` | `IPlayer.OnSeiDataListener` SEI data callback.
    `static interface` | `IPlayer.OnSnapShotListener` Snapshot creation result callback.
    `static interface` | `IPlayer.OnStateChangedListener` Player status update callback.
    `static interface` | `IPlayer.OnSubtitleDisplayListener` Subtitle display callback.
    `static interface` | `IPlayer.OnThumbnailListener` Thumbnail image retrieval callback.
    `static interface` | `IPlayer.OnTrackChangedListener` Stream switchover callback.
    `static interface` | `IPlayer.OnTrackReadyListener` Stream preparation success callback.
    `static interface` | `IPlayer.OnVideoRenderedListener` video render callback
    `static interface` | `IPlayer.OnVideoSizeChangedListener` Video size change callback.
    `static class` | `IPlayer.Option` player available options
    `static class` | `IPlayer.PropertyKey` The key to get property
    `static class` | `IPlayer.RenderFrameCallbackConfig`
    `static class` | `IPlayer.RotateMode` Rotate modes
    `static class` | `IPlayer.ScaleMode` Zoom modes
    `static class` | `IPlayer.SeekMode` Seeking modes

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `completion` The player has completed playing the video or audio.
    `static int` | `error` The player has an error.
    `static int` | `idle` Blank.
    `static int` | `initalized` Initialized.
    `static int` | `paused` The player is paused.
    `static int` | `prepared` Prepared.
    `static int` | `started` The player is playing video or audio.
    `static int` | `stopped` The player is stopped.
    `static int` | `unknow` Unknown status.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExtSubtitle(java.lang.String url)` Add external subtitles
    `void` | `clearScreen()` Clear the screen.
    `TrackInfo` | `currentTrack(int type)` Deprecated.
    `TrackInfo` | `currentTrack(TrackInfo.Type type)` Query the playing track info according to the specified track type.
    `void` | `enableHardwareDecoder(boolean enable)` Enable or disable hardware decoding.
    `java.lang.String` | `getCacheFilePath(java.lang.String URL)` Query the name of a cached file with the specified URL.
    `java.lang.String` | `getCacheFilePath(java.lang.String vid, java.lang.String format, java.lang.String definition, int previewTime)` Query the name of a cached file with the specified VID.
    `PlayerConfig` | `getConfig()` Query the player configuration.
    `long` | `getDuration()` Query the total length of the stream.
    `MediaInfo` | `getMediaInfo()` Query media information.
    `IPlayer.MirrorMode` | `getMirrorMode()` Query the current mirroring mode.
    `long` | `getNativeContextAddr()`
    `java.lang.Object` | `getOption(IPlayer.Option key)` gets the player's options parameters
    `java.lang.String` | `getPlayerName()` Gets the name of the player used when playing
    `java.lang.String` | `getPropertyString(IPlayer.PropertyKey key)` Get information by key.
    `IPlayer.RotateMode` | `getRotateMode()` Query the current rotate mode.
    `IPlayer.ScaleMode` | `getScaleMode()` Query the current zoom mode.
    `float` | `getSpeed()` Query the playback speed.
    `int` | `getVideoHeight()` Query the height of the video.
    `int` | `getVideoRotation()` Query the rotate angle of the video.
    `int` | `getVideoWidth()` Query the width of the video.
    `float` | `getVolume()` Query the volume of the player.
    `boolean` | `isAutoPlay()` Query whether autoplay is enabled.
    `boolean` | `isLoop()` Query whether loop playback is enabled.
    `boolean` | `isMute()` Query whether the player is muted.
    `void` | `pause()` Pause the player.
    `void` | `prepare()` Prepare the player.
    `void` | `redraw()` Deprecated.
    `void` | `release()` Release.
    `void` | `reload()` Reload.
    `void` | `reset()` Reset.
    `void` | `seekTo(long position)` Specify a position for inaccurate seeking.
    `void` | `seekTo(long position, IPlayer.SeekMode seekMode)` Seek to a specified position.
    `void` | `selectExtSubtitle(int trackIndex, boolean select)` Select external subtitles
    `void` | `selectTrack(int trackInfoIndex)` Specify a stream to play.
    `void` | `selectTrack(int trackInfoIndex, boolean accurate)` Specify a stream to play.
    `void` | `sendCustomEvent(java.lang.String args)` Sends a user-defined event, which will be called back via `IPlayer.OnReportEventListener`.
    `void` | `setAutoPlay(boolean on)` Enable autoplay.
    `void` | `setCacheConfig(CacheConfig cacheConfig)` Configure cache settings.
    `void` | `setConfig(PlayerConfig config)` Modify the player configuration.
    `void` | `setDefaultBandWidth(int bandWidth)` Set the default playback bitrate for multi-bit rate.
    `void` | `setDisplay(android.view.SurfaceHolder holder)` Set SurfaceHolder.
    `void` | `setDisplayView(AliDisplayView view)`
    `void` | `setDrmCallback(DrmCallback callback)` set drm request callback.
    `void` | `setFastStart(boolean open)` set fast start
    `void` | `setFilterConfig(FilterConfig filterConfig)` Set filter config.
    `void` | `setFilterInvalid(java.lang.String target, boolean invalid)` disable/enable filter.
    `void` | `setIPResolveType(IPlayer.IPResolveType type)` set ip resolve type
    `void` | `setLoop(boolean on)` Enable loop playback.
    `void` | `setMaxAccurateSeekDelta(int delta)` set the maximum interval of precision seek.
    `void` | `setMirrorMode(IPlayer.MirrorMode mirrorMode)` Set a mirroring mode
    `void` | `setMute(boolean on)` Mute the player.
    `void` | `setOnChooseTrackIndexListener(IPlayer.OnChooseTrackIndexListener l)` 设置播放索引选择回调
    `void` | `setOnCompletionListener(IPlayer.OnCompletionListener l)` Set a playback completion callback.
    `void` | `setOnErrorListener(IPlayer.OnErrorListener l)` Set an error callback.
    `void` | `setOnInfoListener(IPlayer.OnInfoListener l)` Set a notification callback.
    `void` | `setOnLoadingStatusListener(IPlayer.OnLoadingStatusListener l)` Set a loading status callback.
    `void` | `setOnPreparedListener(IPlayer.OnPreparedListener l)` Set a preparation success callback.
    `void` | `setOnPreRenderFrameCallback(IPlayer.OnPreRenderFrameCallback callback)` Set prerender frame callback.
    `void` | `setOnRenderFrameCallback(IPlayer.OnRenderFrameCallback callback)` Set the render frame callback.
    `void` | `setOnRenderingStartListener(IPlayer.OnRenderingStartListener l)` Set a rendering start callback.
    `void` | `setOnReportEventListener(IPlayer.OnReportEventListener onReportEventListener)` set report event listener
    `void` | `setOnSeekCompleteListener(IPlayer.OnSeekCompleteListener l)` Set a seeking completion callback.
    `void` | `setOnSeiDataListener(IPlayer.OnSeiDataListener l)` Set a SEI data callback.
    `void` | `setOnSnapShotListener(IPlayer.OnSnapShotListener l)` Set a snapshot creation result callback.
    `void` | `setOnStateChangedListener(IPlayer.OnStateChangedListener l)` Set a player status update callback.
    `void` | `setOnSubtitleDisplayListener(IPlayer.OnSubtitleDisplayListener l)` Set a subtitle display callback.
    `void` | `setOnTrackChangedListener(IPlayer.OnTrackChangedListener l)` Set a stream switchover callback.
    `void` | `setOnTrackReadyListener(IPlayer.OnTrackReadyListener l)` Set a stream preparation success callback.
    `void` | `setOnVideoRenderedListener(IPlayer.OnVideoRenderedListener l)` set the video render callback
    `void` | `setOnVideoSizeChangedListener(IPlayer.OnVideoSizeChangedListener l)` Set a video size change callback.
    `void` | `setPreferPlayerName(java.lang.String name)` Sets the name of the player selected when playing.
    `void` | `setRenderFrameCallbackConfig(IPlayer.RenderFrameCallbackConfig config)` Set the render frame callback configuration.
    `void` | `setRotateMode(IPlayer.RotateMode rotateMode)` Set a rotate mode.
    `void` | `setScaleMode(IPlayer.ScaleMode scaleMode)` Set a zoom mode.
    `void` | `setSpeed(float speed)` Set the playback speed.
    `void` | `setStreamDelayTime(int index, int time)` set the delay time of the stream
    `void` | `setSurface(android.view.Surface surface)` Set the display surface.
    `void` | `setTraceId(java.lang.String traceId)` Set a trace ID for troubleshooting with the relevant log.
    `void` | `setVideoBackgroundColor(int color)` Set video background color
    `void` | `setVideoTag(int[] tags)` Set the video tags.
    `void` | `setVolume(float gain)` Set the volume of the player(Not system volume).
    `void` | `snapshot()` Create a snapshot for the current frame.
    `void` | `start()` Start the player.
    `void` | `stop()` Stop the player.
    `void` | `surfaceChanged()` Surface changed.
    `void` | `updateFilterConfig(java.lang.String target, FilterConfig.FilterOptions options)` upadate filter config.

- - ### Field Detail

    - #### unknow

          static final int unknow

      Unknown status.
      See Also:
        Constant Field Values

    - #### idle

          static final int idle

      Blank. The player enters this state after it is created.
      See Also:
        Constant Field Values

    - #### initalized

          static final int initalized

      Initialized. The player enters this state after a media source is specified for the player.
      See Also:
        Constant Field Values

    - #### prepared

          static final int prepared

      Prepared.
      See Also:
        Constant Field Values

    - #### started

          static final int started

      The player is playing video or audio.
      See Also:
        Constant Field Values

    - #### paused

          static final int paused

      The player is paused.
      See Also:
        Constant Field Values

    - #### stopped

          static final int stopped

      The player is stopped.
      See Also:
        Constant Field Values

    - #### completion

          static final int completion

      The player has completed playing the video or audio.
      See Also:
        Constant Field Values

    - #### error

          static final int error

      The player has an error.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### selectTrack

          void selectTrack(int trackInfoIndex)

      Specify a stream to play. You can call `IPlayer.OnTrackChangedListener` to check whether the stream is played.

      Note: If you have specified a track, then automatic bitrate switchover does not take effect even if it is enabled.

      Parameters:
        `trackInfoIndex` - Stream information. See `TrackInfo.getIndex()`. If you want to enable automatic bitrate switchover, pass `TrackInfo.AUTO_SELECT_INDEX`.

    - #### selectTrack

          void selectTrack(int trackInfoIndex,
                           boolean accurate)

      Specify a stream to play. You can call `IPlayer.OnTrackChangedListener` to check whether the stream is played.

      Note: If you have specified a track, then automatic bitrate switchover does not take effect even if it is enabled.

      Parameters:
        `trackInfoIndex` - Stream information. See `TrackInfo.getIndex()`. If you want to enable automatic bitrate switchover, pass `TrackInfo.AUTO_SELECT_INDEX`.
        `accurate` - enable accurate select or not.

    - #### currentTrack

          @Deprecated
          TrackInfo currentTrack(int type)

      Deprecated.
      Query the playing track info according to the specified track type. From version 4.7.1, currentTrack(TrackInfo.Type) is used.
      Parameters:
        `type` - The type of the track. See `TrackInfo.Type` .ordinal().
      Returns:
        The track that is playing. If no track is playing, null is returned.

    - #### currentTrack

          TrackInfo currentTrack(TrackInfo.Type type)

      Query the playing track info according to the specified track type.
      Parameters:
        `type` - The type of the track. See `TrackInfo.Type`.
      Returns:
        The track that is playing. If no track is playing, null is returned.

    - #### getDuration

          long getDuration()

      Query the total length of the stream.
      Returns:
        The total length of the stream. Unit: milliseconds.

    - #### getMediaInfo

          MediaInfo getMediaInfo()

      Query media information. Note: Only if `IPlayer.OnPreparedListener.onPrepared()` is called back, the media information can be returned.
      Returns:
        The media information. See `MediaInfo`.

    - #### getVideoWidth

          int getVideoWidth()

      Query the width of the video.
      Returns:
        The width of the video.

    - #### getVideoHeight

          int getVideoHeight()

      Query the height of the video.
      Returns:
        The height of the video.

    - #### getVideoRotation

          int getVideoRotation()

      Query the rotate angle of the video.
      Returns:
        The rotate angle of the video.

    - #### setCacheConfig

          void setCacheConfig(CacheConfig cacheConfig)

      Configure cache settings.
      Parameters:
        `cacheConfig` - Cache settings. See `CacheConfig`.

    - #### setTraceId

          void setTraceId(java.lang.String traceId)

      Set a trace ID for troubleshooting with the relevant log.
      Parameters:
        `traceId` - The specified trace ID.

    - #### setVolume

          void setVolume(float gain)

      Set the volume of the player(Not system volume). The range is 0.0~2.0，it maybe lead to noise if set volume more then 1.0, not recommended.
      Parameters:
        `gain` - Valid values: [0,1].

    - #### getVolume

          float getVolume()

      Query the volume of the player.
      Returns:
        Valid values: [0, 1].

    - #### setMute

          void setMute(boolean on)

      Mute the player.
      Parameters:
        `on` - Set to true to mute the player. Default: false.

    - #### isMute

          boolean isMute()

      Query whether the player is muted.
      Returns:
        Value true indicates that the player is muted. Default: false.

    - #### setLoop

          void setLoop(boolean on)

      Enable loop playback. If the media file is already downloaded to the local host, then the downloaded media file will be used for loop playback.
      Parameters:
        `on` - true：Enable loop playback. Default: disabled.

    - #### isLoop

          boolean isLoop()

      Query whether loop playback is enabled.
      Returns:
        Value true indicates that loop playback is enabled. Default: disabled.

    - #### setAutoPlay

          void setAutoPlay(boolean on)

      Enable autoplay. If autoplay is enabled, then the `IPlayer.OnPreparedListener` callback is not returned.
      Parameters:
        `on` - Value true indicates that autoplay is enabled. Default: disabled.

    - #### isAutoPlay

          boolean isAutoPlay()

      Query whether autoplay is enabled.
      Returns:
        Value true indicates that autoplay is enabled. Default: disabled.

    - #### setSpeed

          void setSpeed(float speed)

      Set the playback speed.
      Parameters:
        `speed` - Valid values: [0.5,2].

    - #### getSpeed

          float getSpeed()

      Query the playback speed.
      Returns:
        The playback speed. Valid values: [0.5,2].

    - #### setMirrorMode

          void setMirrorMode(IPlayer.MirrorMode mirrorMode)

      Set a mirroring mode
      Parameters:
        `mirrorMode` - The specified mirroring mode. See `IPlayer.MirrorMode`.

    - #### getMirrorMode

          IPlayer.MirrorMode getMirrorMode()

      Query the current mirroring mode.
      Returns:
        The current mirroring mode. See `IPlayer.MirrorMode`.

    - #### setRotateMode

          void setRotateMode(IPlayer.RotateMode rotateMode)

      Set a rotate mode.
      Parameters:
        `rotateMode` - The specified rotate mode. See `IPlayer.RotateMode`.

    - #### getRotateMode

          IPlayer.RotateMode getRotateMode()

      Query the current rotate mode.
      Returns:
        The current rotate mode. See `IPlayer.RotateMode`.

    - #### setScaleMode

          void setScaleMode(IPlayer.ScaleMode scaleMode)

      Set a zoom mode.
      Parameters:
        `scaleMode` - The specified zoom mode. Default: `IPlayer.ScaleMode.SCALE_TO_FILL`. See `IPlayer.ScaleMode`.

    - #### getScaleMode

          IPlayer.ScaleMode getScaleMode()

      Query the current zoom mode.
      Returns:
        The current zoom mode. Default: `IPlayer.ScaleMode.SCALE_TO_FILL`.

    - #### snapshot

          void snapshot()

      Create a snapshot for the current frame. You can call `IPlayer.OnSnapShotListener` to return the snapshot creation result.

    - #### setSurface

          void setSurface(android.view.Surface surface)

      Set the display surface. Note: You must set this parameter when the display surface changes. You must set this parameter to null when the player is deleted.
      Parameters:
        `surface` - The display surface.

    - #### setDisplay

          void setDisplay(android.view.SurfaceHolder holder)

      Set SurfaceHolder. Note: You must set this parameter when the display surface changes. You must set this parameter to null when the player is deleted.
      Parameters:
        `holder` - The SurfaceHolder.

    - #### setDisplayView

          void setDisplayView(AliDisplayView view)

    - #### surfaceChanged

          void surfaceChanged()

      Surface changed.

    - #### prepare

          void prepare()

      Prepare the player. Call `IPlayer.OnPreparedListener` to return success messages. Call `IPlayer.OnErrorListener` to return error messages.

    - #### start

          void start()

      Start the player.

    - #### pause

          void pause()

      Pause the player.

    - #### stop

          void stop()

      Stop the player.

    - #### seekTo

          void seekTo(long position)

      Specify a position for inaccurate seeking. Unit: millisecond.
      Parameters:
        `position` - The specified position.

    - #### seekTo

          void seekTo(long position,
                      IPlayer.SeekMode seekMode)

      Seek to a specified position.
      Parameters:
        `position` - The specified position. Unit: millisecond.
        `seekMode` - The specified seeking mode. See `IPlayer.SeekMode`.

    - #### setMaxAccurateSeekDelta

          void setMaxAccurateSeekDelta(int delta)

      set the maximum interval of precision seek.
      Parameters:
        `delta` - interval in milliseconds

    - #### reset

          void reset()

      Reset.

    - #### release

          void release()

      Release.

    - #### redraw

          @Deprecated
          void redraw()

      Deprecated.
      Refresh a frame. The last frame is retained when the size of the display surface changes.

    - #### clearScreen

          void clearScreen()

      Clear the screen. When SurfaceTexture is reused, the previous screen can be erased

    - #### setOnPreparedListener

          void setOnPreparedListener(IPlayer.OnPreparedListener l)

      Set a preparation success callback. If the preparation failed, the `IPlayer.OnErrorListener` is triggered.
      Parameters:
        `l` - Preparation success notification.

    - #### setOnRenderingStartListener

          void setOnRenderingStartListener(IPlayer.OnRenderingStartListener l)

      Set a rendering start callback. You can use this callback to listen to first frame display events and hide the album cover.
      Parameters:
        `l` - Rendering start notification.

    - #### setOnStateChangedListener

          void setOnStateChangedListener(IPlayer.OnStateChangedListener l)

      Set a player status update callback.
      Parameters:
        `l` - Player status update notification.

    - #### setOnCompletionListener

          void setOnCompletionListener(IPlayer.OnCompletionListener l)

      Set a playback completion callback. Note: No notification is sent if loop playback is enabled.
      Parameters:
        `l` - Playback completion notification.

    - #### setOnLoadingStatusListener

          void setOnLoadingStatusListener(IPlayer.OnLoadingStatusListener l)

      Set a loading status callback.
      Parameters:
        `l` - Loading status notification.

    - #### setOnErrorListener

          void setOnErrorListener(IPlayer.OnErrorListener l)

      Set an error callback.
      Parameters:
        `l` - Error message.

    - #### setOnChooseTrackIndexListener

          void setOnChooseTrackIndexListener(IPlayer.OnChooseTrackIndexListener l)

      设置播放索引选择回调
      Parameters:
        `l` - 回调。见IPlayer.OnChooseTrackIndexListener

    - #### setOnTrackReadyListener

          void setOnTrackReadyListener(IPlayer.OnTrackReadyListener l)

      Set a stream preparation success callback.
      Parameters:
        `l` - Stream preparation success notification.

    - #### setOnInfoListener

          void setOnInfoListener(IPlayer.OnInfoListener l)

      Set a notification callback.
      Parameters:
        `l` - The notification.

    - #### setOnVideoSizeChangedListener

          void setOnVideoSizeChangedListener(IPlayer.OnVideoSizeChangedListener l)

      Set a video size change callback.
      Parameters:
        `l` - Video size change notification.

    - #### setOnSeekCompleteListener

          void setOnSeekCompleteListener(IPlayer.OnSeekCompleteListener l)

      Set a seeking completion callback.
      Parameters:
        `l` - Seeking completion notification.

    - #### setOnTrackChangedListener

          void setOnTrackChangedListener(IPlayer.OnTrackChangedListener l)

      Set a stream switchover callback.
      Parameters:
        `l` - Stream switchover notification.

    - #### setOnSeiDataListener

          void setOnSeiDataListener(IPlayer.OnSeiDataListener l)

      Set a SEI data callback.
      Parameters:
        `l` - SEI data callback.

    - #### addExtSubtitle

          void addExtSubtitle(java.lang.String url)

      Add external subtitles
      Parameters:
        `url` - subtitle address

    - #### selectExtSubtitle

          void selectExtSubtitle(int trackIndex,
                                 boolean select)

      Select external subtitles
      Parameters:
        `trackIndex` - caption index
        `select` - true: select, false: close

    - #### setStreamDelayTime

          void setStreamDelayTime(int index,
                                  int time)

      set the delay time of the stream
      Parameters:
        `index` - steam index
        `time` - ms

    - #### setOnSubtitleDisplayListener

          void setOnSubtitleDisplayListener(IPlayer.OnSubtitleDisplayListener l)

      Set a subtitle display callback.
      Parameters:
        `l` - Subtitle display notification.

    - #### setConfig

          void setConfig(PlayerConfig config)

      Modify the player configuration.
      Parameters:
        `config` - The configuration of the player. See `PlayerConfig`.

    - #### getConfig

          PlayerConfig getConfig()

      Query the player configuration.
      Returns:
        The player configuration.

    - #### setOnSnapShotListener

          void setOnSnapShotListener(IPlayer.OnSnapShotListener l)

      Set a snapshot creation result callback.
      Parameters:
        `l` - Snapshot creation notification.

    - #### enableHardwareDecoder

          void enableHardwareDecoder(boolean enable)

      Enable or disable hardware decoding.
      Parameters:
        `enable` - Set to true to enable hardware decoding and set to false to disable hardware decoding.

    - #### getCacheFilePath

          java.lang.String getCacheFilePath(java.lang.String URL)

      Query the name of a cached file with the specified URL. You must first call setCacheConfig.
      Parameters:
        `URL` - The URL of the cached file.
      Returns:
        The absolute path of the cached file.

    - #### getCacheFilePath

          java.lang.String getCacheFilePath(java.lang.String vid,
                                            java.lang.String format,
                                            java.lang.String definition,
                                            int previewTime)

      Query the name of a cached file with the specified VID. You must first call setCacheConfig.
      Parameters:
        `vid` - The ID of the video.
        `format` - The format of the video.
        `definition` - The definition of the video.
        `previewTime` - The preview duration for the video.
      Returns:
        The absolute path of the cached file.

    - #### reload

          void reload()

      Reload. Call this method when the network connection times out.

    - #### getPropertyString

          java.lang.String getPropertyString(IPlayer.PropertyKey key)

      Get information by key.
      Parameters:
        `key` - The enum of key
      Returns:
        corresponding information, return "" if doesn't exist.

    - #### setDefaultBandWidth

          void setDefaultBandWidth(int bandWidth)

      Set the default playback bitrate for multi-bit rate. The nearest stream will be selected.
      Parameters:
        `bandWidth` - bit rate .

    - #### getOption

          java.lang.Object getOption(IPlayer.Option key)

      gets the player's options parameters
      Parameters:
        `key` - parameter value See IPlayer.Option
      Returns:

    - #### setOnVideoRenderedListener

          void setOnVideoRenderedListener(IPlayer.OnVideoRenderedListener l)

      set the video render callback
      Parameters:
        `l` - video render callback. See IPlayer.OnVideoRenderedListener

    - #### setVideoBackgroundColor

          void setVideoBackgroundColor(int color)

      Set video background color
      Parameters:
        `color` - ARGB

    - #### setIPResolveType

          void setIPResolveType(IPlayer.IPResolveType type)

      set ip resolve type
      Parameters:
        `type` - See `IPlayer.IPResolveType`

    - #### setFastStart

          void setFastStart(boolean open)

      set fast start
      Parameters:
        `open` -

    - #### setOnReportEventListener

          void setOnReportEventListener(IPlayer.OnReportEventListener onReportEventListener)

      set report event listener
      Parameters:
        `onReportEventListener` - event listener

    - #### setDrmCallback

          void setDrmCallback(DrmCallback callback)

      set drm request callback. WideVine supported only.
      Parameters:
        `callback` - callback

    - #### sendCustomEvent

          void sendCustomEvent(java.lang.String args)

      Sends a user-defined event, which will be called back via `IPlayer.OnReportEventListener`. User-defined event e = 5001. Args is the parameter passed in.
      Parameters:
        `args` -

    - #### setVideoTag

          void setVideoTag(int[] tags)

      Set the video tags. Values range from [0,99].
      Parameters:
        `tags` -

    - #### setPreferPlayerName

          void setPreferPlayerName(java.lang.String name)

      Sets the name of the player selected when playing.
      Parameters:
        `name` -

    - #### getPlayerName

          java.lang.String getPlayerName()

      Gets the name of the player used when playing
      Returns:

    - #### setRenderFrameCallbackConfig

          void setRenderFrameCallbackConfig(IPlayer.RenderFrameCallbackConfig config)

      Set the render frame callback configuration.
      Parameters:
        `config` - See IPlayer.RenderFrameCallbackConfig

    - #### setOnRenderFrameCallback

          void setOnRenderFrameCallback(IPlayer.OnRenderFrameCallback callback)

      Set the render frame callback.
      Parameters:
        `callback` - See IPlayer.OnRenderFrameCallback

    - #### setFilterConfig

          void setFilterConfig(FilterConfig filterConfig)

      Set filter config. call this before prepare. If want update filter config, call updateFilterConfig()
      Parameters:
        `filterConfig` -

    - #### updateFilterConfig

          void updateFilterConfig(java.lang.String target,
                                  FilterConfig.FilterOptions options)

      upadate filter config.
      Parameters:
        `target` -
        `options` -

    - #### setFilterInvalid

          void setFilterInvalid(java.lang.String target,
                                boolean invalid)

      disable/enable filter.
      Parameters:
        `target` - if empty , disable all filters.
        `invalid` - true: enable(default); false: disable

    - #### setOnPreRenderFrameCallback

          void setOnPreRenderFrameCallback(IPlayer.OnPreRenderFrameCallback callback)

      Set prerender frame callback.
      Parameters:
        `callback` - See IPlayer.OnPreRenderFrameCallback

    - #### getNativeContextAddr

          long getNativeContextAddr()