From 71b11edabf574449053c6997c4e2afbe184a82fb Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 29 Jul 2020 22:47:26 +0800 Subject: [PATCH] bugfix --- kivyblocks/vplayer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kivyblocks/vplayer.py b/kivyblocks/vplayer.py index 65e46c3..7ae2ef5 100644 --- a/kivyblocks/vplayer.py +++ b/kivyblocks/vplayer.py @@ -1,6 +1,7 @@ import os import sys import time +import threading from appPublic.sockPackage import get_free_local_addr from kivy.utils import platform @@ -248,12 +249,17 @@ class OSC_VPlayer(BaseVPlayer): self.map('/replay',self.replay) self.map('/next',self.next) self.map('/previous',self.previous) - self.server.serve_forever() + t = threading.Thread(target=self.server.serve_forever()) + t.start() self.fullscreen = True label = Label(text='%s %d' % (self.ip,self.port), font_size=CSize(2)) - label.size = self.width - label.width, 0 + label.x = self.width - label.width, 0 + label.y = 0 self.add_widget(label) + def __del__(self): + self.server.stop() + def map(self,p,f): self.dispatcher.map(p,f,None)