Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Timer

Timer

TextAlive Player の音源の再生状態を管理するクラスが実装するインタフェースです。

Classes that manage music playback for TextAlive Player should implement this interface.

Hierarchy

  • Timer

Implemented by

Index

Properties

Readonly isPlaying

isPlaying: boolean

再生中かどうか

Whether the music source is being played or not

Readonly position

position: number

現在の再生位置 [ms]

Timer 実装クラスはこの値をリアルタイムに計算して返さなくてはなりません。 TextAlive には他にも再生位置を返すAPIが以下の2種類用意されていますが、実装手法の違いにより、このAPIが常に最も精確な値を返します。

  • IPlayer.mediaPositionTimer 実装クラスによって定期的に更新されます
  • IPlayer.videoPosition は TextAlive Player が定期的に呼び出す {@link IRenderingUnit.animate} が成功してから更新されます

このAPIを利用するアプリでは、動画のシーク操作に対応するために PlayerEventListener.onVideoSeekStart PlayerEventListener.onVideoSeek PlayerEventListener.onVideoSeekEnd イベントを適切にハンドルする必要があります。

Current playback position [ms]

Timer implementations need to calculate this property value in real time. While TextAlive also has the following APIs to retrieve the current playback position, this one returns the most precise value at any time.

Applications utilizing this API need to handle PlayerEventListener.onVideoSeekStart PlayerEventListener.onVideoSeek PlayerEventListener.onVideoSeekEnd events appropriately so that the applications respond to the video seeking operation.

wait

wait: number

再生位置情報の更新間隔 [ms]

Interval for updating playback position [ms]

Methods

dispose

  • dispose(): void
  • この Timer を破棄する

    Dispose this Timer instance

    Returns void

initialize

  • Timer の初期化(動画データの読み込みプロセスで一度だけ呼ばれます)

    Initialize this Timer instance (called during the video data loading process)

    Parameters

    • options: TimerInitOptions

      初期化オプション / Options for initalization process

    Returns Promise<void>

pause

  • pause(): void
  • 再生を一時停止する

    Pause music playback

    Returns void

play

  • play(): void
  • 再生を開始する

    Start music playback

    Returns void

seek

  • seek(position: number): void
  • 再生位置を指定する

    Seek specified position in the current music playback

    Parameters

    • position: number

      再生位置 [ms] / Media position [ms]

    Returns void

stop

  • stop(): void
  • 再生を停止する(一時停止したうえで先頭に巻き戻しする)

    Stop music playback (pause and then seek the beginning)

    Returns void

Generated using TypeDoc