python-omxplayer-wrapper icon indicating copy to clipboard operation
python-omxplayer-wrapper copied to clipboard

One player for multiple videos

Open Tastyep opened this issue 6 years ago • 3 comments

Feature

Description

Add a default constructor to the OMXPlayer object and allow the user to pass options to the load() method.

Example use case

player = OMXPlayer() # default constructed player

for video in videos:
    player.load(video.path, ['--subtitles', video.subtitle])

The example is extremely simplified, the videos should not be played in a loop like this and I don't expect the load() method to be blocking. The idea is simply to not have to recreate a player object every time a video needs to be played.

Tastyep avatar Nov 26 '18 10:11 Tastyep

sorry , I can't run the program in the first line: TypeError: init() missing 1 required positional argument: 'source'

samshum2 avatar Aug 28 '20 02:08 samshum2

player1 = OMXPlayer(Video1,dbus_name='org.mpris.MediaPlayer2.anyName') player2 = OMXPlayer(Video2,dbus_name='org.mpris.MediaPlayer2.anyName2') player2.pause() sleep(player2.duration()) player2.play()

samshum2 avatar Aug 28 '20 03:08 samshum2

player1 = OMXPlayer(Video1,dbus_name ='org.mpris.MediaPlayer2.anyName') player2 = OMXPlayer(Video2,dbus_name ='org.mpris.MediaPlayer2.anyName2') player2.pause() sleep(player2.duration()) player2 。玩()

playerN = ... MAX_N?

ShaoMingya avatar Nov 18 '20 01:11 ShaoMingya