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

Unified Diff: ui/file_manager/video_player/js/video_player.js

Issue 806163003: Adds histograms for casting feature of Video Player Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 years 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
Index: ui/file_manager/video_player/js/video_player.js
diff --git a/ui/file_manager/video_player/js/video_player.js b/ui/file_manager/video_player/js/video_player.js
index 1c6e04abed05409ce0631908acdbfb6fd65c431b..58da165da0c0e50a38d3639c9712ec4d86ada55d 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -318,6 +318,8 @@ VideoPlayer.prototype.loadVideo_ = function(video, opt_callback) {
var videoElementInitializePromise;
if (this.currentCast_) {
+ metrics.recordPlayType(metrics.PLAY_TYPE.CAST);
+
videoPlayerElement.setAttribute('casting', true);
document.querySelector('#cast-name').textContent =
@@ -342,6 +344,7 @@ VideoPlayer.prototype.loadVideo_ = function(video, opt_callback) {
}.bind(this));
}.bind(this));
} else {
+ metrics.recordPlayType(metrics.PLAY_TYPE.LOCAL);
videoPlayerElement.removeAttribute('casting');
this.videoElement_ = document.createElement('video');
@@ -390,6 +393,9 @@ VideoPlayer.prototype.loadVideo_ = function(video, opt_callback) {
}.bind(this))
// In case of error.
.catch(function(error) {
+ if (this.currentCast_)
+ metrics.recordCastVideoErrorAction();
+
videoPlayerElement.removeAttribute('loading');
console.error('Failed to initialize the video element.',
error.stack || error);
@@ -668,6 +674,10 @@ var initPromise = Promise.all(
initPromise.then(function(results) {
var videos = results[0];
+
+ metrics.recordOpenVideoPlayerAction();
+ metrics.recordNumberOfOpenedFiles(videos.length);
+
player.prepare(videos);
return new Promise(player.playFirstVideo.wrap(player));
}.wrap(null));
« no previous file with comments | « ui/file_manager/video_player/js/cast/caster.js ('k') | ui/file_manager/video_player/js/video_player_metrics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698