mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
videos: save last volume
This commit is contained in:
parent
f57647d24e
commit
43569748ae
1 changed files with 11 additions and 1 deletions
|
@ -161,8 +161,13 @@ export default {
|
||||||
|
|
||||||
const noPrevPlayer = !this.player;
|
const noPrevPlayer = !this.player;
|
||||||
|
|
||||||
if (noPrevPlayer)
|
if (noPrevPlayer) {
|
||||||
this.player = videojs(this.$refs.player, options);
|
this.player = videojs(this.$refs.player, options);
|
||||||
|
if (localStorage)
|
||||||
|
this.player.volume(
|
||||||
|
localStorage.getItem("volume") || 1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
this.player.hotkeys({
|
this.player.hotkeys({
|
||||||
volumeStep: 0.1,
|
volumeStep: 0.1,
|
||||||
|
@ -264,6 +269,11 @@ export default {
|
||||||
|
|
||||||
this.player.on("volumechange", () => {
|
this.player.on("volumechange", () => {
|
||||||
this.audioplayer.volume = this.player.volume();
|
this.audioplayer.volume = this.player.volume();
|
||||||
|
if (localStorage)
|
||||||
|
localStorage.setItem(
|
||||||
|
"volume",
|
||||||
|
this.player.volume()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.player.on("ended", () => {
|
this.player.on("ended", () => {
|
||||||
|
|
Loading…
Reference in a new issue