21
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ニコニコ動画QをJavaScriptから操作する

Last updated at Posted at 2013-10-02

ニコニコ動画のプレーヤーをJavaScriptから操作するAPI一覧 - kiyohoge

ここの

var player = document.getElementById("flvplayer"); 

var player = document.getElementById('external_nicoplayer');

に変わっただけです。

もっとたくさん上記URLに書いていますが、いくつかこちらにも記載しておきます。

再生・停止

player.ext_play(boolean) -> void 
//=> true なら再生、falseなら停止

シーク

player.ext_setPlayheadTime(number) -> void
//=> number秒後にシーク

ミュート

player.exsetMute(boolean) -> void
//=> trueならミュート、falseならミュート解除

動画の状態の取得

player.ext_getStatus() -> String
//=> 'seeking' : シーク中、 'stopped' : 準備中、'playing' : 再生中、 'paused' : 停止中、'end' : 再生終了

動画の現在の再生時間を取得

player.ext_getPlayheadTime() -> Number
//=> 現在の再生時間を取得

動画の長さを取得

player.ext_getTotalTime() -> Number
//=> 動画全部で何秒か
21
21
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
21
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?