6

remote によって取得されたリモート MediaStreamオブジェクトがありますWebRTC Peer Connection

MediaStream リモコンがいつ非アクティブになるかを確認したい(理由とは別に)。

この目的のために、イベントactiveとオブジェクトinactiveを使用する必要があることを読みました。MediaStream

しかし、これら 2 つのイベントがトリガーされることはありません。これら 2 つのイベントに特定のハンドラーを設定しても、ハンドラーが実行されることはありません。

ここで私の実装:

function onRemoteStream(event) {
    event.stream.addEventListener("active", function(){
    console.log('The video is active');
    }, false);
    event.stream.addEventListener("inactive", function(){
        console.log('The video is not active');
    }, false);
    remoteVideo.src = window.URL.createObjectURL(event.stream);
}

2 つのメッセージは表示されません。

私も試しました:

function onRemoteStream(event) {
    event.stream.onactive = function(){
        console.log('The video is active');
    };
    event.stream.oninactive = function(){
        console.log('The video is not active');
    }
    remoteVideo.src = window.URL.createObjectURL(event.stream);
}

しかし、動作は同じです。

2 つのイベントがトリガーされない理由がわかりません。

Google Chrome 52.0.2743.116 m を使用しています

4

1 に答える 1