+ self.session.openWithCallback(self.movieSelected, MovieSelection)
+
+ def movieSelected(self, service):
+ if service is not None:
+ self.session.open(MoviePlayer, service)
+
+class MoviePlayer(Screen, InfoBarShowHide, InfoBarPowerKey, \
+ InfoBarMenu, \
+ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
+ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport):
+
+ def __init__(self, session, service):
+ Screen.__init__(self, session)
+
+ self["actions"] = HelpableActionMap(self, "MoviePlayerActions",
+ {
+ "leavePlayer": (self.leavePlayer, _("leave movie player..."))
+ })
+
+ for x in HelpableScreen, InfoBarShowHide, InfoBarPowerKey, InfoBarMenu, \
+ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \
+ InfoBarAudioSelection, InfoBarNotifications, \
+ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport:
+ x.__init__(self)
+
+ self["CurrentTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_REMAINING)
+ self["ElapsedTime"] = ServicePosition(self.session.nav, ServicePosition.TYPE_POSITION)
+ self["PositionGauge"] = ServicePositionGauge(self.session.nav)
+
+ # TYPE_LENGTH?
+
+ self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
+ self.session.nav.playService(service)
+
+ def leavePlayer(self):
+ self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
+
+ def leavePlayerConfirmed(self, answer):
+ if answer == True:
+ self.session.nav.playService(self.lastservice)
+ self.close()
+
+ def showMovies(self):
+ ref = self.session.nav.getCurrentlyPlayingServiceReference()
+ self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
+
+ def movieSelected(self, service):
+ if service is not None:
+ self.session.nav.playService(service)