При старте сервиса он не вызывает плеер
[Unit]
Description=Polimech App
After=network.target
[Service]
ExecStart=/usr/bin/python3 -u appPolimech.py
WorkingDirectory=/home/pi/SplashPyPolimech/appPolimech
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
[Install]
WantedBy=multi-user.target
import time as t
import vlc
import subprocess
link = [
'rtsp://192.168.200.202:554/user=admin&password=&channel=1&stream=0?.sdp'
]
def play_link(param, link):
media = vlc.Media(link)
param = param + 1
play_player(media)
return param
def play_player(media):
check_play()
def check_play():
global col
process = subprocess.Popen('exec python3 /home/pi/SplashPyPolimech/main.py', stdout=subprocess.PIPE, shell=True)
while str(media_player.get_state()) != 'State.Playing':
media_player.set_fullscreen(True)
media = vlc.Media(link[col])
media_player.set_media(media)
media_player.play()
t.sleep(3)
col+=1
process.kill()
media_player = vlc.MediaPlayer() #create player
global col
col = 0
check_play()
col = col + 1
while True:
if col == 10:
print('1')