client: Add support for starting video at certain time

master
Felix Stupp 3 years ago
parent 3c7310f970
commit e0ef5eb9b7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -4,15 +4,22 @@ import argparse
from pathlib import Path from pathlib import Path
from string import Template from string import Template
import subprocess import subprocess
from typing import Callable, Dict from typing import Callable, Dict, Optional
import urllib.parse as url import urllib.parse as url
def cmd_player_play(video_uri: str): def cmd_player_play(video_uri: str, start: Optional[str] = None):
print(f"Play video {video_uri}") print(f"Play video {video_uri}")
subprocess.Popen([ subprocess.Popen(
str(Path("~/bin/mpvadd").expanduser()), video_uri, args = [e for e in [
], stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) str(Path("~/bin/mpvadd").expanduser()),
video_uri,
f"start={start}" if start is not None else None,
] if e is not None],
stdin = subprocess.DEVNULL,
stdout = subprocess.DEVNULL,
stderr = subprocess.DEVNULL,
)
URI_SCHEME = "entertainment-decider" URI_SCHEME = "entertainment-decider"
URI_COMMANDS = { URI_COMMANDS = {

Loading…
Cancel
Save