From 8525506744dc45fe07dfbf416de1e294ee84d57f Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Sun, 11 Sep 2016 21:38:58 +0200 Subject: [PATCH] Make submit button play url in MPV --- mpv_control.py | 2 +- server.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mpv_control.py b/mpv_control.py index 294e279..6ed3eef 100644 --- a/mpv_control.py +++ b/mpv_control.py @@ -12,7 +12,7 @@ class MPV(next_MPV): super().__init__(debug=True) def play(self, url): - self.command("loadfile", path) + self.command("loadfile", url) self.set_property("pause", False) @staticmethod diff --git a/server.py b/server.py index d77ea37..5c9205f 100644 --- a/server.py +++ b/server.py @@ -2,6 +2,7 @@ import remi.gui as gui, random, os, time from remi import start, App from threading import Timer +from mpv_control import mpv class namespace(object): pass @@ -71,10 +72,6 @@ class MyApp(App): ['3', 'spis meg', "90:01"], ['3', "Slidervalue: %s" % self.playback.slider.get_value(), "0:00"]]) - mpv.step() - mpv.get_queue() - mpv.position() - Timer(1, self.mainLoop).start() def playback_play(self): pass def playback_pause(self): pass @@ -84,6 +81,7 @@ class MyApp(App): value = self.input.field.get_text() print(value) + mpv.play(value) self.input.field.set_text("")