-
Notifications
You must be signed in to change notification settings - Fork 69
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
Input/Write URL (a option in Menu & in Subtitles/Audio Button) #497
Comments
Sure. No objections, but no ETA either :) |
Waiting |
Here's a script that does what you want, but note that pasting in search menus is not currently supported. -- open-url.lua
mp.utils = require "mp.utils"
mp.register_script_message("open-url:", function(path)
mp.commandv("script-message-to", "uosc", "close-menu", "open-url")
mp.commandv("loadfile", path)
end)
mp.add_forced_key_binding("F10", "open-url", function()
local script_name = mp.get_script_name()
local json = mp.utils.format_json({
type = "open-url",
title = "http://www.example.com/stream.avi",
items = {
{
title = "Enter a network URL and press Ctrl+Enter",
value = "ignore",
muted = true,
selectable = false
}
},
on_search = {"script-message-to", script_name, "open-url:"},
palette = true,
search_style = "palette",
search_debounce = "submit"
}) or "{}"
mp.commandv("script-message-to", "uosc", "open-menu", json)
end) Doesn't handle loading links as extra tracks but that's a trivial change if you want that. |
Just an update: I don't want to add more loading items to subtitle/audio menus, especially not for something like this that won't be used by almost anyone, so it'll have to be as an alt action on the "Load {type}" item, which depends on menu item buttons, which is not implemented yet. |
There's still no button or UI so I'll keep this open, but thanks to the commit above, in 5.1 you'll be able to paste in subtitle/audio/video track select menus to automatically load whatever path/url is in the clipboard as current menu track type. |
I hope one day you support typing URL also like vlc |
funny thing is mpv-android let you load subtitle/audio by typing URL. |
Just in case, as a tip to the OP, showing that the need for this is rather limited. Dragging and dropping an url on mpv window does it. I guess this question is asked in Windows but in Linux you can do it by copying the link and in a terminal writing And more specifically in Plasma if we associate |
typing URL like vlc should be added |
I'm clueless why does typing URL like any guide video player software like VLC,Potplayer,Mpc-hc not possible |
Patiently waiting @tomasklaen |
Waiting |
@aicynide Stop being annoying, just use the script from po5's comment. |
People can now paste paths or URLs into:
I think this covers most of the pasting/input needs. |
Could you give me name of the file with those special characters so I can test? I'm retrieving the clipboard data from ziggy binary. I guess somewhere in the clipboard read->serialize->output->deserialize chain they're getting escaped or dropped. |
Any filename which contains |
I don't have issue with spaces in file names. Also, you can see the whole filename including spaces in the screenshot you posted, so that seems to not be an issue. And dunno what the mp.commandv('loadfile', value) In other words: can't reproduce. Are you sure the file exists and is valid? |
I used your name with spaced, and again, no issues for me. No idea what might be going on here. What menu are you pasting it into? |
I got some clues.
Filebrowser |
Now I confirmed that any file in my disk C which use I also confirmed manually input command |
You can try debugging it yourself. The code that is opening the file is in file mp.commandv(command, event.value) Try adding this before it and checking if there's something unusual: print(utils.to_string(command), utils.to_string(event.value)) |
Cannot found any difference with the actual filename. |
Hmm, Sorry for wasting a little time for both of us. I think that was a 'ghost' bug for windows. |
writing URL? |
You prefer to waste time type in each word one by one instead of pasting in one second? |
well VLC has this feature, I'll write shortener i.e. shortened URL or add password in pasted URL |
Not sure if mpv natively support it. |
The text was updated successfully, but these errors were encountered: