Chrome 25を使用してgetUserMediaとRTCPeerConnectionを使用して、ウェブページから別のパーティにオーディオを接続していますが、そのページでメディアが使用されていることを示すChromeタブの赤い点滅表示アイコンをAPIで停止できません。 。私の質問は、解決策が機能していないことを除いて、navigator.getUserMediaによって開かれるStop /CloseWebカメラの複製です。リモートメディアなし(ピアなし)でgetUserMediaのみを使用するページがある場合、カメラを停止すると、タブインジケーターの点滅がオフになります。リモートストリームの追加が問題のようです。これが私の「近い」コードのために現在持っているものです:
if (localStream) {
if (peerConnection && peerConnection.removeStream) {
peerConnection.removeStream(localStream);
}
if (localStream.stop) {
localStream.stop();
}
localStream.onended = null;
localStream = null;
}
if (localElement) {
localElement.onerror = null;
localElement.pause();
localElement.src = undefined;
localElement = null;
}
if (remoteStream) {
if (peerConnection && peerConnection.removeStream) {
peerConnection.removeStream(remoteStream);
}
if(remoteStream.stop) {
remoteStream.stop();
}
remoteStream.onended = null;
remoteStream = null;
}
if (remoteElement) {
remoteElement.onerror = null;
remoteElement.pause();
remoteElement.src = undefined;
remoteElement = null;
}
if (peerConnection) {
peerConnection.close();
peerConnection = null;
}
私は電話の有無にかかわらずremoveStream()
試しました、私は電話の有無にかかわらず試しました、私はそしてstop()
を試しました、私はアイデアを使い果たしています。これがAPIの使用におけるバグなのかユーザー/私のエラーなのか誰か知っていますか?element.src=""
element.src=null
編集:デフォルトのデバイス(Windowsを使用)を、使用時にライトが付いているカメラに設定しました。停止すると、カメラのライトが消えます。これはChromeのバグである可能性があります。またchrome://settings/content
、マイクデバイスを「デフォルト」以外に変更すると、Chromeオーディオが完全に失敗することもわかりました。そして最後に、使用するelement.src=undefined
とChromeがリソースを読み込もうとし、404をスローすることになり、明らかに正しくないことに気づきelement.src=''
ました。