本文整理汇总了Python中Screens.InfoBar.MoviePlayer类的典型用法代码示例。如果您正苦于以下问题:Python MoviePlayer类的具体用法?Python MoviePlayer怎么用?Python MoviePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MoviePlayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, session, playlist, notifyNextEntry=None, flags=None):
self.session = session
self.flags = flags
self.playlist = self.fixParts(playlist)
self.progressTimer = eTimer()
self.progressTimer.callback.append(self.progressUpdate)
self.progressTimer.start(1000)
self.notifyNextEntry = notifyNextEntry
if isinstance(self.playlist, list):
self.isPlaylist = True
self.current = 0
firstPath = self.playlist[0][0]
firstName = self.playlist[0][1]
if firstPath.endswith(".ts"):
type = 1
elif firstPath.endswith(".m2ts"):
type = 3
else:
type = 4097
ref = eServiceReference(type, 0, firstPath)
self.currentPlayingFile = firstPath
ref.setName(firstName)
self.playing = True
MoviePlayer.__init__(self, session, ref)
else:
self.isPlaylist = False
self.playing = True
self.currentPlayingFile = self.playlist
MoviePlayer.__init__(self, session, self.playlist)
self.skinName = "MoviePlayer"
示例2: __init__
def __init__(self, session,openmovie,opensubtitle, rootID, LastPlayedService, URLlinkName = '', movieTitle='', LastPosition = 0):
self.session = session
#if '://' not in uri: uri = 'file://' + uri
fileRef = eServiceReference(int(rootID),0,openmovie)
fileRef.setName (movieTitle)
self.Ask_on_movie_stop = False
#try:
if config.usage.on_movie_stop.value == "ask":
self.Ask_on_movie_stop = True
config.usage.on_movie_stop.value = "quit"
config.usage.on_movie_stop.save()
#except:
# pass
self.Ask_on_movie_eof = False
try:
if config.usage.on_movie_eof.value == "ask":
self.Ask_on_movie_eof = True
config.usage.on_movie_eof.value = "quit"
config.usage.on_movie_eof.save()
except:
pass
systemMoviePlayer.__init__(self, self.session, fileRef)
self.skinName = "MoviePlayer"
systemMoviePlayer.skinName = "MoviePlayer"
if self.Ask_on_movie_stop == True:
config.usage.on_movie_stop.value = "ask"
config.usage.on_movie_stop.save()
if self.Ask_on_movie_eof == True:
config.usage.on_movie_eof.value = "ask"
config.usage.on_movie_eof.save()
示例3: __init__
def __init__(self, session, service):
CutListSupport.__init__(self, service)
MoviePlayer.__init__(self, session, service)
MoviePreview.__init__(self, session)
SelectionEventInfo.__init__(self)
self.skinName = ["MoviePlayerExtended", "MoviePlayer"]
global PlayerInstance
PlayerInstance = self
self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions",
{
"showEventInfo": (self.openInfoView, _("Show event details")),
"showEventInfoPlugin": (self.openServiceList, _("Open servicelist"))
})
if config.AdvancedMovieSelection.exitkey.value and config.AdvancedMovieSelection.exitprompt.value:
self["closeactions"] = HelpableActionMap(self, "WizardActions",
{
"back": (self.leavePlayer, _("Leave movie player"))
})
if config.AdvancedMovieSelection.exitkey.value and not config.AdvancedMovieSelection.exitprompt.value:
self["closeactions"] = HelpableActionMap(self, "WizardActions",
{
"back": (self.close, _("Leave movie player"))
})
if config.AdvancedMovieSelection.use_original_movieplayer_summary.value == True:
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
iPlayableService.evUpdatedInfo: self.__updateInfo
})
self.firstime = True
self.onExecBegin.append(self.__onExecBegin)
示例4: __init__
def __init__(self, session, service, cutlistat):
self.service = service
#self.backup = []
self.cutlistat = cutlistat
self.cut_list = []
Cutlist.__init__(self)
MoviePlayer.__init__(self, session, service)
self.skinName = "MoviePlayer"
self["custom_actions"] = HelpableActionMap(self, "CutlistPlayerActions",
{
"left": (self.left, _("Move Cutlist to the left")),
"right": (self.right, _("Move Cutlist to the right")),
"ok": (self.switch, _("Switch between Marker and Cut-In/Out")),
"exit": (self.cancel, _("Exit without saving")),
#"up": (self["list"].pageUp, _("Page up")),
#"down": (self["list"].pageDown, _("Page up")),
#"red": (self.ok, _("Download Single Cutlist")),
"green": (self.save, _("Save new cutlist")),
#"yellow": (self.bestdownload, _("Page up")),
#"blue": (self.remove, _("Remove Marker")),
}, -3)
self["Service"] = CutlistService(session.nav, self)
示例5: __init__
def __init__(self, session, sref, playlist, playlistName, playlistCB):
self.onPlayService = []
self.sref = sref
MoviePlayer.__init__(self, session, sref)
InfoBarPlaylist.__init__(self, playlist, playlistCB, playlistName)
# SubsSupport.__init__(self, subPath=subtitles, alreadyPlaying=True)
self.skinName = "MoviePlayer"
示例6: keyOK
def keyOK(self):
sel = self["config"].getCurrent()[1]
if sel == self.positionEntry:
if self.length:
if self.dvd: # seekTo() doesn't work for DVD Player
oldPosition = self.seek.getPlayPosition()[1]
newPosition = int(float(self.length[1]) / 100.0 * self.percent)
if newPosition > oldPosition:
pts = newPosition - oldPosition
else:
pts = -1*(oldPosition - newPosition)
DVDPlayer.doSeekRelative(self.infobarInstance, pts)
else:
self.seek.seekTo(int(float(self.length[1]) / 100.0 * self.percent))
self.exit()
elif sel == self.minuteInput:
pts = self.minuteInput.value * 60 * 90000
if self.fwd == False:
pts = -1*pts
if self.dvd:
DVDPlayer.doSeekRelative(self.infobarInstance, pts)
elif self.vdb:
VideoDBPlayer.doSeekRelative(self.infobarInstance, pts)
else:
MoviePlayer.doSeekRelative(self.infobarInstance, pts)
self.exit()
示例7: __init__
def __init__(self, session, service, backend, start=None):
MoviePlayer.__init__(self, session, service)
self.backend = backend
backend.window=self
session.nav.getCurrentService().streamed().setBufferSize(config.plugins.airplayer.bufferSize.value)
self.AutoPlay = True
self.start=start;
start_new_thread(self.seekWatcher,(self,))
示例8: __init__
def __init__(self, session, service, cur, playnext):
MoviePlayer.__init__(self, session, service)
self.skinName = ['BlurayPlayer', 'MoviePlayer']
self.servicelist = InfoBar.instance and InfoBar.instance.servicelist
self.cur = cur
self.playnext = playnext
self.chapters = []
self.onLayoutFinish.append(self.LayoutFinish)
示例9: __init__
def __init__(self, session, uri, title):
self.session = session
self.WithoutStopClose = True
#if '://' not in uri: uri = 'file://' + uri
fileRef = eServiceReference(4097,0,uri)
fileRef.setName (title)
standardMoviePlayer.__init__(self, self.session, fileRef)
self.skinName = "MoviePlayer"
standardMoviePlayer.skinName = "MoviePlayer"
示例10: openMoviePlayerEventView
def openMoviePlayerEventView(self):
already_open = False
if True and not already_open:
already_open = True
service = self.session.nav.getCurrentService()
filename = service.info().getName()
url = self.session.nav.getCurrentlyPlayingServiceReference().getPath()
if re.match('.*?http://', url, re.S):
self.session.open(MediaInfo)
else:
MoviePlayer.originalOpenEventView(self)
else:
MoviePlayer.originalOpenEventView(self)
示例11: doEofInternal
def doEofInternal(self, playing): # Override method in MoviePlayer
if not self.endless_loop:
return MoviePlayer.doEofInternal(self, playing)
if not self.execing:
return
if not playing:
return
self.leavePlayerConfirmed([True, "restart"])
示例12: __init__
def __init__(self, session, service):
CutListSupport.__init__(self, service)
MoviePlayer.__init__(self, session, service)
PlayerBase.__init__(self, session)
self.skinName = ["MoviePlayerExtended", "MoviePlayer"]
if config.AdvancedMovieSelection.exitkey.value and config.AdvancedMovieSelection.exitprompt.value:
self["closeactions"] = HelpableActionMap(self, "WizardActions",
{
"back": (self.leavePlayer, _("Leave movie player"))
})
if config.AdvancedMovieSelection.exitkey.value and not config.AdvancedMovieSelection.exitprompt.value:
self["closeactions"] = HelpableActionMap(self, "WizardActions",
{
"back": (self.close, _("Leave movie player"))
})
if config.AdvancedMovieSelection.use_original_movieplayer_summary.value == True:
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
iPlayableService.evUpdatedInfo: self.__updateInfo
})
self.firstime = True
self.onExecBegin.append(self.__onExecBegin)
示例13: __init__
def __init__(self, session, service):
MoviePlayer.__init__(self, session, service)
self.skinName = "MoviePlayer"
示例14: __init__
def __init__(self, session, playerData, resume=False):
'''
'''
printl("", self, "S")
self.session = session
self.startNewServiceOnPlay = False
self.resume = resume
self.resumeStamp = int(playerData['resumeStamp']) / 1000 #plex stores seconds * 1000
self.server = str(playerData['server'])
self.id = str(playerData['id'])
self.url = str(playerData['playUrl'])
printl("Checking for usable gstreamer service (built-in)... ",self, "I")
if self.isValidServiceId(self.ENIGMA_SERVICEGS_ID):
printl("found usable gstreamer service (builtin) ...", self, "I")
self.ENIGMA_SERVICE_ID = self.ENIGMA_SERVICEGS_ID
#STOP_BEFORE_UNPAUSE = False
else:
printl("no usable gstreamer service (built-in) found ...", self, "I")
#todo hier eine meldung mit dem hinweis auf systemcheck
#session.open(MessageBox, _("Please try Systemcheck to install gstreamer!"), MessageBox.TYPE_INFO)
#MoviePlayer.__init__(self, session, service)
printl("self.ENIGMA_SERVICE_ID = " + str(self.ENIGMA_SERVICE_ID), self, "I")
sref = eServiceReference(self.ENIGMA_SERVICE_ID, 0, self.url)
sref.setName("DreamPlex")
#MoviePlayer.__init__(self, session, service)
MoviePlayer.__init__(self, session, sref)
self.skinName = "DPS_PlexPlayer"
self.service = sref
self.bufferslider = Slider(0, 100)
self["bufferslider"] = self.bufferslider
self["bufferslider"].setValue(0)
self["label_bitrate"] = StaticText("Bitrate: N/A")
self["label_speed"] = StaticText("DL-Speed: N/A")
self["label_buffer"] = StaticText("Buffer")
self["label_update"] = StaticText("")
self.bufferSeconds = 0
self.bufferPercent = 0
self.bufferSecondsLeft = 0
self.bitrate = 0
self.endReached = False
self.buffersize = 1
self.localCache = False
self.dlactive = False
self.url = self.service.getPath()
self.localsize = 0
self["actions"] = ActionMap(["InfobarInstantRecord", "MoviePlayerActions"],
{
"instantRecord": self.keyStartLocalCache,
"leavePlayer": self.leavePlayer,
}, -2)
self.useBufferControl = config.plugins.dreamplex.useBufferControl.value
if config.plugins.dreamplex.setBufferSize.value:
bufferSize = int(config.plugins.dreamplex.bufferSize.value) * 1024 * 1024
session.nav.getCurrentService().streamed().setBufferSize(bufferSize)
service1 = self.session.nav.getCurrentService()
self.seek = service1 and service1.seek()
if self.seek != None:
rLen = self.getPlayLength()
rPos = self.getPlayPosition()
printl("rLen: " + str(rLen), self, "I")
printl("rPos: " + str(rPos), self, "I")
if self.resume == True and self.resumeStamp != None and self.resumeStamp > 0.0:
start_new_thread(self.seekWatcher,(self,))
start_new_thread(self.bitRateWatcher,(self,))
#start_new_thread(self.checkForUpdate,(self,))
self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
{
iPlayableService.evUser+10: self.__evAudioDecodeError,
iPlayableService.evUser+11: self.__evVideoDecodeError,
iPlayableService.evUser+12: self.__evPluginError,
iPlayableService.evBuffering: self.__evUpdatedBufferInfo,
iPlayableService.evEOF: self.__evEOF,
})
printl("", self, "C")
示例15: __init__
def __init__(self, session, service):
self.session = session
MoviePlayer.__init__(self, session, service)
self.skinName = "MoviePlayer"
MoviePlayer.WithoutStopClose = True