Search code examples
youtubevideo-playeruri-scheme

Open Youtube links in external videoplayer from browser


I use videoplayer "PotPlayer". Player can play video from youtube. For e.g. player can start play youtube video if you run player as:

"C:\PotPlayer\PotPlayer.exe https://www.youtube.com/watch?v=*******"

I added URI Scheme to registry with name "potplayer":

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\potplayer]
@="\"URL:potplayer protocol\""
"URL Protocol"=""

[HKEY_CLASSES_ROOT\potplayer\shell]

[HKEY_CLASSES_ROOT\potplayer\shell\open]

[HKEY_CLASSES_ROOT\potplayer\shell\open\command]
@="c:\\potplayer\\potplayer.exe"

And I try open youtube videos in PotPlayer from web-browsers using next link:

potplayer://https://www.youtube.com/watch?v=*******

But it just only start Player without transfer the link to player (".../PotPlayer.exe https://www.youtube.com/watch?v=*******").

How can I transfer the link to PotPlayer using URI Scheme? What I need to change in the registry code?


Solution

  • I found the way from CMD / Batch / Registry - String replace not working as expected?

    So:

    [HKEY_CLASSES_ROOT\potplayer\shell\open\command]
    @="cmd /k ( set \"var=%1\" & call set var=%%var:potplayer://=%% & call C:\\PotPlayer\\PotPlayer.exe %%var%%)"