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

Unified Diff: remoting/webapp/client_session.js

Issue 386853002: Add a Record button to the web-app if the host supports video recording. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move implementation out to remoting.VideoFrameRecorder. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/client_screen.js ('k') | remoting/webapp/html/toolbar.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 3579b0d55327a22961752911e0d5bd42deeaa83d..ce09b2a628223c6b11a99995d88e71d732a7dd38 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -162,10 +162,15 @@ remoting.ClientSession = function(container, hostDisplayName, accessCode,
this.shrinkToFitButton_ = document.getElementById('screen-shrink-to-fit');
/** @type {HTMLElement} @private */
this.fullScreenButton_ = document.getElementById('toggle-full-screen');
+ /** @type {HTMLElement} @private */
+ this.recordingButton_ = document.getElementById('start-stop-recording');
/** @type {remoting.GnubbyAuthHandler} @private */
this.gnubbyAuthHandler_ = null;
+ /** @type {remoting.VideoFrameRecorder} @private */
+ this.videoFrameRecorder_ = null;
+
if (this.mode_ == remoting.ClientSession.Mode.IT2ME) {
// Resize-to-client is not supported for IT2Me hosts.
this.resizeToClientButton_.hidden = true;
@@ -175,6 +180,7 @@ remoting.ClientSession = function(container, hostDisplayName, accessCode,
this.fullScreenButton_.addEventListener(
'click', this.callToggleFullScreen_, false);
+
this.defineEvents(Object.keys(remoting.ClientSession.Events));
};
@@ -1080,6 +1086,13 @@ remoting.ClientSession.prototype.onSetCapabilities_ = function(capabilities) {
clientArea.height,
window.devicePixelRatio);
}
+ if (this.hasCapability_(
+ remoting.ClientSession.Capability.VIDEO_RECORDER)) {
+ this.videoFrameRecorder_ = new remoting.VideoFrameRecorder();
kelvinp 2014/08/15 23:37:31 This change looks pretty cool. Are we shipping thi
Sergey Ulanov 2014/08/16 00:16:58 This feature is disabled in the host by default an
+ this.recordingButton_.hidden = false;
+ this.recordingButton_.addEventListener(
+ 'click', this.videoFrameRecorder_.startStopRecording.bind(this), false);
+ }
};
/**
@@ -1578,3 +1591,14 @@ remoting.ClientSession.prototype.getPluginPositionForTesting = function() {
left: parseFloat(style.marginLeft)
};
};
+
+/**
+ *
+ */
+remoting.ClientSession.prototype.handleExtensionMessage =
+ function(type, data) {
+ if (this.videoFrameRecorder_) {
+ return this.videoFrameRecorder_.handleMessage(type, data);
+ }
+ return false;
+}
« no previous file with comments | « remoting/webapp/client_screen.js ('k') | remoting/webapp/html/toolbar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698