Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

volume(level, true) changes localStorage.volume when called from within event #1264

Closed
phloxic opened this issue Sep 22, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@phloxic
Copy link
Contributor

phloxic commented Sep 22, 2017

It should skip storage when the 2nd argument is true.
Also localStorage.volume has not changed to conf.volume on ready.

Demo will be available at http://demos.flowplayer.org/bug/1264.html

@phloxic
Copy link
Contributor Author

phloxic commented Sep 23, 2017

Additionally the timing of the localStorage change varies. If I change the demo code from:

}).on("ready cuepoint", function (e, api) {
  if (e.type === "cuepoint") api.volume(0, true);
  document.getElementById("lsvolume").innerHTML = e.type + " -> " + window.localStorage.volume;
});

to

}).on("ready cuepoint", function (e, api) {
  if (e.type === "cuepoint") api.volume(0, true);
  document.getElementById("lsvolume").innerHTML = e.type + " -> " + window.localStorage.volume;
}).one("progress", function (e, api) {
  document.getElementById("lsvolume").innerHTML = e.type + " -> " + window.localStorage.volume;
});

The call on cuepoint seems to work, but it doesn't which can be revealed with:

}).on("ready cuepoint", function (e, api) {
  if (e.type === "cuepoint") api.volume(0, true);
  setTimeout(function () {
    document.getElementById("lsvolume").innerHTML = e.type + " -> " + window.localStorage.volume;
  });
}).one("progress", function (e, api) {
  document.getElementById("lsvolume").innerHTML = e.type + " -> " + window.localStorage.volume;
});

That is: a query of localStorage changes the timing of when it is next changed ...

@phloxic
Copy link
Contributor Author

phloxic commented Sep 23, 2017

The same with api.mute(true, true) -> localStorage.volume becomes "0" (localStorage.muted stays false).

phloxic added a commit to flowplayer/flowplayer-background that referenced this issue Sep 23, 2017
Currently api.mute(true, true) and api.volume(0, true) change
localStorage when called from within event.
cf. flowplayer/flowplayer#1264

Right now users must configure muted.
Which is recommended anyway because of:
1. mutedAutoplay
2. Safari 11 - flowplayer/flowplayer#1260
@nnarhinen
Copy link
Contributor

Is this still true in 7.2?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants