Beispiel #1
0
 def fireEvent(self, eventName):
     """
     @param eventName: Name of the event
     """
     eventName = eventName+'Plugin'
     for listener in self.listeners:
         if hasattr(listener, eventName):
             eventMethod = getattr(listener, eventName)
             DeferredHandler.add(eventMethod, [self])
Beispiel #2
0
 def fireEvent(self, eventName):
     """
     @param eventName: Name of the event
     """
     eventName = eventName + 'Plugin'
     for listener in self.listeners:
         if hasattr(listener, eventName):
             eventMethod = getattr(listener, eventName)
             DeferredHandler.add(eventMethod, [self])
Beispiel #3
0
 def fileQueued(self, file):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.file_queued_handler, [file])
Beispiel #4
0
 def fileDialogStart(self):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.file_dialog_start_handler)
Beispiel #5
0
 def uploadComplete(self, file):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.upload_complete_handler, [file])
Beispiel #6
0
 def swfUploadLoaded(self):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.swfupload_loaded_handler)
Beispiel #7
0
 def fireEvent(self, eventName, arguments):
     for listener in self.listeners:
         if hasattr(listener, eventName):
             eventMethod = getattr(listener, eventName)
             arguments.insert(0, self)
             DeferredHandler.add(eventMethod, arguments)
Beispiel #8
0
 def fireEvent(self, movieName, eventName, arguments):
     """
     @param args: Arguments given by Flowplayer
     
     Fire event
     """
     #log.debug('FireEvent: %s/%s/%s' % (movieName, eventName, str(arguments)))
     if eventName == 'testFireEvent':
         log.debug('fireEvent works')
         return
     if eventName == 'onLoad' and arguments[0] == 'player':
         self.loadApi()
     for listener in self.listeners:
         if eventName == 'onLoad':
             if arguments[0] == 'player':
                 if hasattr(listener, 'onLoadPlayer'):
                     eventMethod = getattr(listener, 'onLoadPlayer')
                     DeferredHandler.add(eventMethod)
             else:
                 if arguments[0] == 'play':
                     name = 'screen'
                 else:
                     name = arguments[0]
                 if self.plugins.has_key(name):
                     self.plugins[name].loaded = True
                 if hasattr(listener, 'onLoadPlugin'):
                     eventMethod = getattr(listener, 'onLoadPlugin')
                     DeferredHandler.add(eventMethod, arguments)
         elif eventName == 'onPluginEvent':
             plugin_name = arguments[0]
             plugin_eventName = arguments[1]
             if self.plugins.has_key(plugin_name):
                 self.plugins[plugin_name].fireEvent(plugin_eventName)
         elif eventName == 'onClipAdd':
             arguments[0] = self.playlist[int(arguments[1])]
             if hasattr(listener, eventName):
                 eventMethod = getattr(listener, eventName)
                 DeferredHandler.add(eventMethod, arguments)
         else:
             if eventName in self.clip_events:
                 clip_index = int(arguments[0])
                 clip = self.getClip(clip_index)
                 if clip_index == 0 and eventName == 'onBegin':
                     if hasattr(listener, 'onFirstPlaylistItem'):
                         eventMethod = getattr(listener,
                                               'onFirstPlaylistItem')
                         DeferredHandler.add(eventMethod, [])
                 elif clip_index == len(
                         self.playlist) - 1 and eventName == 'onBegin':
                     if hasattr(listener, 'onLastPlaylistItem'):
                         eventMethod = getattr(listener,
                                               'onLastPlaylistItem')
                         DeferredHandler.add(eventMethod, [])
                 clip.fireEvent(eventName, arguments[2:])
             else:
                 #log.debug('[FP Event] %s / %s' % (eventName, arguments))
                 if hasattr(listener, eventName):
                     eventMethod = getattr(listener, eventName)
                     DeferredHandler.add(eventMethod, arguments)
Beispiel #9
0
 def fileQueueError(self, file, errorCode, message):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.file_queue_error_handler, [file, errorCode, message])
Beispiel #10
0
 def fileQueued(self, file):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.file_queued_handler, [file])
Beispiel #11
0
 def fileDialogStart(self):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.file_dialog_start_handler)
Beispiel #12
0
 def uploadComplete(self, file):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.upload_complete_handler, [file])
Beispiel #13
0
 def uploadSuccess(self, file, receivedResponse, serverData):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.upload_success_handler, [file, receivedResponse, serverData])
Beispiel #14
0
 def uploadError(self, file, errorCode, message):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.upload_error_handler, [file, errorCode, message])
Beispiel #15
0
 def uploadProgress(self, file, bytesLoaded, totalBytes):
     """
     Event-Method called by swfupload
     """
     file = File(file)
     DeferredHandler.add(self.settings.upload_progress_handler, [file, bytesLoaded, totalBytes])
Beispiel #16
0
 def fileQueueError(self, file, errorCode, message):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.file_queue_error_handler, [file, errorCode, message])
Beispiel #17
0
 def fileDialogComplete(self, sel, qu, tqu):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.file_dialog_complete_handler, [sel, qu, tqu])
Beispiel #18
0
 def fileDialogComplete(self, sel, qu, tqu):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.file_dialog_complete_handler, [sel, qu, tqu])
Beispiel #19
0
 def fireEvent(self, eventName, arguments):
     for listener in self.listeners:
         if hasattr(listener, eventName):
             eventMethod = getattr(listener, eventName)
             arguments.insert(0, self)
             DeferredHandler.add(eventMethod, arguments)
Beispiel #20
0
 def swfUploadLoaded(self):
     """
     Event-Method called by swfupload
     """
     DeferredHandler.add(self.settings.swfupload_loaded_handler)
Beispiel #21
0
 def fireEvent(self, movieName, eventName, arguments):
     """
     @param args: Arguments given by Flowplayer
     
     Fire event
     """
     #log.debug('FireEvent: %s/%s/%s' % (movieName, eventName, str(arguments)))
     if eventName == 'testFireEvent':
         log.debug('fireEvent works')
         return
     if eventName == 'onLoad' and arguments[0] == 'player':
             self.loadApi()
     for listener in self.listeners:
         if eventName == 'onLoad':
             if arguments[0] == 'player':
                 if hasattr(listener, 'onLoadPlayer'):
                     eventMethod = getattr(listener, 'onLoadPlayer')
                     DeferredHandler.add(eventMethod)
             else:
                 if arguments[0] == 'play':
                     name = 'screen'
                 else:
                     name = arguments[0]
                 if self.plugins.has_key(name):
                     self.plugins[name].loaded = True
                 if hasattr(listener, 'onLoadPlugin'):
                     eventMethod = getattr(listener, 'onLoadPlugin')
                     DeferredHandler.add(eventMethod, arguments)
         elif eventName == 'onPluginEvent':
             plugin_name = arguments[0]
             plugin_eventName = arguments[1]
             if self.plugins.has_key(plugin_name):
                 self.plugins[plugin_name].fireEvent(plugin_eventName)
         elif eventName == 'onClipAdd':
             arguments[0] = self.playlist[int(arguments[1])]
             if hasattr(listener, eventName):
                 eventMethod = getattr(listener, eventName)
                 DeferredHandler.add(eventMethod, arguments)
         else:
             if eventName in self.clip_events:
                 clip_index = int(arguments[0])
                 clip = self.getClip(clip_index)
                 if clip_index == 0 and eventName == 'onBegin':
                     if hasattr(listener, 'onFirstPlaylistItem'):
                         eventMethod = getattr(listener, 'onFirstPlaylistItem')
                         DeferredHandler.add(eventMethod, [])
                 elif clip_index == len(self.playlist)-1 and eventName == 'onBegin':
                     if hasattr(listener, 'onLastPlaylistItem'):
                         eventMethod = getattr(listener, 'onLastPlaylistItem')
                         DeferredHandler.add(eventMethod, [])
                 clip.fireEvent(eventName, arguments[2:])
             else:
                 #log.debug('[FP Event] %s / %s' % (eventName, arguments))
                 if hasattr(listener, eventName):
                     eventMethod = getattr(listener, eventName)
                     DeferredHandler.add(eventMethod, arguments)
Beispiel #22
0
 def uploadProgress(self, file, bytesLoaded, totalBytes):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.upload_progress_handler, [file, bytesLoaded, totalBytes])
Beispiel #23
0
 def uploadSuccess(self, file, receivedResponse, serverData):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.upload_success_handler, [file, receivedResponse, serverData])
Beispiel #24
0
 def uploadError(self, file, errorCode, message):
     """
     Event-Method called by swfupload
     """
     file = SWFFile(file)
     DeferredHandler.add(self.settings.upload_error_handler, [file, errorCode, message])