need to stop player when play audio file in python
#1
I have this script to activate dialog OK with audio, it works fine but I want if I am playing video or PVR to pause the video and play the audio with dialog box:

I tried xbmc.Player().pause() but didn't work with me any Idea about it?
Quote: if real == remind:
   xbmc.playSFX('special://home/addons/script.remind/remind.wav')
   dialog = xbmcgui.Dialog()
   dialog.ok('remind Box', 'don't forget')
   xbmc.stopSFX()
   time.sleep(55) 
   import script2 
Reply
#2
I added this in the code:
   xbmc.executebuiltin('XBMC.PlayerControl(Play)') 

and the video player is paused but didn't play the SFXplay !
Quote: if real == remind:
   xbmc.executebuiltin('XBMC.PlayerControl(Play)') 
   xbmc.playSFX('special://home/addons/script.remind/remind.wav')
   dialog = xbmcgui.Dialog()
   dialog.ok('remind Box', 'don't forget')
   xbmc.stopSFX()
   time.sleep(55) 
   import script2 
Reply
#3
You'll want to use this: https://codedocs.xyz/xbmc/xbmc/group__py...layer.html
python:

import xbmc

player = xbmc.Player()

if player.isPlayingVideo():
    player.pause()
    # do your stuff
Reply

Logout Mark Read Team Forum Stats Members Help
need to stop player when play audio file in python0