Codec, Container and Transport problem of HTML5 videos @nori0428
HTML5の<video>や<audio>タグとJavaScript APIで、自由に動画や音声を楽しもう。カスタムのビデオプレイヤーだって作れる video/audio要素のAPIやイベントを利用する video/audio要素は、JavaScriptを用いた細かい制御を行えるのも特徴の1つです。 カスタムのビデオプレイヤーを作ることも容易ですし、動画からフレームを切り出してCanvasに投影し、グラフィックとして取り扱う、なんてテクニックもあります。 今回は、そうしたJavaScript APIの利用方法について見ていきましょう。なお、この記事は2011年5月25日版の仕様に基づいています。 video/audioに共通のメソッド、プロパティ video要素とaudio要素は、メソッドやプロパティの多くが共通です。そうしたメソッドやプロパティを表すのが以下の一覧です。 MediaErr
video/audio要素は、単にタグを貼りつけて再生を行えるだけでなく、Javascriptを用いて細かい制御を行うことも可能である。再生や一時停止、再生速度の変更などは当然ながら、再生位置を変更したり、ダウンロードや再生の進捗状況などをイベントとして補足し、処理を行うこともできる。Javascript APIを用いることで、カスタマイズされたプレイヤーを作ることが可能になる。 メディアの再生に関するJavascript API メディアの再生に関するAPIには、以下のようなものがある。 src src属性の値に対応。 currentSrc 実際に読み込み/再生を行っているメディアデータのURL。 currentTime 現在の再生位置を表す秒数。 duration メディアデータの長さを表す秒数。 paused 一時停止中かどうか。 defaultPlaybackRate デフォルトの
Video/Audio要素のマークアップ方法 Video/Audio要素は、動画データや音声データをHTMLから取り扱えるようにしたものだ。 VideoとAudioの利用法は至って簡単だ。 video/audioタグを記述する src属性に動画/音声ファイルのURLを指定する たったこれだけで、動画や音声をWebページ内に埋め込むことができる。また、タグの内部に記述したコンテンツは、video/audioタグをサポートしていないブラウザにとっての代替コンテンツとして利用できる。 <video src="動画ファイルのURL"> 動画を視聴するにはvideoタグをサポートしたブラウザが必要です。 </video> <audio src="音声ファイルのURL"></audio> また、リソースの指定をさらに細かく行うためのsource要素もHTML 5から導入された。この要素を使用する
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く