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

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

Issue 568673003: Video Player: Don't check the volume value on unmuting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/cast/cast_video_element.js
diff --git a/ui/file_manager/video_player/js/cast/cast_video_element.js b/ui/file_manager/video_player/js/cast/cast_video_element.js
index 0a2a930615edd7be4dabb81a959c3b2714199f0f..d61396494257871783b63e6b36429d79415c1fe5 100644
--- a/ui/file_manager/video_player/js/cast/cast_video_element.js
+++ b/ui/file_manager/video_player/js/cast/cast_video_element.js
@@ -149,9 +149,6 @@ CastVideoElement.prototype = {
set volume(volume) {
var VOLUME_EPS = 0.01; // Threshold for ignoring a small change.
- // Ignores < 1% change.
- if (Math.abs(this.castSession_.receiver.volume.level - volume) < VOLUME_EPS)
- return;
if (this.castSession_.receiver.volume.muted) {
if (volume < VOLUME_EPS)
@@ -166,6 +163,11 @@ CastVideoElement.prototype = {
function() {},
this.onCastCommandError_.wrap(this));
} else {
+ // Ignores < 1% change.
+ var diff = this.castSession_.receiver.volume.level - volume;
+ if (Math.abs(diff) < VOLUME_EPS)
+ return;
+
if (volume < VOLUME_EPS) {
this.castSession_.setReceiverMuted(true,
function() {},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698