Lines Matching defs:this

3  * Use of this source code is governed by a BSD-style license that can be
23 this.localConnection = null;
24 this.remoteConnection = null;
25 this.remoteView = videoElement;
26 this.streams = [];
29 this.resolutions = resolutions.slice().sort((x, y) => y.w - x.w);
30 this.activeStreamIndex = resolutions.length - 1;
31 this.badResolutionsSeen = 0;
33 this.pcConstraints = {
41 * to render the video on {@code this.videoElement}.
48 const promises = this.resolutions.map((resolution) => {
52 .then((stream) => this.streams.push(stream));
56 return this.onGetUserMediaSuccess_(this.streams[this.activeStreamIndex]);
75 this.verifyAllStreamsActive_();
76 const expectedResolution = this.resolutions[this.activeStreamIndex];
82 this.remoteView.videoWidth, expectedResolution.w, allowedDelta) ||
84 this.remoteView.videoHeight, expectedResolution.h, allowedDelta)) {
85 this.badResolutionsSeen++;
87 this.badResolutionsSeen < numSequentialBadResolutionsForFailure) {
90 this.badResolutionsSeen = 0;
92 if (this.badResolutionsSeen >= numSequentialBadResolutionsForFailure) {
96 ' but got another resolution ' + this.badResolutionsSeen +
98 resStr(this.remoteView.videoWidth, this.remoteView.videoHeight));
103 if (this.streams.some((x) => !x.active)) {
114 const localStreams = this.localConnection.getLocalStreams();
117 this.localConnection.removeStream(track);
118 const newStreamIndex = Math.floor(Math.random() * this.streams.length);
119 return this.addStream_(this.streams[newStreamIndex])
120 .then(() => this.activeStreamIndex = newStreamIndex);
127 this.localConnection = new RTCPeerConnection(null, this.pcConstraints);
128 this.localConnection.onicecandidate = (event) => {
129 this.onIceCandidate_(this.remoteConnection, event);
131 this.remoteConnection = new RTCPeerConnection(null, this.pcConstraints);
132 this.remoteConnection.onicecandidate = (event) => {
133 this.onIceCandidate_(this.localConnection, event);
135 this.remoteConnection.onaddstream = (e) => {
136 this.remoteView.srcObject = e.stream;
138 return this.addStream_(stream);
142 this.localConnection.addStream(stream);
143 return this.localConnection
145 .then((desc) => this.onCreateOfferSuccess_(desc), logError);
149 this.localConnection.setLocalDescription(desc);
150 this.remoteConnection.setRemoteDescription(desc);
151 return this.remoteConnection.createAnswer().then(
152 (desc) => this.onCreateAnswerSuccess_(desc), logError);
156 this.remoteConnection.setLocalDescription(desc);
157 this.localConnection.setRemoteDescription(desc);