LKstream/lib.py
2025-01-09 11:52:51 -05:00

52 lines
1.2 KiB
Python

import sys
MEDIAPLAYER = "vlc"
def mainMenu():
print("(S)tream")
print("(W)atch")
print("(Q)uit")
print()
x = input ("s/w/q: ").strip().lower()
if x in ("s","w","q"):
return x
else:
return 1
def quitLKStream():
#gracefully shut stuff down
#Close holesail
#Close MEDIAPLAYER
#Close mediamtx
sys.exit()
def startLKStream():
#start mediamtx server
#start holesail with randomized key
#start ffmpeg streaming to mediamtx
#For the moment, we won't be doing that but using OBS
print("TODO: Start Streaming")
return "Fake Key" #return holesail key
def mainMenuHandling(x):
if x == 'q':
quitLKStream()
elif x == 's':
holesailKey = startLKStream()
return holesailKey
elif x == 'w':
#Ask for holesail key
#Connect to holesail (subprocess?)
#Connect to stream with MEDIAPLAYER(subprocess?)
# Use a default stream location if streaming with FFMPEG, with OBS it's the default plus stream key
print("TODO Watch Stream")
return 0
else:
print("invalid option x was: ", x)
return 1