mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-11-26 19:59:56 +01:00
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:
parent
b1fa24857e
commit
01930e46f6
@ -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}`)
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user