Skip to content

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

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

Merged
merged 5 commits into from
Jul 29, 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
5 changes: 4 additions & 1 deletion src/renderer/store/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down
54 changes: 54 additions & 0 deletions static/external-player-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
]