open-dynaMIX / simple-mpv-webui

A web based user interface with controls for the mpv mediaplayer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

script_path issue on windows

57op opened this issue · comments

commented

Hi,
I just noticed that debug.getinfo(2, "S").source on windows doesn't return (anymore?) a path prefixed by @. It returns the path directly.
So, :sub(2) will remove the drive letter (e.g. Z:/path/to/mpv:/path/to/mpv) resulting in 404 error by the web server (because it cannot read any files).

This is very weird because it has been working before.
I recently upgraded both windows (version 2004) and mpv.

The maintainer of mpv windows release I use has recently made some changes to luajit:
shinchiro/mpv-winbuild-cmake@7040592

It could be any of these two changes.

I'm opening this issue just to inform any windows user of this plugin.
I don't think any change should be "officialy" made to webui.lua file to fix this quirk,
but windows user might want to temporary modify that file removing :sub(2) on line 12 in order to continue to use this plugin for the time being.

@chuck- Thanks for informing here!

Instead of modifying webui.lua, it's also possible to provide the path to the directory with the static files (webui-page) via the static_dir option.

commented

Indeed, it's even better to use the static_dir option.
Anyway, I'm now sure it's a problem about recent windows mpv releases.

I'll address this issue to its maintainer and let you know any progress.

Seems this now also applies to MPV under Linux.

@57op Current master can now handle both, with leading @ and without. So there is no need to use the static_dir option anymore.

commented

nice, i guess it's the proper way to handle this!
thanks