Commit 61664cb5 authored by sergeyu@chromium.org's avatar sergeyu@chromium.org

Enable MediaSource rendering in chromoting client with Chrome 37.

Bug 338529 has been fixed in Chrome 37, so MediaSource renderer
should work properly now on all platforms.

BUG=321825
R=jamiewalch@chromium.org

Review URL: https://codereview.chromium.org/344483002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277891 0039d316-1c4b-4281-b951-d872f2087c98
parent a65cce40
...@@ -505,8 +505,11 @@ remoting.ClientSession.prototype.onPluginInitialized_ = function(initialized) { ...@@ -505,8 +505,11 @@ remoting.ClientSession.prototype.onPluginInitialized_ = function(initialized) {
this.applyRemapKeys_(true); 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( this.plugin_.hasFeature(
remoting.ClientPlugin.Feature.MEDIA_SOURCE_RENDERING)) { remoting.ClientPlugin.Feature.MEDIA_SOURCE_RENDERING)) {
this.video_ = /** @type {HTMLMediaElement} */( this.video_ = /** @type {HTMLMediaElement} */(
......
...@@ -52,8 +52,5 @@ remoting.Settings.prototype.XMPP_SERVER_USE_TLS = ...@@ -52,8 +52,5 @@ remoting.Settings.prototype.XMPP_SERVER_USE_TLS =
remoting.Settings.prototype.THIRD_PARTY_AUTH_REDIRECT_URI = remoting.Settings.prototype.THIRD_PARTY_AUTH_REDIRECT_URI =
'THIRD_PARTY_AUTH_REDIRECT_URL'; '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'. // 'native', 'nacl' or 'pnacl'.
remoting.Settings.prototype.CLIENT_PLUGIN_TYPE = 'CLIENT_PLUGIN_TYPE'; remoting.Settings.prototype.CLIENT_PLUGIN_TYPE = 'CLIENT_PLUGIN_TYPE';
...@@ -325,6 +325,18 @@ remoting.getExtensionInfo = function() { ...@@ -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 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 * If a Me2Me client is active then don't bother, since closing the window is
......
...@@ -421,37 +421,12 @@ remoting.ServerLogEntry.extractHostDataFrom = function(s) { ...@@ -421,37 +421,12 @@ remoting.ServerLogEntry.extractHostDataFrom = function(s) {
* Adds a field specifying the browser version to this log entry. * Adds a field specifying the browser version to this log entry.
*/ */
remoting.ServerLogEntry.prototype.addChromeVersionField = function() { remoting.ServerLogEntry.prototype.addChromeVersionField = function() {
var version = remoting.ServerLogEntry.getChromeVersion(); var version = remoting.getChromeVersion();
if (version != null) { if (version != null) {
this.set(remoting.ServerLogEntry.KEY_BROWSER_VERSION_, version); 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. * Adds a field specifying the webapp version to this log entry.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment