1

私は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 の各インスタンスにイベントのイベント リスナーをどのようにアタッチしますか?

4

1 に答える 1

0

configureFlowplayerここで説明するコールバックでハンドラーを設定することで可能になるはずです: http ://wiki.github.com/etianen/html5media/custom-flash-players

configparamがflowplayerの構成に使用しているものである場合、最終的には次のようになります。私はこのコードをテストしていませんが、これはあなたが何をする必要があるかについての考えをあなたに与えるはずです:

<script>
html5media.configureFlowplayer = function(tag, element, config) {
    config.onStart = function(){alert("playing");}
}
</script>
于 2010-06-24T13:59:30.017 に答える