OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
8 * | 8 * |
9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 } else if (this.mode_ != remoting.ClientSession.Mode.ME2ME) { | 498 } else if (this.mode_ != remoting.ClientSession.Mode.ME2ME) { |
499 var sendCadElement = document.getElementById('send-ctrl-alt-del'); | 499 var sendCadElement = document.getElementById('send-ctrl-alt-del'); |
500 sendCadElement.hidden = true; | 500 sendCadElement.hidden = true; |
501 } | 501 } |
502 | 502 |
503 // Apply customized key remappings if the plugin supports remapKeys. | 503 // Apply customized key remappings if the plugin supports remapKeys. |
504 if (this.plugin_.hasFeature(remoting.ClientPlugin.Feature.REMAP_KEY)) { | 504 if (this.plugin_.hasFeature(remoting.ClientPlugin.Feature.REMAP_KEY)) { |
505 this.applyRemapKeys_(true); | 505 this.applyRemapKeys_(true); |
506 } | 506 } |
507 | 507 |
508 // Enable MediaSource-based rendering if available. | 508 |
509 if (remoting.settings.USE_MEDIA_SOURCE_RENDERING && | 509 // Enable MediaSource-based rendering on Chrome 37 and above. |
| 510 var chromeVersionMajor = |
| 511 parseInt((remoting.getChromeVersion() || '0').split('.')[0], 10); |
| 512 if (chromeVersionMajor >= 37 && |
510 this.plugin_.hasFeature( | 513 this.plugin_.hasFeature( |
511 remoting.ClientPlugin.Feature.MEDIA_SOURCE_RENDERING)) { | 514 remoting.ClientPlugin.Feature.MEDIA_SOURCE_RENDERING)) { |
512 this.video_ = /** @type {HTMLMediaElement} */( | 515 this.video_ = /** @type {HTMLMediaElement} */( |
513 document.getElementById('mediasource-video-output')); | 516 document.getElementById('mediasource-video-output')); |
514 // Make sure that the <video> element is hidden until we get the first | 517 // Make sure that the <video> element is hidden until we get the first |
515 // frame. | 518 // frame. |
516 this.video_.style.width = '0px'; | 519 this.video_.style.width = '0px'; |
517 this.video_.style.height = '0px'; | 520 this.video_.style.height = '0px'; |
518 | 521 |
519 var renderer = new remoting.MediaSourceRenderer(this.video_); | 522 var renderer = new remoting.MediaSourceRenderer(this.video_); |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 * @return {{width: number, height: number}} The height of the window's client | 1510 * @return {{width: number, height: number}} The height of the window's client |
1508 * area. This differs between apps v1 and apps v2 due to the custom window | 1511 * area. This differs between apps v1 and apps v2 due to the custom window |
1509 * borders used by the latter. | 1512 * borders used by the latter. |
1510 * @private | 1513 * @private |
1511 */ | 1514 */ |
1512 remoting.ClientSession.prototype.getClientArea_ = function() { | 1515 remoting.ClientSession.prototype.getClientArea_ = function() { |
1513 return remoting.windowFrame ? | 1516 return remoting.windowFrame ? |
1514 remoting.windowFrame.getClientArea() : | 1517 remoting.windowFrame.getClientArea() : |
1515 { 'width': window.innerWidth, 'height': window.innerHeight }; | 1518 { 'width': window.innerWidth, 'height': window.innerHeight }; |
1516 } | 1519 } |
OLD | NEW |