youtube: Started code for playback from youtube. Not functionnal, yet

This commit is contained in:
2018-02-16 17:58:57 -06:00
parent d4dadfcdc7
commit 5ff5a4a6d2
5 changed files with 80 additions and 18 deletions

View File

@@ -17,6 +17,7 @@ import config
import sound
import languageHandler
import logging
import youtube_utils
from twitter import compose, utils
from mysc.thread_utils import call_threaded
from twython import TwythonError
@@ -623,6 +624,8 @@ class baseBufferController(bufferController):
def audio(self, url='', *args, **kwargs):
if hasattr(sound.URLPlayer,'stream') and sound.URLPlayer.stream.is_playing == True:
return sound.URLPlayer.stop_audio(delete=True)
elif sound.URLPlayer.mode == "youtube":
return sound.URLPlayer.stop_audio()
tweet = self.get_tweet()
if tweet == None: return
urls = utils.find_urls(tweet)

View File

@@ -2,6 +2,7 @@
import platform
system = platform.system()
import application
import youtube_utils
if system == "Windows":
from update import updater
from wxUI import (view, dialogs, commonMessageDialogs, sysTrayIcon)
@@ -655,6 +656,7 @@ class Controller(object):
self.exit_()
def exit_(self, *args, **kwargs):
youtube_utils.stop()
for i in self.buffers: i.save_positions()
log.debug("Exiting...")
log.debug("Saving global configuration...")