Browse Source

Add Default Playback Speed settings

Allow for a default playback rate to be set for video player
Jack Maiden 11 months ago
parent
commit
09ba544996
2 changed files with 23 additions and 1 deletions
  1. 10 1
      native/mpvVideoPlayer.js
  2. 13 0
      resources/settings/settings_description.json

+ 10 - 1
native/mpvVideoPlayer.js

@@ -108,7 +108,7 @@
             /**
              * @type {float}
              */
-            this._playRate = 1;
+            this._playRate;
             /**
              * @type {boolean}
              */
@@ -678,6 +678,15 @@
     }
 
     getPlaybackRate() {
+        if(!this._playRate) //On startup grab default
+        {
+            let playRate = window.jmpInfo.settings.video.default_playback_speed;
+
+            if(!playRate) //fallback if default missing
+                playRate = 1;
+
+            this._playRate = playRate;
+        }
         return this._playRate;
     }
 

+ 13 - 0
resources/settings/settings_description.json

@@ -383,6 +383,19 @@
           [ "noscaling", "video.aspect.noscale" ],
           [ "custom", "video.aspect.custom" ]
         ]
+      },
+      {
+        "value": "default_playback_speed",
+        "default": 1.0,
+        "possible_values": [
+          [ 0.5, "0.5x" ],
+          [ 0.75, "0.75x" ],
+          [ 1.0, "1x" ],
+          [ 1.25, "1.25x" ],
+          [ 1.5, "1.5x" ],
+          [ 1.75, "1.75x" ],
+          [ 2.0, "2x" ]
+        ]
       }
     ]
   },