Repository navigation
Add PotPlayer support - #812
DrSaeedHub wants to merge 1 commit into
Conversation
Control PotPlayer (Windows) through the remote-control window messages of the PotPlayer SDK, using only ctypes. - Play state, position, duration, file path, speed and OSD via SendMessage / WM_COPYDATA. - PotPlayer only refreshes its reported time every ~500 ms (each refresh is exact), so the position is interpolated between refreshes from a 5 ms poll. - Slowdown on desync is supported (speed is settable). - Files are opened in the same window with `/current` when Syncplay's PotPlayer is the only one running; otherwise a fresh `/new` window replaces it, so a PotPlayer the user already had open is never taken over. - Waits for a newly loaded file to actually start before applying the room state, and re-applies pause while PotPlayer is still settling. - End of file is reported to the client instead of PotPlayer's reset to 0. - Detects PotPlayer seeking to keyframes, warns once, and then skips sub-second corrective seeks that would land seconds away.
|
Hi, we've had people suggest support for additional media players over the years, but this is the first time we've received a complete implementation. Your PR has prompted a discussion among the core Syncplay developers about whether we want to expand the range of media players we support, particularly given our experience maintaining the existing integrations. Syncplay works really well with mpv, which is what we use ourselves and are best placed to support. We've found that getting other players from an initial implementation to a smooth, reliable experience requires considerable testing, bug fixes and ongoing maintenance. Other players can also require workarounds and compromises that make synchronisation less reliable or result in a poorer implementation of certain Syncplay features. We already support several mpv-based players, including mpv itself, mpv.net (my favourite), IINA and memento, offering users a choice of interfaces across different platforms. We believe these provide sufficient variety for Syncplay's intended use cases. If anything, we'd rather reduce the number of player integrations we have to maintain than expand it further. As a result of this discussion, we've updated our FAQ to clarify that, for the foreseeable future, we'll only consider new players that can build on our existing mpv integration. I appreciate this will be disappointing given the work you've put into the implementation, but I hope the reasoning behind our decision makes sense. Thanks for contributing, and I'm going to close this PR in line with our updated policy. If you have other big ideas for Syncplay, feel free to discuss them in our [Ideas Discussions](https://github.com/Syncplay/syncplay/discussions/categories/ideas) before putting time into implementing them. If I haven't responded within a month, feel free to send me a reminder via my public email address. |
|
Thanks for the detailed explanation, and no problem at all — I completely understand the decision, especially given the effort it takes to keep each player integration working well. Since I need PotPlayer support myself, I'll keep building and using it from my own fork. Thanks again for Syncplay! |
Adds PotPlayer (Windows) as a supported player.
PotPlayer is controlled through the remote-control window messages of the PotPlayer SDK (
SendMessage(hwnd, WM_USER, POT_..., value), plusWM_COPYDATAfor strings). The new player only usesctypes, so it adds no dependency, and it follows the existingBasePlayercontract, soclient.pyand the GUI are unchanged: the player is picked up throughPlayerFactory, including default install paths and an icon.What is supported
PotPlayer quirks the implementation handles
askForStatus()returns a position accurate to a few ms. A refresh that races one of our seeks still carries the old timeline, so it is ignored instead of being reported as a user seek.WM_DROPFILESis ignored. The only way to hand a file to a running instance isPotPlayerMini64.exe <file> /current, which skips instances started with/new. So:/newand opens files in the same window with/current./newand opens a file by starting a fresh/newwindow and closing the old one. That way a PotPlayer the user already had open is never taken over.0and then resets its time to 0. The player reports the end of the file (and callseofReportedByPlayer) instead of a jump to 0.SEEK_THRESHOLD. Those would otherwise land seconds back and be broadcast to the room as a new seek on every pause.run()blocks until PotPlayer's window is up, so the client never syncs against a missing player.Testing
Tested on Windows 11 with PotPlayer 64-bit (
PotPlayerMini64.exe). I used a localsyncplayServer.pyand two console clients, each driving its own PotPlayer, and played the user by sending input directly to the PotPlayer windows:Not tested: 32-bit PotPlayer and
PotPlayer64.exe(the non-Mini build). They use the same SDK and window classes, and their paths are included.Notes
SyncplayClient.__init__initialises_globalPaused = 0.0. If the server's first state arrives before the player is ready, the client sends"paused": 0.0and unpauses the room.run()blocking avoids this for PotPlayer in practice, but the initial value probably wants to beTrue.