feat: make the mpv player module work on android

This commit is contained in:
Benex254
2024-08-05 09:47:02 +03:00
parent 2a152e2cbf
commit 1f34e91da8

View File

@@ -5,6 +5,19 @@ import subprocess
def mpv(link, title, *custom_args):
MPV = shutil.which("mpv")
if not MPV:
print("mpv not found")
return
subprocess.run([MPV, *custom_args, f"--title={title}", link])
args = [
"nohup",
"am",
"start",
"--user",
"0",
"-a",
"android.intent.action.VIEW",
"-d",
link,
"-n",
"is.xyz.mpv/.MPVActivity",
]
subprocess.run(args)
else:
subprocess.run([MPV, *custom_args, f"--title={title}", link])