0
0

More than 3 years have passed since last update.

Audio/Video DOM のcurrentTime1とは

Posted at

Audio/Video DOMとは

bodyブロックに書く音声や映像の情報。
例)
<audio data-key="76" src="sounds/tink.wav"></audio>

current Timeの使い方

    window.addEventListener('keydown', function (e){
      const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
//再生時間を取得
      var time =audio.currentTime; 
    });

例えば

audio.currentTime=0;

とすると
再生時間が最初に戻る

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0