diff --git a/src/renderer/store/modules/utils.js b/src/renderer/store/modules/utils.js index 9027c138d..014b475a2 100644 --- a/src/renderer/store/modules/utils.js +++ b/src/renderer/store/modules/utils.js @@ -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}`) diff --git a/static/external-player-map.json b/static/external-player-map.json index 0885eb40b..a58f95495 100644 --- a/static/external-player-map.json +++ b/static/external-player-map.json @@ -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 + } } ]