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

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

Issue 760853003: Adds histograms for casting feature of Video Player (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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..2c7c80f5e956144f5d07443c4449c8448d018329 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.recordUserAction('CastVideo');
Ilya Sherman 2014/12/02 23:45:10 This looks like you're recording a user action rat
yoshiki 2014/12/08 02:52:29 Thanks for guidance. I've changed it to recording
+
videoPlayerElement.setAttribute('casting', true);
document.querySelector('#cast-name').textContent =
@@ -390,6 +392,9 @@ VideoPlayer.prototype.loadVideo_ = function(video, opt_callback) {
}.bind(this))
// In case of error.
.catch(function(error) {
+ if (this.currentCast_)
+ metrics.recordUserAction('CastVideoError');
+
videoPlayerElement.removeAttribute('loading');
console.error('Failed to initialize the video element.',
error.stack || error);
@@ -668,6 +673,10 @@ var initPromise = Promise.all(
initPromise.then(function(results) {
var videos = results[0];
+
+ metrics.recordUserAction('OpenVideoPlayer');
+ metrics.recordSmallCount('NumberOfOpenedFiles', videos.length);
+
player.prepare(videos);
return new Promise(player.playFirstVideo.wrap(player));
}.wrap(null));

Powered by Google App Engine
This is Rietveld 408576698