popcorn-desktop icon indicating copy to clipboard operation
popcorn-desktop copied to clipboard

read external player definitions at runtime

Open teto opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe. I wanted to add memento (an mpv wrapper I think) to the list of supported players.

Describe the idea you'd like Rather than patching https://github.com/popcorn-official/popcorn-desktop/blob/c9bfece20ed301ed5bb8dc67e5ce5a2dde68e075/src/app/lib/device/ext_player.js#L7 , it seems like the list of players is pretty well-defined and structured so maybe it could be loaded from disk at runtime instead ? or accept a new list at runtime and merge it with the hardcoded one ? There are so many players it's hard to support all of them but if you can add to the list easily, it's not a problem anymore.

There would be a file in ~/.config/popcorntime/players.json that popcorntime could read at runtime:

{
        'VLC': {
            type: 'vlc',
            cmd: '/Contents/MacOS/VLC',
            switches: '--no-video-title-show',
            subswitch: '--sub-file=',
            fs: '-f',
            stop: 'vlc://quit',
            pause: 'vlc://pause',
            filenameswitch: '--meta-title='
        },
        'Fleex player': {
            type: 'fleex-player',
            cmd: '/Contents/MacOS/Fleex player',
            filenameswitch: '-file-name '
        },
        'MPlayer': {
            type: 'mplayer',
            cmd: 'mplayer',
            switches: '--really-quiet',
            subswitch: '-sub ',
            fs: '-fs',
        },
}

teto avatar Jun 26 '24 22:06 teto