def play_video(vidid):
    system.kill_vlc()

    if conf.CONTROLS:
        process = system.call_list_silently(["vlc", "-vvv", "http://youtube.com/watch?v=" + vidid], sync=False)
        songfile = open(music_conf.SONG_PID, "w+")
        songfile.write(str(process.pid))
        return process
    else:
        process = system.call_list_silently(
            ["vlc", "-Idummy", "-vvv", "http://youtube.com/watch?v=" + vidid], sync=False
        )
        songfile = open(music_conf.SONG_PID, "w+")
        songfile.write(str(process.pid))
        return process
def play_song(vidid, name):
    system.kill_vlc()

    process = system.call_list_silently(
        ["vlc", "-Idummy", "-Vdummy", "--play-and-exit", "-vvv", "http://youtube.com/watch?v=" + vidid], sync=False
    )

    songfile = open(music_conf.SONG_PID, "w+")
    songfile.write(str(process.pid))

    songfile = open(music_conf.SONG_INFO, "w+")
    songfile.write(name + "\n")
    songfile.write("Unkown\n")
    songfile.write("YouTube")

    return process
Esempio n. 3
0
    def play(self):
        cmd = ['vlc', '-Idummy', '--play-and-exit', '-vvv', self.path]

        process = system.call_list_silently(cmd, sync=False)

        stop_song()

        #Write pid and song info to temporary file
        pidfile = open(conf.SONG_PID, 'w+')
        pidfile.write(str(process.pid))

        songfile = open(conf.SONG_INFO, 'w+')
        songfile.write(self.title + "\n")
        songfile.write(self.album + "\n")
        songfile.write(self.artist)
        return process
 def execute(self, operand):
     cmd = ['vlc', '-Idummy', '--play-and-exit', '-vvv', self.get_resource_path('haha.mp3')]
     system.call_list_silently(cmd, sync=False)