feat: use python-vlc to play a video

This commit is contained in:
Justin Lin
2024-03-14 13:16:52 +08:00
commit eb42e2bd25
4 changed files with 91 additions and 0 deletions

16
omx.py Normal file
View File

@@ -0,0 +1,16 @@
from omxplayer.player import OMXPlayer
import time
v1 = '/home/pi/Videos/nicechord-original.mp4'
v2 = '/home/pi/Videos/new_trunk for Alice(290)_1.mp4'
p1 = OMXPlayer(v1, args=['--display=2'], dbus_name='org.mpris.MediaPlayer2.omxplayer1')
p2 = OMXPlayer(v2, args=['--display=7'], dbus_name='org.mpris.MediaPlayer2.omxplayer2')
try:
time.sleep(10)
except KeyboardInterrupt:
print('exit')
finally:
p1.quit()
p2.quit()