Closed Solarunit closed 1 month ago
For the lua script, you can refer to the relevant implementation in the open_dialog.lua script.
@dyphire interesting, I will check it out, thanks.
I am new to lua, how to get file path/basename in mpv [file-path]
?
I am trying mp.get_property(path)
without success so far
mp.get_property('filename')
when printing print(mp.get_property('filename'))
:
nil property unavailable
mp.register_event('file-loaded', function()
print(mp.get_property('filename'))
end)
it doesn't print anything for me :(
it works! Thanks!
with my test lua script I can redirect dvd iso file to
local function open_dvd(path)
mp.set_property('dvd-device', path)
mp.commandv('loadfile', 'dvd://')
end
but not for bluray iso :cry:
[file] Opening file.iso
....
[cplayer] Opening failed or was aborted: file.iso
...
[cplayer] finished playback, unrecognized file format (reason 4)
Unlike dvd iso it can't start playback bluray iso file, so we will never get to this point in lua script:
mp.register_event('file-loaded', function()
update: I have some progress with 'start-file' event
mp.register_event('start-file', function()
I have some progress with the script. I can redirect bluray iso file to open_bluray(path)
function too.
What is the proper way to get parent directory of some directory in lua?
Like: path = /dir1/dir2/
and I need to get /dir1/
path
I figured out how to play DVD or Blu-ray ISO files from the terminal using:
mpv bd:// --bluray-device=[path-to-bluray-iso]
for Blu-ray ISOand
mpv dvd:// --dvd-device=[path-to-dvd-iso]
for DVD ISOThe question is how to play those iso files automatically? Like
mpv [path-to-iso]
will detect if it's DVD ISO or Blu-ray ISO and will play it.Is there a condition I can put into mpv.conf? Or maybe it's possible with some lua script? Maybe there is already such script?