私はhtml5mediaライブラリを使用しています。これは、ページ上の HTML5 ビデオ タグを、ビデオ タグをサポートしていないブラウザ用の Flowplayer Flash プレーヤーに自動的に置き換えます。これは、IE および一部の古いブラウザーで発生します。
Flowplayer がページに存在するかどうかを検出し、ユーザーがビデオの再生を開始したときに JavaScript 関数を起動するイベント リスナーを各インスタンスに追加する必要があります。これはjQuery経由で可能ですか? Flowplayer の Player オブジェクトの API については、こちらで説明しています。いくつかの例:
/* Set common clip properties and event listeners
* in run-time
*/
// register event listener with common clip
$f("player").onStart(function() {
alert("Playing");
});
// this does the same thing
$f("player").getCommonClip().onStart(function() {
alert("Playing");
});
// if you want to register a listener to a specific clip *only*
$f("player").getClip(1).onStart(function() {
alert("Playing");
});
onStart
ページに存在する場合、Flowplayer の各インスタンスにイベントのイベント リスナーをどのようにアタッチしますか?