datasone / MPVMediaControl

Windows 10 System Media Transport Controls (SMTC) for MPV (or any other programs)
MIT License
67 stars 4 forks source link

[Enhancement] Autostart Executable Functionality #6

Closed NaiveInvestigator closed 2 years ago

NaiveInvestigator commented 2 years ago

Continuation of this thread.

3

NaiveInvestigator commented 2 years ago

@datasone I have an idea but not so sure how to implement this. We can remedy the problem with multiple instances by using a mutex, which will only allow only one instance of MPVControlMedia.exe to run. And as for when to close it I still have to figure out that one.

datasone commented 2 years ago

Fixed in 0.1.0

NaiveInvestigator commented 2 years ago

@datasone could we add instructions to put in executable inside the folder and rename the script to main.lua. Like this:

image

The reason for doing this is because so that ppl don't have to worry where to put the executable, will make the installation more friendly for new ppl and the directory of the executable won't be hard coded. Instead we can use mp.get_script_directory() to get the directory of the script and just add "/MPVMediaControl.exe". That will reduce problems imo.

script_dir = mp.get_script_directory()
MPVMC_PATH = script_dir .. "/MPVMediaControl.exe"

Adding these two lines should do the trick if you're feeling lazy lol.

Thank you so much for attending my TED talk :> jk thanks for the updates, works like a charm now!! Was really excited for them lol.

P.S : Could we add this script in: https://github.com/mpv-player/mpv/wiki/User-Scripts

You know so ppl can find it and use it too.