com.aliyun.svideosdk.editor.template

## Interface AliyunTemplatePlayer

- All Known Subinterfaces:
    AliyunTemplateBuilder, AliyunTemplateEditor

      public interface AliyunTemplatePlayer

  sdk version >= v3.27.0

  template player

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<AliyunTemplateParam>` | `getAllParams()` Gets the template param.
    `long` | `getCurrentPlayPosition()` Gets the current position on the playback timeline.
    `long` | `getDuration()` Gets the duration of the playback timeline.
    `AliyunEditorProject` | `getEditorProject()` Gets the editor project.
    `int` | `init(SurfaceView surfaceView, int width, int height)` init and Sets the display view.
    `boolean` | `isPaused()` Gets whether playback is paused.
    `boolean` | `isPlaying()`
    `void` | `onDestroy()` The final lifecycle callback.
    `int` | `pause()` Pauses playback.
    `int` | `play()` Starts playback.
    `int` | `seek(long time)` Seeks to a point in time.
    `void` | `setPlayerCallBack(EditorCallBack playerCallBack)` Sets the player callBack.

- - ### Method Detail

    - #### init

          int init(SurfaceView surfaceView,
                   int width,
                   int height)

      init and Sets the display view.
      Parameters:
        `surfaceView` - display view.
        `width` - display width
        `height` - display height
      Returns:
        0 successful，other no template authorization,

    - #### setPlayerCallBack

          void setPlayerCallBack(EditorCallBack playerCallBack)

      Sets the player callBack.
      Parameters:
        `playerCallBack` - player callBack

    - #### play

          int play()

      Starts playback.
      Returns:
        `AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_START_ERROR`

    - #### seek

          int seek(long time)

      Seeks to a point in time.
      Parameters:
        `time` - The point in time. Unit: microseconds.
      Returns:
        `AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_SEEK_IN_OFFSET` `AliyunEditorErrorCode.SVIDEO_EDITOR_SEEK_ERROR` `AliyunEditorErrorCode.ALIVC_FRAMEWORK_AUDIO_PROCESS_SEEK_FAILED`

    - #### pause

          int pause()

      Pauses playback.
      Returns:
        `AliyunErrorCode.ERROR_TRES_ILLEGAL_EDITOR_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_NATIVE_NOT_INITED` `AliyunEditorErrorCode.SVIDEO_EDITOR_INVALID_STATE` `AliyunEditorErrorCode.SVIDEO_EDITOR_PAUSE_ERROR`

    - #### getCurrentPlayPosition

          long getCurrentPlayPosition()

      Gets the current position on the playback timeline. This position is subject to timeline effects.
      Returns:
        The current position on the playback timeline. Unit: microseconds.

    - #### getDuration

          long getDuration()

      Gets the duration of the playback timeline.
      Returns:
        The duration of the playback timeline. Unit: microseconds.

    - #### isPlaying

          boolean isPlaying()

    - #### isPaused

          boolean isPaused()

      Gets whether playback is paused.
      Returns:
        whether playback is paused. true is pausing.

    - #### onDestroy

          void onDestroy()

      The final lifecycle callback.

    - #### getEditorProject

          AliyunEditorProject getEditorProject()

      Gets the editor project.
      Returns:
        editor project

    - #### getAllParams

          java.util.List<AliyunTemplateParam> getAllParams()

      Gets the template param.
      Returns:
        template params