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 that wraps low-level details of interacting with the client plugin. | 7 * Class that wraps low-level details of interacting with the client plugin. |
8 * | 8 * |
9 * This abstracts a <embed> element and controls the plugin which does | 9 * This abstracts a <embed> element and controls the plugin which does |
10 * the actual remoting work. It also handles differences between | 10 * the actual remoting work. It also handles differences between |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 */ | 392 */ |
393 remoting.ClientPluginAsync.prototype.pauseVideo = | 393 remoting.ClientPluginAsync.prototype.pauseVideo = |
394 function(pause) { | 394 function(pause) { |
395 if (!this.hasFeature(remoting.ClientPlugin.Feature.PAUSE_VIDEO)) | 395 if (!this.hasFeature(remoting.ClientPlugin.Feature.PAUSE_VIDEO)) |
396 return; | 396 return; |
397 this.plugin.postMessage(JSON.stringify( | 397 this.plugin.postMessage(JSON.stringify( |
398 { method: 'pauseVideo', data: { pause: pause }})); | 398 { method: 'pauseVideo', data: { pause: pause }})); |
399 }; | 399 }; |
400 | 400 |
401 /** | 401 /** |
| 402 * Requests that the host pause or resume sending audio updates. |
| 403 * |
| 404 * @param {boolean} pause True to suspend audio updates, false otherwise. |
| 405 */ |
| 406 remoting.ClientPluginAsync.prototype.pauseAudio = |
| 407 function(pause) { |
| 408 if (!this.hasFeature(remoting.ClientPlugin.Feature.PAUSE_AUDIO)) |
| 409 return; |
| 410 this.plugin.postMessage(JSON.stringify( |
| 411 { method: 'pauseAudio', data: { pause: pause }})); |
| 412 }; |
| 413 |
| 414 /** |
402 * If we haven't yet received a "hello" message from the plugin, change its | 415 * If we haven't yet received a "hello" message from the plugin, change its |
403 * size so that the user can confirm it if click-to-play is enabled, or can | 416 * size so that the user can confirm it if click-to-play is enabled, or can |
404 * see the "this plugin is disabled" message if it is actually disabled. | 417 * see the "this plugin is disabled" message if it is actually disabled. |
405 * @private | 418 * @private |
406 */ | 419 */ |
407 remoting.ClientPluginAsync.prototype.showPluginForClickToPlay_ = function() { | 420 remoting.ClientPluginAsync.prototype.showPluginForClickToPlay_ = function() { |
408 if (!this.helloReceived_) { | 421 if (!this.helloReceived_) { |
409 var width = 200; | 422 var width = 200; |
410 var height = 200; | 423 var height = 200; |
411 this.plugin.width = width; | 424 this.plugin.width = width; |
412 this.plugin.height = height; | 425 this.plugin.height = height; |
413 // Center the plugin just underneath the "Connnecting..." dialog. | 426 // Center the plugin just underneath the "Connnecting..." dialog. |
414 var parentNode = this.plugin.parentNode; | 427 var parentNode = this.plugin.parentNode; |
415 var dialog = document.getElementById('client-dialog'); | 428 var dialog = document.getElementById('client-dialog'); |
416 var dialogRect = dialog.getBoundingClientRect(); | 429 var dialogRect = dialog.getBoundingClientRect(); |
417 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; | 430 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; |
418 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; | 431 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; |
419 } | 432 } |
420 }; | 433 }; |
OLD | NEW |