Add basic support for PotPlayer, MPC-HC, MPC-BE (#3798)

* Add basic support for mpc-hc/be, sort list

* Add startOffset handling for mpc-hc family

* Add basic PotPlayer support

* Fix indentations

* Undo entry sorting
This commit is contained in:
trostboot 2023-07-29 12:24:55 +02:00 committed by GitHub
parent b1fa24857e
commit 01930e46f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 1 deletions

View File

@ -529,7 +529,10 @@ const actions = {
if (payload.watchProgress > 0 && payload.watchProgress < payload.videoLength - 10) {
if (typeof cmdArgs.startOffset === 'string') {
if (cmdArgs.startOffset.endsWith('=')) {
if (cmdArgs.defaultExecutable.startsWith('mpc')) {
// For mpc-hc and mpc-be, which require startOffset to be in milliseconds
args.push(cmdArgs.startOffset, (Math.trunc(payload.watchProgress) * 1000))
} else if (cmdArgs.startOffset.endsWith('=')) {
// For players using `=` in arguments
// e.g. vlc --start-time=xxxxx
args.push(`${cmdArgs.startOffset}${payload.watchProgress}`)

View File

@ -76,5 +76,59 @@
"playlistShuffle": null,
"playlistLoop": null
}
},
{
"name": "MPC-BE",
"nameTranslationKey": "Settings.External Player Settings.Players.MPC-BE.Name",
"value": "mpc-be",
"cmdArguments": {
"defaultExecutable": "mpc-be64",
"defaultCustomArguments": null,
"supportsYtdlProtocol": true,
"videoUrl": "",
"playlistUrl": "",
"startOffset": "/start",
"playbackRate": null,
"playlistIndex": null,
"playlistReverse": null,
"playlistShuffle": null,
"playlistLoop": null
}
},
{
"name": "MPC-HC",
"nameTranslationKey": "Settings.External Player Settings.Players.MPC-HC.Name",
"value": "mpc-hc",
"cmdArguments": {
"defaultExecutable": "mpc-hc64",
"defaultCustomArguments": null,
"supportsYtdlProtocol": true,
"videoUrl": "",
"playlistUrl": "",
"startOffset": "/start",
"playbackRate": null,
"playlistIndex": null,
"playlistReverse": null,
"playlistShuffle": null,
"playlistLoop": null
}
},
{
"name": "PotPlayer",
"nameTranslationKey": "Settings.External Player Settings.Players.PotPlayer.Name",
"value": "potplayer",
"cmdArguments": {
"defaultExecutable": "potplayermini64",
"defaultCustomArguments": null,
"supportsYtdlProtocol": false,
"videoUrl": "",
"playlistUrl": null,
"startOffset": "/seek=",
"playbackRate": null,
"playlistIndex": null,
"playlistReverse": null,
"playlistShuffle": null,
"playlistLoop": null
}
}
]