OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Interval for updating media info (in ms). | 6 * Interval for updating media info (in ms). |
7 * @type {number} | 7 * @type {number} |
8 * @const | 8 * @const |
9 */ | 9 */ |
10 var MEDIA_UPDATE_INTERVAL = 250; | 10 var MEDIA_UPDATE_INTERVAL = 250; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 play: function(opt_seeking) { | 220 play: function(opt_seeking) { |
221 if (this.playInProgress_) | 221 if (this.playInProgress_) |
222 return; | 222 return; |
223 | 223 |
224 var play = function() { | 224 var play = function() { |
225 // If the casted media is already playing and a pause request is not in | 225 // If the casted media is already playing and a pause request is not in |
226 // progress, we can skip this play request. | 226 // progress, we can skip this play request. |
227 if (this.castMedia_.playerState === | 227 if (this.castMedia_.playerState === |
228 chrome.cast.media.PlayerState.PLAYING && | 228 chrome.cast.media.PlayerState.PLAYING && |
229 !this.pauseInProgress_) { | 229 !this.pauseInProgress_) { |
230 metrics.recordCastedVideoLength(this.currentMediaDuration_); | |
fukino
2014/12/10 08:01:47
It seems that the code here is for avoiding sendin
yoshiki
2014/12/10 09:33:19
Sorry, I added it the wrong place. Fixed.
fukino
2014/12/10 10:16:42
IIRC, when a user repeat PAUSE->PLAY->PAUSE->PLAY,
fukino
2014/12/10 12:18:31
It looks OK to record here, given that covering ca
| |
231 | |
230 this.playInProgress_ = false; | 232 this.playInProgress_ = false; |
231 return; | 233 return; |
232 } | 234 } |
233 | 235 |
234 var playRequest = new chrome.cast.media.PlayRequest(); | 236 var playRequest = new chrome.cast.media.PlayRequest(); |
235 playRequest.customData = {seeking: !!opt_seeking}; | 237 playRequest.customData = {seeking: !!opt_seeking}; |
236 | 238 |
237 this.castMedia_.play( | 239 this.castMedia_.play( |
238 playRequest, | 240 playRequest, |
239 function() { | 241 function() { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 this.dispatchEvent(new Event('durationchange')); | 492 this.dispatchEvent(new Event('durationchange')); |
491 } | 493 } |
492 | 494 |
493 // Media is being unloaded. | 495 // Media is being unloaded. |
494 if (!alive) { | 496 if (!alive) { |
495 this.unloadMedia_(); | 497 this.unloadMedia_(); |
496 return; | 498 return; |
497 } | 499 } |
498 }, | 500 }, |
499 }; | 501 }; |
OLD | NEW |