From cf609948956069cf1f67caca5a01f8fc0cfc6325 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 4 Dec 2014 15:55:15 -0600 Subject: [PATCH] Dailymotion is a completely functional site programmed by competent people --- www/js/player.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/js/player.js b/www/js/player.js index 9c1029af..61cc673f 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -415,7 +415,14 @@ var DailymotionPlayer = function (data) { self.getVolume = function (cb) { if (self.player) { - cb(self.player.volume); + var volume = self.player.muted ? 0 : self.player.volume; + /* + * If the volume was changed by the UI slider, it will be in the range + * [0, 100], otherwise if it was only set by the API, it will be in [0, 1]. + */ + if (volume > 1) volume /= 100.0; + + cb(volume); } };