Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Default Playback Speed settings #435

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion native/mpvVideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
/**
* @type {float}
*/
this._playRate = 1;
this._playRate;
/**
* @type {boolean}
*/
Expand Down Expand Up @@ -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;
}

Expand Down
13 changes: 13 additions & 0 deletions resources/settings/settings_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
]
}
]
},
Expand Down