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

mpv.net Compatibility? #6

Closed
asianmusicguy opened this issue Feb 16, 2022 · 36 comments
Closed

mpv.net Compatibility? #6

asianmusicguy opened this issue Feb 16, 2022 · 36 comments

Comments

@asianmusicguy
Copy link

@cyl0
Every time I run MPV.net after installing the script and load the player this occurs
image
any idea how to make them play nice mpv and mpv.net are not that much different from one another

https://github.com/stax76/mpv.net

@asilentdreamer
Copy link

modernx draws the purple mpv logo on idle and mpv.net redraws the mpv.net logo on top of it leading to this issue.

You can fix this by commenting the following lines from the modernx.lua file
image

An option in user_opts to toggle this would be nice but I dont know enough lua to add that.

@asianmusicguy
Copy link
Author

Interesting if i block out logo it breaks the entire script from working @asilentdreamer i have --function show_logo ()
local osd_w, osd_h = 640, 360
local logo_x, logo_y = osd_w/2, osd_h/2-20
local ass = assdraw.ass_new--()

@asianmusicguy
Copy link
Author

on top of this the osc wont disappear on pause if i add this script nor does mpv.nets toggle for it work :( i rea;;y want this to work as mpv.nets default osc suck

@asilentdreamer
Copy link

If you remove the entire function the script will break because now there is a line in code that calls the function to draw the logo which now does not exist

The best option is to replace the function with this:

function show_logo()
	local osd_w, osd_h = 640, 360
	local logo_x, logo_y = osd_w/2, osd_h/2-20
	local ass = assdraw.ass_new()

	ass:new_event()
	ass:pos(logo_x, logo_y+70)
	ass:an(8)
	ass:append(texts.welcome)
	set_osd(osd_w, osd_h, ass.text)
end

This will also show the welcome text on the screen.
If you would rather have just the mpv.net logo and no welocme text you could remove the line that calls this function. For that just comment out the selected line in the screenshot below
image

@asianmusicguy
Copy link
Author

@asilentdreamer thank you all your help that did solve one issue but I still cant seem to toggle visibility via mpv net context menu nor is a toggle message displayed and the controls are still visible on pause i want them off when paused. any ideas?

@asilentdreamer
Copy link

I dont really know the solution to those. Feel free to ping me if you find it.

@asianmusicguy
Copy link
Author

@asilentdreamer I'm at a loss I gave opened a ticket with the original dev and the ticket here all i wanted was to replace the old OSC which is a little outdated and modern was perfect you wouldn't think it be this hard right I have QA expertise and your a lua coder between us maybe we can figure something out I wouldn't expect you to spend a lot of time on it but maybe we can make both mpv net and modern a little better in the process who knows

@asilentdreamer
Copy link

I am not a lua coder. All I did is copy a few lines of code from mpv's osc and paste it in this osc. Also it looks like the blue mpv.net icon is hard coded so doesn't look like it can be replaced.

@asianmusicguy
Copy link
Author

@asilentdreamer that's fine because your solution worked now i just need to make the OSD disappear on pause as it does without modern installed and also display toggle status messages again for the corresponding toggle and the only one being the least bit helpful is you :) anyway its hard because i can find code to make the OSD stay because apparently it is meant ti do that natively but adding modern breaks the behavior for some reason.

@asilentdreamer
Copy link

That has been my experience too. I tried to add that but the script broke. So after a few tries I gave up because I understand neither the script nor the langauge very well.

@asianmusicguy
Copy link
Author

@asilentdreamer if you know anyone who could possibly help that be awesome as neither developer seems interested in even guiding us and the documentation doesnt cover anything like this

@dexeonify
Copy link

i just need to make the OSD disappear on pause

Open Config Folder, create a script-opts folder and make a new file call osc.conf. Add showonpause=no inside osc.conf.
Alternatively, you can just change the options directly in mordenx.lua, but that's not recommended.

I still cant seem to toggle visibility via mpv net context menu

This was certainly fun to debug - the feature isn't implemented in MordenX :D. But don't worry, it's easy to add the feature, I should probably make a PR later.

Open mordenx.lua, go to line 2201 or search for function visibility_mode(mode, no_osd).
Add this block of code inside the function, above if mode == 'auto' then:

function visibility_mode(mode, no_osd)
    if mode == "cycle" then
        if not state.enabled then
            mode = "auto"
        elseif user_opts.visibility ~= "always" then
            mode = "always"
        else
            mode = "never"
        end
    end

    if mode == 'auto' then
    ...

Now open input.conf inside the config folder, modify line 146

 Del     script-binding osc/visibility               #menu: View > Toggle OSC Visibility

to

 Del     script-binding mordenx/visibility           #menu: View > Toggle OSC Visibility

The reason is explained here: dexeonify/mpv-config@967413b

@asianmusicguy
Copy link
Author

@dexeonify I must have done something wrong because now t modern does not show up at all could you possibly upload the fixed files and ill just put them in place or do we have to do more troubleshooting now

@dexeonify
Copy link

Hmm, I did encountered that a few times, but it was intermittent and it's not caused by my fix. Maybe try restarting mpv.net again? Any messages printed in the console?

@asianmusicguy
Copy link
Author

@dexeonify nothing that i can see its gone back to mpv.nets osc though

@asianmusicguy
Copy link
Author

maybe i edited wrong but i dont think so

@dexeonify
Copy link

Yea, I'm not sure why it suddenly didn't work for you when it's working previously. Try reverting your changes and see which changes caused it.

Here's the mpv.net directory for reference. I didn't change anything major.
mpv.net.zip

@asianmusicguy
Copy link
Author

@dexeonify Well im not sure now because it works flawless when i replaced the directors i must have just miss typed something the only thing i can think of is I did attempt to use @asilentdreamer 's fix to preserve on screen text where as yours does not maybe that plus your edits doesnt work but its all good now id still love to preserve text?

@asianmusicguy
Copy link
Author

Lastly I noticed files don't automatically start on open now i actually have to hit play now i never used to ?

@dexeonify
Copy link

dexeonify commented Feb 20, 2022

I did attempt to use @asilentdreamer 's fix to preserve on screen text where as yours does not maybe that plus your edits doesnt work

Ah yea, I chose the 2nd option to completely hide the logo.

Lastly I noticed files don't automatically start on open now i actually have to hit play now i never used to ?

That's because I added pause = yes and mute = yes in mpv.conf. I only added those for easier debugging. Feel free to remove those. I did say my config is for reference. 😛

@asianmusicguy
Copy link
Author

so all this this debugging will it benefit modernx in anyway as that was my ultimate goal to prevent others who happen to be using the mpv.net variation from going through this while still being able to enjoy a music better osc
@dexeonify

@dexeonify
Copy link

dexeonify commented Feb 20, 2022

Yea, I guess. Others can just follow this thread. We still have to wait for the author to merge my PR (#7) so others don't have to dig into the code and add the features manually.

@asianmusicguy
Copy link
Author

I think since between the author code do since between the 3 of us we have done all the leg work :( is just summarize what we have done and state if using the mpv varient make these adjustments

@asianmusicguy
Copy link
Author

either way thank you @asilentdreamer @dexeonify we make a good team

@asianmusicguy
Copy link
Author

@dexeonify i have one more issue if you would not mind looking at when you get time?
with the new osc it is very hard to control the seek bar with the mouse select drag then click to release all seem very difficult

@asilentdreamer
Copy link

either way thank you @asilentdreamer @dexeonify we make a good team

NP. The fixes mentioned in this issue were a lot of help

@dexeonify
Copy link

dexeonify commented Feb 22, 2022

it is very hard to control the seek bar with the mouse select drag then click to release all seem very difficult

Related issues mpvnet-player/mpv.net#350 mpvnet-player/mpv.net#195
Workaround: Remove osc-scalewindowed=1.5

@SonaliBendre
Copy link

tl;dr?

@dexeonify
Copy link

dexeonify commented Feb 22, 2022

Only the first two points are mpv.net-exclusive issues.

@SonaliBendre
Copy link

Only the first two points are mpv.net-exclusive issues.

Please give me the modified complete working script and istruction what to change

@dexeonify
Copy link

...
The instructions are all there, but whatever.

Open mpv.net, right click > Settings > Open Config Folder. Download MordenX-mpv.net-patched.zip and extract it inside the folder.

Open input.conf and modify line 146 to

 Del     script-binding mordenx/visibility           #menu: View > Toggle OSC Visibility

Then, open mpv.conf and modify line 9 to

script-opts = osc-hidetimeout=2000,console-scale=1

@SonaliBendre
Copy link

... The instructions are all there, but whatever.

Open mpv.net, right click > Settings > Open Config Folder. Download MordenX-mpv.net-patched.zip and extract it inside the folder.

Open input.conf and modify line 146 to

 Del     script-binding mordenx/visibility           #menu: View > Toggle OSC Visibility

Then, open mpv.conf and modify line 9 to

script-opts = osc-hidetimeout=2000,console-scale=1

Thank you very much. This instruction is only for mpv.net right? (just confirming never mind)

@dexeonify
Copy link

Well, the instructions for input.conf can be applied to mpv as well.

@cyl0
Copy link
Owner

cyl0 commented Feb 22, 2022

Hi there, sorry for the late response but I've merged @dexeonify's PR. I'm not able to test with mpv.net myself, so please test and see if the issue persists.

@cyl0
Copy link
Owner

cyl0 commented Mar 7, 2022

I'll be closing this due to inactivity, feel free to add a comment here if this issue still persists.

@cyl0 cyl0 closed this as completed Mar 7, 2022
@RibShark
Copy link

RibShark commented Mar 22, 2023

I am having another issue using this with mpv.net. Most of the time, the OSD does not respond to any mouse events (moving, clicking), and the mpv.net logo does not show at all. If I repeatedly open and close mpv.net, sometimes the logo will show properly, and sometimes the mouse events will also work.

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

No branches or pull requests

6 participants