Re: Enigma2 Plugin попытка запустить видеострим (python)
нужно поиграться с кодом от влц-плага
нужно поиграться с кодом от влц-плага
Код:
ENIGMA_SERVICEGS_ID = 0x1001 ENIGMA_SERVICETS_ID = 0x1002 ENIGMA_SERVICE_ID = 0 DEFAULT_VIDEO_PID = 0x44 DEFAULT_AUDIO_PID = 0x45 STATE_IDLE = 0 STATE_PLAYING = 1 STATE_PAUSED = 2 def play(self): if self.state == self.STATE_PLAYING: return if self.state == self.STATE_PAUSED: self.unpause() return print "[VLC] setupStream: " + self.filename if ENIGMA_SERVICE_ID == 0: self.hide() self.session.open( MessageBox, _("No valid Enigma-Service to play a VLC-Stream\nCheck your installation and try again!"), MessageBox.TYPE_ERROR ) self.close() return try: url = self.server.playFile(self.filename, DEFAULT_VIDEO_PID, DEFAULT_AUDIO_PID) print "[VLC] url: " + url except Exception, e: self.hide() self.session.open( MessageBox, _("Error with VLC server:\n%s" % e), MessageBox.TYPE_ERROR ) self.close() return if url is not None: sref = eServiceReference(ENIGMA_SERVICE_ID, 0, url) print "sref valid=", sref.valid() sref.setData(0, DEFAULT_VIDEO_PID) sref.setData(1, DEFAULT_AUDIO_PID) self.session.nav.playService(sref) self.state = self.STATE_PLAYING if self.shown: self.__setHideTimer() self.vlcservice.setServer(self.server)
Spoiler
Комментарий