def getBestPlayableService(self, service): if isinstance(service, eServiceReferenceDvd) and service.isIsoImage(): from Source.ISOInfo import ISOInfo iso = ISOInfo() if iso.getFormatISO9660(service) != ISOInfo.DVD: iso_format = iso.getFormat(service) if iso_format == ISOInfo.ERROR: self.session.open(MessageBox, _("Error loading ISO image!"), MessageBox.TYPE_ERROR) return if iso_format == ISOInfo.UNKNOWN: self.session.open(MessageBox, _("Selected ISO image is not playable!"), MessageBox.TYPE_ERROR) return if iso_format == ISOInfo.BLUDISC: service = iso.getService(service) return service
def playMovie(self): if self.service and self.enabled: if self.service.flags & eServiceReference.mustDescent or isinstance( self.service, eServiceReferenceBludisc): print "Skipping video preview" self.__playLastService() return from MoviePlayer import playerChoice if playerChoice and playerChoice.isPlaying(): print "Skipping video preview" return cpsr = self.session.nav.getCurrentlyPlayingServiceReference() if cpsr and cpsr == self.service: return #if not self.lastService: # self.lastService = self.session.nav.getCurrentlyPlayingServiceReference() self.stopCurrentlyPlayingService() if isinstance(self.service, eServiceReferenceDvd): if self.service.isIsoImage(): if ISOInfo().getFormatISO9660(self.service) != ISOInfo.DVD: print "Skipping video preview" self.__playLastService() return newref = eServiceReference(4369, 0, self.service.getPath()) self.session.nav.playService(newref) subs = self.getServiceInterface("subtitle") if subs: subs.enableSubtitles(self.dvdScreen.instance, None) else: self.session.nav.playService(self.service) print "play", self.service.getPath() self.currentlyPlayingService = self.service seekable = self.getSeek() if seekable: try: cue = CueSheet(self.service) self.cut_list = cue.getCutList() length, last = self.getCuePositions() stop_before_end_time = int(config.AdvancedMovieSelection. stop_before_end_time.value) if stop_before_end_time > 0: if (((length) - (last / 90000)) / 60) < stop_before_end_time: return if last > 0 and config.AdvancedMovieSelection.video_preview_marker.value: if self.service.getPath().endswith('ts'): seekable.seekTo(last) else: self.minutes = long(last / 90000 / 60) if isinstance(self.service, eServiceReferenceDvd): self.resume_point = last self.dvd_preview_timer.start(1000, True) return self.fwd_timer.start(1000, True) except Exception, e: print e
def exit(self): from Source.ISOInfo import ISOInfo ISOInfo().umount() self.close()