Options
All
  • Public
  • Public/Protected
  • All
Menu

Basic timer

もっともシンプルな Timer の実装:

  • 音源を再生しません
  • デバッグ時などに有用です

The simplest Timer implementation:

  • No audio elements are embedded (thus no sound playback)
  • Useful for debugging

Hierarchy

  • BasicTimer

Implements

Index

Constructors

constructor

  • Returns BasicTimer

Accessors

isPlaying

  • get isPlaying(): boolean
  • 再生中かどうか

    Whether the music source is being played or not

    Returns boolean

position

  • get 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.

    Returns number

wait

  • get wait(): number
  • set wait(val: number): void
  • 再生位置情報の更新間隔 [ms]

    Interval for updating playback position [ms]

    Returns number

  • Parameters

    • val: number

    Returns void

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

    Returns Promise<void>

pause

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

    Pause music playback

    Returns void

play

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

    Start music playback

    Returns void

seek

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

    Seek specified position in the current music playback

    Parameters

    • time: number

    Returns void

stop

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

    Stop music playback (pause and then seek the beginning)

    Returns void

Generated using TypeDoc