willprice / python-omxplayer-wrapper

:tv: Control OMXPlayer, the Raspberry Pi media player, from Python
http://python-omxplayer-wrapper.readthedocs.io
GNU Lesser General Public License v3.0
253 stars 72 forks source link

check playback_status() #195

Open zablah opened 4 years ago

zablah commented 4 years ago

Issue Report

error when trying to check music playback_status()

Description

I'm trying to check the playing status using playback_status() method but I got the following error: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. ### I need to know when my music is done immediately

Environment details

Software Version
python-omxplayer-wrapper 0.3.2
python-dbus (dpkg -s python-dbus) 1.2.0
python (python --version) 3.4.2
omxplayer (omxplayer --version) dfea8c9 [master]

Example use case

try:
     if  self.player.playback_status() == "Playing":
          print("playing...")
      else:
         print("not plying")           
except Exception as e:
    print (e)