First commit.

Minimum viable product on both a command line video player and a gui
player. Both need work and neither stream auido by default.
This commit is contained in:
20xd6
2021-01-08 16:11:25 -05:00
commit eb9115b486
3 changed files with 89 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
import mpv
import argparse
import os
cmd_option_set = argparse.ArgumentParser(description='Stream Audio')
cmd_option_set.add_argument('audio_stream_URL', type=str, help='URL of the audio you want streamed.')
cmd_options = cmd_option_set.parse_args()
audio_stream = cmd_options.audio_stream_URL
if ( not audio_stream ):
print ("No URL given\nPlease provide one.")
os._exit(0)
audio_player = mpv.MPV(ytdl=True, input_default_bindings=True, input_vo_keyboard=True, osc=True)
@audio_player.on_key_press('q')
def my_q_binding():
print('THERE IS NO ESCAPE')
try:
audio_player.play(audio_stream)
audio_player.fullscreen
audio_player.wait_for_playback()
del audio_player
except mpv.ShutdownError:
print("Playback has ended.")