Skip to content
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

Where should the open-in-mpv application be placed in macOS? #28

Open
2 tasks done
ethuh opened this issue Mar 25, 2024 · 2 comments
Open
2 tasks done

Where should the open-in-mpv application be placed in macOS? #28

ethuh opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@ethuh
Copy link

ethuh commented Mar 25, 2024

Question Description

Currently, I have placed the config.yml file in the /Library/Application Support/open-in-mpv directory, and the open-in-mpv application is located in the Applications directory of the macOS system (/Applications). The configuration file is provided in the image below. When I click on any video on YouTube or Bilibili and then select the Extension (open-in-mpv) option, I see the mpv player icon briefly flash in the dock but the video does not play successfully. Is there something I have misconfigured? I am not quite sure.

image

Code Snippet (optional)

No response

Checklist:

  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.
@ethuh ethuh added the question Further information is requested label Mar 25, 2024
@Baldomo
Copy link
Owner

Baldomo commented Apr 17, 2024

Sorry for getting back to you this late. I have yet to investigate this issue because distribution on MacOS is not easy and it could be caused by several things. I will debug this when I have some free time. Thank you for the bug report!

@Baldomo Baldomo self-assigned this May 6, 2024
@andutzu7
Copy link

andutzu7 commented Nov 11, 2024

Hello. I checked a bit on the issue, as I was facing the same problem. Initially I believed that the binary was not placed properly, or that the architecture didn't match. That turned out to be false, as the command from the tests runs fine (ex ./open-in-mpv "mpv:///open?url=https%3A%2F%2Fyoutube.com%2Fwatch%3Fv%3DBVdngsy95mY&player=mpv" false)
This mpv opening one second and then closing issue comes from the fact that the protocol part gets stripped away from the URI ( mpv:///link becomes /link ) when you try to open a link from the web browser.
I looked on the info.plist, and the CFBundleURLSchemes definition seems fine.
I tried two hotfixes, none of which worked:
First I attempted to modify the URI string in the web extension, by changing the
const baseURL = 'mpv:///open?' to const baseURL = 'mpv://mpv:///open?'
The resulting URL that is being passed to mpv was correct, but there was an issue with the protocol handling now. Here is the error:
No protocol handler found to open URL mpv:///open?url=https://www.youtube.com/watch?v=qyCVCGg_3Ec&player=mpv The protocol is either unsupported, or was disabled at compile-time.
This error comes from mpv itself.

I also tried to modify the protocol handler in the Info.plist, but that didn't help either.
Here is the snippet:
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>open-in-mpv</string> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>CFBundleURLSchemes</key> <array> <string>custom</string> </array> </dict> </array>
As a result of this modifications, the mpv binary doesn't even get called, so I abandoned it.

At the moment I gave up trying to fix this issue, but if you have is any suggestion I could try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants