Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: remoting/webapp/client_plugin_async.js

Issue 11192042: Protocol plumbing for audio toggle. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 };
OLDNEW
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698