Пример #1
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        for x in InfoBarBase, \
                InfoBarMenu, \
                InfoBarSeek, \
                InfoBarAudioSelection, \
                InfoBarMoviePlayerSummarySupport, \
                InfoBarSubtitleSupport, \
                InfoBarSummarySupport, \
                InfoBarServiceErrorPopupSupport, \
                InfoBarNotifications, \
                IPTVInfoBarShowHide:
            x.__init__(self)

        IPTVInfoBarPVRState.__init__(self, PVRState, True)

        if cfg.subs.value is True:
            SubsSupport.__init__(self,
                                 searchSupport=True,
                                 embeddedSupport=True)
            SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'catchupplayer.xml'
        self["epg_description"] = StaticText()
        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()
        self["epg_picon"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["PTSSeekBack"] = Pixmap()
        self["PTSSeekPointer"] = Pixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('Catch Up')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'red': self.back,
                'tv': self.toggleStreamType,
                'info': self.toggleStreamType,
                "stop": self.back,
                "green": self.toggleAspectRatio
            }, -2)

        self.onFirstExecBegin.append(
            boundFunction(self.playStream, self.servicetype, self.streamurl))
Пример #2
0
    def __init__(self, session, playlistCallback, nextItemCallback,
                 prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer', 'MoviePlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["image"] = WebPixmap(self.defaultImage, caching=False)
        self["directionActions"] = HelpableActionMap(
            self, "DirectionActions", {
                "downUp": (playlistCallback, _("Show playlist")),
                "upUp": (playlistCallback, _("Show playlist")),
            })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
                                                    {"cancel": self.close})

        self["actions"] = HelpableActionMap(
            self, "KodiPlayerActions", {
                "menuPressed": (menuCallback, _("Show playback menu")),
                "infoPressed": (infoCallback, _("Show playback info")),
                "nextPressed":
                (nextItemCallback, _("Skip to next item in playlist")),
                "prevPressed":
                (prevItemCallback, _("Skip to previous item in playlist"))
            })

        self.eventTracker = ServiceEventTracker(
            self, {
                iPlayableService.evStart: self.__evStart,
            })
        self.onClose.append(
            boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(
            boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Пример #3
0
    def __init__(self, session, playlistCallback, nextItemCallback, prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer', 'MoviePlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["image"] = WebPixmap(self.defaultImage, caching=False)
        self["directionActions"] = HelpableActionMap(self, "DirectionActions",
        {
            "downUp": (playlistCallback, _("Show playlist")),
            "upUp": (playlistCallback, _("Show playlist")),
         })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
        {
            "cancel": self.close
        })

        self["actions"] = HelpableActionMap(self, "KodiPlayerActions",
        {
            "menuPressed": (menuCallback, _("Show playback menu")),
            "infoPressed": (infoCallback, _("Show playback info")),
            "nextPressed": (nextItemCallback, _("Skip to next item in playlist")),
            "prevPressed": (prevItemCallback, _("Skip to previous item in playlist"))
        })

        self.eventTracker = ServiceEventTracker(self,
        {
            iPlayableService.evStart : self.__evStart,
        })
        self.onClose.append(boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Пример #4
0
 def __init__(self, session, player_callback):
     Screen.__init__(self, session)
     self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"]
     InfoBarBase.__init__(self)
     InfoBarShowHide.__init__(self)
     InfoBarSeek.__init__(self)
     # disable slowmotion/fastforward
     self.seekFwd = self.seekFwdManual
     self.seekBack = self.seekBackManual
     initSubsSettings()
     SubsSupport.__init__(self,
                          defaultPath=config_archivczsk.tmpPath.value,
                          forceDefaultPath=True,
                          searchSupport=True,
                          embeddedSupport=True,
                          preferEmbedded=True)
     SubsSupportStatus.__init__(self)
     InfoBarAudioSelectionNoSubtitles.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarSubservicesSupport.__init__(self)
     InfoBarAspectChange.__init__(self)
     self.postAspectChange.append(self.__aspect_changed)
     HelpableScreen.__init__(self)
     self.status_dialog = self.session.instantiateDialog(StatusScreen)
     self.player_callback = player_callback
     self.__timer = eTimer()
     self.__timer_conn = eConnectCallback(self.__timer.timeout,
                                          self.__pts_available)
     self.__subtitles_url = None
     self.__resume_time_sec = None
     self["actions"] = HelpableActionMap(
         self, "ArchivCZSKMoviePlayerActions", {
             "showPlaylist": (boundFunction(self.player_callback, (
                 "playlist",
                 "show",
             )), _("Show playlist")),
             "nextEntry": (boundFunction(self.player_callback, (
                 "playlist",
                 "next",
             )), _("Play next entry in playlist")),
             "prevEntry": (boundFunction(self.player_callback, (
                 "playlist",
                 "prev",
             )), _("Play previous entry in playlist")),
             "cancel": (boundFunction(self.player_callback,
                                      ("exit", )), _("Exit player")),
         }, -2)
     self.__event_tracker = ServiceEventTracker(
         screen=self,
         eventmap={
             iPlayableService.evStart: self.__service_started,
         })
     self.onClose.append(self.__on_close)
Пример #5
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'vodplayer.xml'

        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()
        self["cover"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('VOD')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'tv': self.toggleStreamType,
                "channelUp": self.next,
                "channelDown": self.prev,
                "up": self.prev,
                "down": self.next,
                "stop": self.back,
            }, -2)

        self.onLayoutFinish.append(self.__layoutFinished)
Пример #6
0
 def __init__(self, session, player_callback):
     Screen.__init__(self, session)
     self.skinName = ["ArchivCZSKMoviePlayer", "MoviePlayer"]
     InfoBarBase.__init__(self)
     InfoBarShowHide.__init__(self)
     InfoBarSeek.__init__(self)
     # disable slowmotion/fastforward
     self.seekFwd = self.seekFwdManual
     self.seekBack = self.seekBackManual
     initSubsSettings()
     SubsSupport.__init__(self, 
             defaultPath = config_archivczsk.tmpPath.value,
             forceDefaultPath = True,
             searchSupport = True)
     SubsSupportStatus.__init__(self)
     InfoBarAudioSelectionNoSubtitles.__init__(self)
     InfoBarNotifications.__init__(self)
     InfoBarSubservicesSupport.__init__(self)
     InfoBarAspectChange.__init__(self)
     self.postAspectChange.append(self.__aspect_changed)
     HelpableScreen.__init__(self)
     self.status_dialog = self.session.instantiateDialog(StatusScreen)
     self.player_callback = player_callback
     self.__timer = eTimer()
     self.__timer_conn = eConnectCallback(self.__timer.timeout, self.__pts_available)
     self.__subtitles_url = None
     self.__resume_time_sec = None
     self["actions"] = HelpableActionMap(self, "ArchivCZSKMoviePlayerActions",
             {"showPlaylist": (boundFunction(self.player_callback, ("playlist", "show",)),
                 _("Show playlist")),
                 "nextEntry":(boundFunction(self.player_callback, ("playlist", "next",)),
                     _("Play next entry in playlist")),
                 "prevEntry":(boundFunction(self.player_callback, ("playlist", "prev",)),
                     _("Play previous entry in playlist")),
                 "cancel":(boundFunction(self.player_callback, ("exit",)),
                     _("Exit player")),
             }, -2)
     self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
     {
         iPlayableService.evStart: self.__service_started,
     })
     self.onClose.append(self.__on_close)
Пример #7
0
	def __init__(self, session, sref, playlist, playlistName, playlistCB, subtitles=None,
				autoPlay=True, showProtocol=False, onStartShow=False, repeat=False):
		BaseArchivCZSKScreen.__init__(self, session)
		self.onPlayService = []
		self.settings = config.plugins.archivCZSK.videoPlayer
		self.sref = sref

		# # set default/non-default skin according to SD/HD mode
		if self.settings.useDefaultSkin.getValue():
			self.setSkinName("MoviePlayer")
		else:
			HD = getDesktop(0).size().width() == 1280
			if HD:
				self.setSkin("ArchivCZSKMoviePlayer_HD")
			else:
				self.setSkinName("MoviePlayer")


		# # init custom infobar (added info about download speed, buffer level..)
		ArchivCZSKMoviePlayerInfobar.__init__(self)


		# # custom actions for MP
		self["actions"] = HelpableActionMap(self, "ArchivCZSKMoviePlayerActions",
        	{
         	"leavePlayer": (self.leavePlayer, _("leave player?")),
         	"toggleShow": (self.toggleShow, _("show/hide infobar")),
         	"audioSelection":(self.audioSelection, _("show audio selection menu")),
         	"refreshSubs":(self.refreshSubs, _("refreshing subtitles position")),
         	"subsDelayInc":(self.subsDelayInc, _("increasing subtitles delay")),
         	"subsDelayDec":(self.subsDelayDec, _("decreasing subtitles delay"))
          	}, -3)

		InfoBarBase.__init__(self, steal_current_service=True)
		# init of all inherited screens
		for x in HelpableScreen, InfoBarShowHide, \
			    InfoBarSeek, InfoBarAudioSelection, InfoBarNotifications, \
				InfoBarServiceNotifications, HelpableScreen, InfoBarPVRState, \
				InfoBarAspectChange, InfoBarServiceErrorPopupSupport:
				x.__init__(self)

		# init subtitles
		initSubsSettings()
		SubsSupport.__init__(self, subsPath=subtitles, defaultPath=config.plugins.archivCZSK.subtitlesPath.getValue(), forceDefaultPath=True, searchSupport=True)

		# playlist support
		InfoBarPlaylist.__init__(self, playlist, playlistCB, playlistName,
								 autoPlay=autoPlay, onStartShow=onStartShow, repeat=repeat, showProtocol=showProtocol)

		# to get real start of service, and for queries for video length/position
		self.video = Video(session)

		# # bindend some video events to functions
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
		{
			iPlayableService.evStart: self.__serviceStarted,
			iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo,
			iPlayableService.evUser + 10: self.__evAudioDecodeError,
			iPlayableService.evUser + 11: self.__evVideoDecodeError,
			iPlayableService.evUser + 12: self.__evPluginError,
		})
		self.statusDialog = session.instantiateDialog(StatusScreen)
		self.onClose.append(self.statusDialog.doClose)
		self.isStream = self.sref.getPath().find('://') != -1
		self.returning = False
Пример #8
0
    def __init__(self, session, streamurl, servicetype):
        Screen.__init__(self, session)

        self.session = session

        InfoBarBase.__init__(self)
        InfoBarMoviePlayerSummarySupport.__init__(self)
        InfoBarServiceNotifications.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarSubtitleSupport.__init__(self)
        IPTVInfoBarPVRState.__init__(self, PVRState, True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)

        self.streamurl = streamurl
        self.servicetype = servicetype

        skin = skin_path + 'vodplayer.xml'

        self["streamcat"] = StaticText()
        self["streamtype"] = StaticText()
        self["extension"] = StaticText()

        self.PicLoad = ePicLoad()
        self.Scale = AVSwitch().getFramebufferScale()
        try:
            self.PicLoad.PictureData.get().append(self.DecodePicture)
        except:
            self.PicLoad_conn = self.PicLoad.PictureData.connect(
                self.DecodePicture)

        self["cover"] = Pixmap()

        self["eventname"] = Label()
        self["state"] = Label()
        self["speed"] = Label()
        self["statusicon"] = MultiPixmap()

        self["PTSSeekBack"] = Pixmap()
        self["PTSSeekPointer"] = Pixmap()

        with open(skin, 'r') as f:
            self.skin = f.read()

        self.setup_title = _('VOD')

        self['actions'] = ActionMap(
            ["XStreamityActions"], {
                'cancel': self.back,
                'tv': self.toggleStreamType,
                'info': self.toggleStreamType,
                "channelUp": self.__next__,
                "channelDown": self.prev,
                "up": self.prev,
                "down": self.__next__,
                "stop": self.back,
                "red": self.back,
            }, -2)

        self.onFirstExecBegin.append(
            boundFunction(self.playStream, self.servicetype, self.streamurl))
Пример #9
0
    def __init__(self,
                 session,
                 openmovie,
                 opensubtitle,
                 rootID,
                 LastPlayedService,
                 URLlinkName='',
                 movieTitle='',
                 LastPosition=0):

        self.session = session
        self.statusScreen = self.session.instantiateDialog(StatusScreen)

        # #end subsupports stuff

        self.conditionalNotVisible = []
        self.URLlinkName = URLlinkName
        self.frameon = 1 / 24
        self.seeksubtitle = 0
        self.resume_point = 0
        self.nrsubtitle = 0
        self.statesubtitle = self.HIDDENSUBTITLE
        self.subtitles_enabled = False
        self.selected_subtitle = False
        self.stateplay = ''
        self.stateinfo = self.VISIBLE
        self.openmovie = openmovie

        if movieTitle == '':
            self.movieTitle = getNameWithoutExtension(
                path.basename(self.openmovie))
            #printDEBUG(self.movieTitle)
        else:
            self.movieTitle = movieTitle

        self.opensubtitle = ''
        self.rootID = int(rootID)
        self.LastPlayedService = LastPlayedService
        self.subtitle = []
        self.fontpos = 540
        self.fontsize = 60
        self.aspectratiomode = '0'
        self.SubtitleLineHeight = 66
        self.osdPosX = 0
        self.osdPosY = 0
        self.fonttype_nr = 0
        self.fontcolor_nr = 0
        self.fontbackground_nr = 0
        self.fontBackgroundState = 1
        self.loadfont()
        self.loadcolor()
        self.loadBackgroundColor()
        self.loadconfig()

        if self.opensubtitle == '':
            self.enablesubtitle = False
        else:
            self.enablesubtitle = True

        isHD = False
        isWideScreen = False
        isDolby = False
        self.skin = """
<screen name="AdvancedFreePlayer" position="0,0" size="1280,720" zPosition="-2" title="InfoBar" backgroundColor="transparent" flags="wfNoBorder">
    <!-- SubTitles -->
    <widget name="afpSubtitles" position="0,0" size="1,1" valign="center" halign="center" font="Regular;60" backgroundColor="#ff000000" transparent="0" />
  </screen>"""
        Screen.__init__(self, session)
        self['afpSubtitles'] = Label()

        self['actions'] = ActionMap(['AdvancedFreePlayer'], {  # "ToggleSubtitles": self.ToggleSubtitles,
            'ToggleInfobar': self.ToggleInfobar,
            'HelpScreen': self.HelpScreen,
            'SelectAspect': self.aspectChange,
            'ExitPlayer': self.ExitPlayer,
            'MoveSubsUp': self.MoveSubsUp,
            'MoveSubsDown': self.MoveSubsDown,
            'SetSmallerFont': self.SetSmallerFont,
            'SetBiggerFont': self.SetBiggerFont,
            'pause': self.pause,
            'play': self.play,
            'FastF30s': self.FastF30s,
            'FastF120s': self.FastF120s,
            'FastF300s': self.FastF300s,
            'BackF30s': self.BackF30s,
            'BackF120s': self.BackF120s,
            'BackF300s': self.BackF300s,
            'toggleFontBackground': self.toggleFontBackground,
            'SeekUpSubtitles': self.subsDelayInc,
            'SeekDownSubtitles': self.subsDelayDec,
            'togglePause': self.togglePause,
            'ToggleFont': self.ToggleFont,
            'refreshSubs': self.refreshSubs,
            'SelectAudio': self.SelectAudio,
            'SelectSubtitles': self.SelectSubtitles,
            }, -2)
        self.onShown.append(self.__LayoutFinish)
        InfoBarBase.__init__(self,
                             steal_current_service=True)  # #subsupport....
        if subs == True:  # #susbsupport
            initSubsSettings()
        SubsSupport.__init__(self, embeddedSupport=True, searchSupport=True)
        self.subs = subs
        InfoBarSeek.__init__(
            self, actionmap='AdvancedFreePlayerSeekActions')  # #subsupport
        self.onClose.append(self.__onClose)
        if self.LastPlayedService is None:
            self.LastPlayedService = self.session.nav.getCurrentlyPlayingServiceReference(
            )
        self.session.nav.stopService()
        self.__event_tracker = ServiceEventTracker(
            screen=self,
            eventmap={iPlayableService.evStart: self.resumeLastPlayback}
        )  # iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,
Пример #10
0
    def __init__(self, session, playlistCallback, nextItemCallback,
                 prevItemCallback, infoCallback, menuCallback):
        Screen.__init__(self, session)
        self.skinName = ['KodiVideoPlayer']
        statusScreen = self.session.instantiateDialog(StatusScreen)
        InfoBarBase.__init__(self, steal_current_service=True)
        SubsSupport.__init__(self, searchSupport=True, embeddedSupport=True)
        SubsSupportStatus.__init__(self)
        InfoBarSeek.__init__(self)
        InfoBarShowHide.__init__(self)
        InfoBarSubservicesSupport.__init__(self)
        InfoBarAspectChange.__init__(self)
        InfoBarAudioSelection.__init__(self)
        InfoBarNotifications.__init__(self)
        HelpableScreen.__init__(self)
        self.playlistCallback = playlistCallback
        self.nextItemCallback = nextItemCallback
        self.prevItemCallback = prevItemCallback
        self.infoCallback = infoCallback
        self.menuCallback = menuCallback
        self.statusScreen = statusScreen
        self.defaultImage = None
        self.postAspectChange.append(self.showAspectChanged)
        self.__timer = eTimer()
        self.__timer.callback.append(self.__seekToPosition)
        self.__image = None
        self.__position = None
        self.__firstStart = True
        self["genre"] = Label()

        # load meta info from json file provided by Kodi Enigma2Player
        try:
            meta = json.load(open(KODIEXTIN, "r"))
        except Exception as e:
            self.logger.error("failed to load meta from %s: %s", KODIEXTIN,
                              str(e))
            meta = {}
        self.__image = Meta(meta).getImage()
        self["image"] = WebPixmap(self.__image, caching=True)

        self.genre = str(", ".join(Meta(meta).getGenre()))
        self.plot = Meta(meta).getPlot()

        self["genre"].setText(self.genre)

        # set title, image if provided
        self.title_ref = Meta(meta).getTitle()

        # set start position if provided
        self.setStartPosition(Meta(meta).getStartTime())

        self["directionActions"] = HelpableActionMap(
            self, "DirectionActions", {
                "downUp": (playlistCallback, _("Show playlist")),
                "upUp": (playlistCallback, _("Show playlist"))
            })

        self["okCancelActions"] = HelpableActionMap(self, "OkCancelActions",
                                                    {"cancel": self.close})

        self["actions"] = HelpableActionMap(
            self, "KodiPlayerActions", {
                "menuPressed": (menuCallback, _("Show playback menu")),
                "infoPressed": (infoCallback, _("Show playback info")),
                "nextPressed":
                (nextItemCallback, _("Skip to next item in playlist")),
                "prevPressed":
                (prevItemCallback, _("Skip to previous item in playlist")),
                "seekFwdManual":
                self.keyr,
                "seekBackManual":
                self.keyl
            })

        self.eventTracker = ServiceEventTracker(
            self, {
                iPlayableService.evStart: self.__evStart,
            })

        assert KodiVideoPlayer.instance is None, "class KodiVideoPlayer is a singleton class and just one instance of this class is allowed!"
        KodiVideoPlayer.instance = self

        self.onClose.append(
            boundFunction(self.session.deleteDialog, self.statusScreen))
        self.onClose.append(
            boundFunction(Notifications.RemovePopup, self.RESUME_POPUP_ID))
        self.onClose.append(self.__timer.stop)
Пример #11
0
	def __init__(self, session, sref, playlist, playlistName, playlistCB, subtitles=None,
				autoPlay=True, showProtocol=False, onStartShow=False, repeat=False):
		BaseArchivCZSKScreen.__init__(self, session)
		self.onPlayService = []
		self.settings = config.plugins.archivCZSK.videoPlayer
		self.sref = sref

		# # set default/non-default skin according to SD/HD mode
		if self.settings.useDefaultSkin.getValue():
			self.setSkinName("MoviePlayer")
		else:
			HD = getDesktop(0).size().width() == 1280
			if HD:
				self.setSkin("ArchivCZSKMoviePlayer_HD")
			else:
				self.setSkinName("MoviePlayer")


		# # init custom infobar (added info about download speed, buffer level..)
		ArchivCZSKMoviePlayerInfobar.__init__(self)


		# # custom actions for MP
		self["actions"] = HelpableActionMap(self, "ArchivCZSKMoviePlayerActions",
        	{
         	"leavePlayer": (self.leavePlayer, _("leave player?")),
         	"toggleShow": (self.toggleShow, _("show/hide infobar")),
         	"audioSelection":(self.audioSelection, _("show audio selection menu")),
         	"refreshSubs":(self.refreshSubs, _("refreshing subtitles position")),
         	"subsDelayInc":(self.subsDelayInc, _("increasing subtitles delay")),
         	"subsDelayDec":(self.subsDelayDec, _("decreasing subtitles delay"))
          	}, -3)

		InfoBarBase.__init__(self, steal_current_service=True)
		# init of all inherited screens
		for x in HelpableScreen, InfoBarShowHide, \
			    InfoBarSeek, InfoBarAudioSelection, InfoBarNotifications, \
				InfoBarServiceNotifications, HelpableScreen, InfoBarPVRState, \
				InfoBarAspectChange, InfoBarServiceErrorPopupSupport:
				x.__init__(self)

		# init subtitles
		initSubsSettings()
		SubsSupport.__init__(self, subsPath=subtitles, defaultPath=config.plugins.archivCZSK.subtitlesPath.getValue(), forceDefaultPath=True, searchSupport=True)

		# playlist support
		InfoBarPlaylist.__init__(self, playlist, playlistCB, playlistName,
								 autoPlay=autoPlay, onStartShow=onStartShow, repeat=repeat, showProtocol=showProtocol)

		# to get real start of service, and for queries for video length/position
		self.video = Video(session)

		# # bindend some video events to functions
		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
		{
			iPlayableService.evStart: self.__serviceStarted,
			iPlayableService.evUpdatedEventInfo: self.__evUpdatedEventInfo,
			iPlayableService.evUser + 10: self.__evAudioDecodeError,
			iPlayableService.evUser + 11: self.__evVideoDecodeError,
			iPlayableService.evUser + 12: self.__evPluginError,
		})
		self.statusDialog = session.instantiateDialog(StatusScreen)
		self.onClose.append(self.statusDialog.doClose)
		self.isStream = self.sref.getPath().find('://') != -1
		self.returning = False
Пример #12
0
    def __init__(self, session, openmovie, opensubtitle, rootID, LastPlayedService, URLlinkName='', movieTitle='', LastPosition = 0):

        self.session = session
        self.statusScreen = self.session.instantiateDialog(StatusScreen)

                # #end subsupports stuff

        self.conditionalNotVisible = []
        self.URLlinkName = URLlinkName
        self.frameon = 1 / 24
        self.seeksubtitle = 0
        self.resume_point = 0
        self.nrsubtitle = 0
        self.statesubtitle = self.HIDDENSUBTITLE
        self.subtitles_enabled = False
        self.selected_subtitle = False
        self.stateplay = ''
        self.stateinfo = self.VISIBLE
        self.openmovie = openmovie
        
        if movieTitle == '':
            self.movieTitle = getNameWithoutExtension(path.basename(self.openmovie))
            #printDEBUG(self.movieTitle)
        else:
            self.movieTitle = movieTitle
            
        self.opensubtitle = ''
        self.rootID = int(rootID)
        self.LastPlayedService = LastPlayedService
        self.subtitle = []
        self.fontpos = 540
        self.fontsize = 60
        self.aspectratiomode = '0'
        self.SubtitleLineHeight = 66
        self.osdPosX = 0
        self.osdPosY = 0
        self.fonttype_nr = 0
        self.fontcolor_nr = 0
        self.fontbackground_nr = 0
        self.fontBackgroundState = 1
        self.loadfont()
        self.loadcolor()
        self.loadBackgroundColor()
        self.loadconfig()

        if self.opensubtitle == '':
            self.enablesubtitle = False
        else:
            self.enablesubtitle = True

        isHD = False
        isWideScreen = False
        isDolby = False
        self.skin = """
<screen name="AdvancedFreePlayer" position="0,0" size="1280,720" zPosition="-2" title="InfoBar" backgroundColor="transparent" flags="wfNoBorder">
    <!-- SubTitles -->
    <widget name="afpSubtitles" position="0,0" size="1,1" valign="center" halign="center" font="Regular;60" backgroundColor="#ff000000" transparent="0" />
  </screen>"""
        Screen.__init__(self, session)
        self['afpSubtitles'] = Label()

        self['actions'] = ActionMap(['AdvancedFreePlayer'], {  # "ToggleSubtitles": self.ToggleSubtitles,
            'ToggleInfobar': self.ToggleInfobar,
            'HelpScreen': self.HelpScreen,
            'SelectAspect': self.aspectChange,
            'ExitPlayer': self.ExitPlayer,
            'MoveSubsUp': self.MoveSubsUp,
            'MoveSubsDown': self.MoveSubsDown,
            'SetSmallerFont': self.SetSmallerFont,
            'SetBiggerFont': self.SetBiggerFont,
            'pause': self.pause,
            'play': self.play,
            'FastF30s': self.FastF30s,
            'FastF120s': self.FastF120s,
            'FastF300s': self.FastF300s,
            'BackF30s': self.BackF30s,
            'BackF120s': self.BackF120s,
            'BackF300s': self.BackF300s,
            'toggleFontBackground': self.toggleFontBackground,
            'SeekUpSubtitles': self.subsDelayInc,
            'SeekDownSubtitles': self.subsDelayDec,
            'togglePause': self.togglePause,
            'ToggleFont': self.ToggleFont,
            'refreshSubs': self.refreshSubs,
            'SelectAudio': self.SelectAudio,
            'SelectSubtitles': self.SelectSubtitles,
            }, -2)
        self.onShown.append(self.__LayoutFinish)
        InfoBarBase.__init__(self, steal_current_service=True)  # #subsupport....
        if subs == True:  # #susbsupport
            initSubsSettings()
        SubsSupport.__init__(self, embeddedSupport=True, searchSupport=True)
        self.subs = subs
        InfoBarSeek.__init__(self, actionmap='AdvancedFreePlayerSeekActions')  # #subsupport
        self.onClose.append(self.__onClose)
        if self.LastPlayedService is None:
            self.LastPlayedService = self.session.nav.getCurrentlyPlayingServiceReference()
        self.session.nav.stopService()
        self.__event_tracker = ServiceEventTracker(screen=self, eventmap={iPlayableService.evStart: self.resumeLastPlayback})  # iPlayableService.evSeekableStatusChanged: self.__seekableStatusChanged,