Commit a4e071f7 authored by Philip Jägenstedt's avatar Philip Jägenstedt Committed by Commit Bot

Remove internal use of webkitMediaStream and webkitRTCPeerConnection

This is a no-op change that makes it easier to later remove them.

The copyright license is required to pass presubmit.

Bug: 690582
Change-Id: I8f4074102dff3ef87b35d239f06ce2c93246d88d
Reviewed-on: https://chromium-review.googlesource.com/693861Reviewed-by: default avatarTommi <tommi@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532348}
parent f88e32ff
var RTCPeerConnection = null; /**
* Copyright 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
var getUserMedia = null; var getUserMedia = null;
var attachMediaStream = null; var attachMediaStream = null;
var reattachMediaStream = null; var reattachMediaStream = null;
...@@ -21,9 +26,6 @@ if (navigator.mozGetUserMedia) { ...@@ -21,9 +26,6 @@ if (navigator.mozGetUserMedia) {
webrtcDetectedVersion = webrtcDetectedVersion =
parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]); parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]);
// The RTCPeerConnection object.
RTCPeerConnection = mozRTCPeerConnection;
// The RTCSessionDescription object. // The RTCSessionDescription object.
RTCSessionDescription = mozRTCSessionDescription; RTCSessionDescription = mozRTCSessionDescription;
...@@ -97,9 +99,6 @@ if (navigator.mozGetUserMedia) { ...@@ -97,9 +99,6 @@ if (navigator.mozGetUserMedia) {
return iceServer; return iceServer;
}; };
// The RTCPeerConnection object.
RTCPeerConnection = webkitRTCPeerConnection;
// Get UserMedia (only difference is the prefix). // Get UserMedia (only difference is the prefix).
// Code from Adam Barth. // Code from Adam Barth.
getUserMedia = navigator.webkitGetUserMedia.bind(navigator); getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
...@@ -120,27 +119,6 @@ if (navigator.mozGetUserMedia) { ...@@ -120,27 +119,6 @@ if (navigator.mozGetUserMedia) {
reattachMediaStream = function(to, from) { reattachMediaStream = function(to, from) {
to.src = from.src; to.src = from.src;
}; };
// The representation of tracks in a stream is changed in M26.
// Unify them for earlier Chrome versions in the coexisting period.
if (!webkitMediaStream.prototype.getVideoTracks) {
webkitMediaStream.prototype.getVideoTracks = function() {
return this.videoTracks;
};
webkitMediaStream.prototype.getAudioTracks = function() {
return this.audioTracks;
};
}
// New syntax of getXXXStreams method in M26.
if (!webkitRTCPeerConnection.prototype.getLocalStreams) {
webkitRTCPeerConnection.prototype.getLocalStreams = function() {
return this.localStreams;
};
webkitRTCPeerConnection.prototype.getRemoteStreams = function() {
return this.remoteStreams;
};
}
} else { } else {
console.log("Browser does not appear to be WebRTC-capable"); console.log("Browser does not appear to be WebRTC-capable");
} }
...@@ -137,10 +137,10 @@ function initialize() { ...@@ -137,10 +137,10 @@ function initialize() {
trace('Setting up for a new call.'); trace('Setting up for a new call.');
var configs = {iceServers:[], rtcpMuxPolicy:'negotiate'}; var configs = {iceServers:[], rtcpMuxPolicy:'negotiate'};
var constraints = {'mandatory': {'DtlsSrtpKeyAgreement': false}}; var constraints = {'mandatory': {'DtlsSrtpKeyAgreement': false}};
pcClient = new webkitRTCPeerConnection(configs, constraints); pcClient = new RTCPeerConnection(configs, constraints);
trace('Created local peer connection object pcClient'); trace('Created local peer connection object pcClient');
pcClient.onicecandidate = onClientIceCandidate; pcClient.onicecandidate = onClientIceCandidate;
pcServer = new webkitRTCPeerConnection(configs, constraints); pcServer = new RTCPeerConnection(configs, constraints);
trace('Created remote peer connection object pcServer'); trace('Created remote peer connection object pcServer');
pcServer.onicecandidate = onServerIceCandidate; pcServer.onicecandidate = onServerIceCandidate;
pcServer.onaddstream = onServerGotStream; pcServer.onaddstream = onServerGotStream;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment