Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 7
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))
Ejemplo n.º 8
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.skinName = "MoviePlayer"
        else:
            HD = getDesktop(0).size().width() == 1280
            if HD:
                self.skinName = "ArchivCZSKMoviePlayer"
            else:
                self.skinName = "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)
        SubsSupportStatus.__init__(self)

        # 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
Ejemplo n.º 9
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)
Ejemplo n.º 10
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.skinName = "MoviePlayer"
		else:
			HD = getDesktop(0).size().width() == 1280
			if HD:
				self.skinName = "ArchivCZSKMoviePlayer"
			else:
				self.skinName = "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)
		SubsSupportStatus.__init__(self)

		# 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