Commit af8a4054 authored by fukino's avatar fukino Committed by Commit bot

Correct condition and flag state for skipping PLAY request.

* When PLAY request for casted video is skipped, this.playInProgress_ was not cleared and this inconsistent state prevented the video from being played. I cleared the flag in this case.
* When PAUSE reqeust is in progress, incoming PLAY request should not be skipped. So I added a condition to skip the PLAY request.

BUG=417520,417538
TEST=manually tested the steps described in both bugs.

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

Cr-Commit-Position: refs/heads/master@{#297137}
parent 816f98b9
...@@ -224,8 +224,12 @@ CastVideoElement.prototype = { ...@@ -224,8 +224,12 @@ CastVideoElement.prototype = {
return; return;
var play = function() { var play = function() {
// If the casted media is already playing and a pause request is not in
// progress, we can skip this play request.
if (this.castMedia_.playerState === if (this.castMedia_.playerState ===
chrome.cast.media.PlayerState.PLAYING) { chrome.cast.media.PlayerState.PLAYING &&
!this.pauseInProgress_) {
this.playInProgress_ = false;
return; return;
} }
......
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