diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js index 08ad854079c633..331702dc36e85b 100644 --- a/remoting/webapp/client_session.js +++ b/remoting/webapp/client_session.js @@ -505,8 +505,11 @@ remoting.ClientSession.prototype.onPluginInitialized_ = function(initialized) { this.applyRemapKeys_(true); } - // Enable MediaSource-based rendering if available. - if (remoting.settings.USE_MEDIA_SOURCE_RENDERING && + + // Enable MediaSource-based rendering on Chrome 37 and above. + var chromeVersionMajor = + parseInt((remoting.getChromeVersion() || '0').split('.')[0], 10); + if (chromeVersionMajor >= 37 && this.plugin_.hasFeature( remoting.ClientPlugin.Feature.MEDIA_SOURCE_RENDERING)) { this.video_ = /** @type {HTMLMediaElement} */( diff --git a/remoting/webapp/plugin_settings.js b/remoting/webapp/plugin_settings.js index 2d1f26496ac64d..03ac7416f02978 100644 --- a/remoting/webapp/plugin_settings.js +++ b/remoting/webapp/plugin_settings.js @@ -52,8 +52,5 @@ remoting.Settings.prototype.XMPP_SERVER_USE_TLS = remoting.Settings.prototype.THIRD_PARTY_AUTH_REDIRECT_URI = 'THIRD_PARTY_AUTH_REDIRECT_URL'; -// Whether to use MediaSource API for video rendering. -remoting.Settings.prototype.USE_MEDIA_SOURCE_RENDERING = false; - // 'native', 'nacl' or 'pnacl'. remoting.Settings.prototype.CLIENT_PLUGIN_TYPE = 'CLIENT_PLUGIN_TYPE'; diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js index 52357f7422128e..ffb078b4ea2754 100644 --- a/remoting/webapp/remoting.js +++ b/remoting/webapp/remoting.js @@ -325,6 +325,18 @@ remoting.getExtensionInfo = function() { } }; +/** + * Returns Chrome version. + * @return {string?} + */ +remoting.getChromeVersion = function() { + var match = new RegExp('Chrome/([0-9.]*)').exec(navigator.userAgent); + if (match && (match.length >= 2)) { + return match[1]; + } + return null; +}; + /** * If an IT2Me client or host is active then prompt the user before closing. * If a Me2Me client is active then don't bother, since closing the window is diff --git a/remoting/webapp/server_log_entry.js b/remoting/webapp/server_log_entry.js index cd758b9953cb18..557f014c042098 100644 --- a/remoting/webapp/server_log_entry.js +++ b/remoting/webapp/server_log_entry.js @@ -421,37 +421,12 @@ remoting.ServerLogEntry.extractHostDataFrom = function(s) { * Adds a field specifying the browser version to this log entry. */ remoting.ServerLogEntry.prototype.addChromeVersionField = function() { - var version = remoting.ServerLogEntry.getChromeVersion(); + var version = remoting.getChromeVersion(); if (version != null) { this.set(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); } }; -/** - * Extracts the Chrome version from the userAgent string. - * - * @private - * @return {string | null} - */ -remoting.ServerLogEntry.getChromeVersion = function() { - return remoting.ServerLogEntry.extractChromeVersionFrom(navigator.userAgent); -}; - -/** - * Extracts the Chrome version from the given userAgent string. - * - * @private - * @param {string} s - * @return {string | null} - */ -remoting.ServerLogEntry.extractChromeVersionFrom = function(s) { - var match = new RegExp('Chrome/([0-9.]*)').exec(s); - if (match && (match.length >= 2)) { - return match[1]; - } - return null; -}; - /** * Adds a field specifying the webapp version to this log entry. */