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

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: function -> var 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/window_frame.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 f53898bd8d1f74bc1938e0fed93918c70d3721ca..4149364a4bbad668544e788a6ad83efd6bce2fb1 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -176,6 +176,9 @@ remoting.ClientSession = function(container, hostDisplayName, accessCode,
/** @type {remoting.CastExtensionHandler} @private */
this.castExtensionHandler_ = 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;
@@ -185,6 +188,7 @@ remoting.ClientSession = function(container, hostDisplayName, accessCode,
this.fullScreenButton_.addEventListener(
'click', this.callToggleFullScreen_, false);
+
this.defineEvents(Object.keys(remoting.ClientSession.Events));
};
@@ -1054,6 +1058,10 @@ remoting.ClientSession.prototype.onSetCapabilities_ = function(capabilities) {
clientArea.height,
window.devicePixelRatio);
}
+ if (this.hasCapability_(
+ remoting.ClientSession.Capability.VIDEO_RECORDER)) {
+ this.videoFrameRecorder_ = new remoting.VideoFrameRecorder(this.plugin_);
+ }
};
/**
@@ -1593,3 +1601,44 @@ remoting.ClientSession.prototype.createCastExtensionHandler_ = function() {
}
};
+/**
+ * Returns true if the ClientSession can record video frames to a file.
+ * @return {boolean}
+ */
+remoting.ClientSession.prototype.canRecordVideo = function() {
+ return !!this.videoFrameRecorder_;
+}
+
+/**
+ * Returns true if the ClientSession is currently recording video frames.
+ * @return {boolean}
+ */
+remoting.ClientSession.prototype.isRecordingVideo = function() {
+ if (!this.videoFrameRecorder_) {
+ return false;
+ }
+ return this.videoFrameRecorder_.isRecording();
+}
+
+/**
+ * Starts or stops recording of video frames.
+ */
+remoting.ClientSession.prototype.startStopRecording = function() {
+ if (this.videoFrameRecorder_) {
+ this.videoFrameRecorder_.startStopRecording();
+ }
+}
+
+/**
+ * Handles protocol extension messages.
+ * @param {string} type Type of extension message.
+ * @param {string} data Contents of the extension message.
+ * @return {boolean} True if the message was recognized, false otherwise.
+ */
+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/window_frame.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698