The console shows "State.Playing" throughout the video and "State.Ended" after the video ends but it won't get into the if function.
My guess is this is the bla = player.get_state() request gives a non-compatible format like bytes but no amount of me trying converts the string into anything the if function recognizes as the same as my typed value.
Thanks for the help
import vlc
player = vlc.MediaPlayer(fily)
print("check0")
player.play()
while True:
bla = player.get_state()
print(bla)
if bla == "State.Ended":
print(player.get_state())
print("checky")
break
player.stop()
get_state()
does not return a string but a State
:
import vlc
player = vlc.MediaPlayer(filename)
print("check0")
player.play()
while True:
if player.get_state() == vlc.State.Ended:
print(player.get_state())
print("checky")
break
player.stop()