Package muntjac :: Package ui :: Module abstract_media :: Class AbstractMedia
[hide private]
[frames] | no frames]

Class AbstractMedia

source code

                          object --+                
                                   |                
                 util.IEventListener --+            
                                       |            
           terminal.paintable.IPaintable --+        
                                           |        
                              object --+   |        
                                       |   |        
  terminal.variable_owner.IVariableOwner --+        
                                           |        
                              object --+   |        
                                       |   |        
             terminal.sizeable.ISizeable --+        
                                           |        
                        component.IComponent --+    
                                               |    
                                  object --+   |    
                                           |   |    
event.method_event_source.IMethodEventSource --+    
                                               |    
            abstract_component.AbstractComponent --+
                                                   |
                                                  AbstractMedia

Abstract base class for the HTML5 media components.


Authors:
Vaadin Ltd, Richard Lincoln
Instance Methods [hide private]
 
__init__(self)
Constructs a new IComponent.
source code
 
setSource(self, source)
Sets a single media file as the source of the media component.
source code
 
addSource(self, source)
Adds an alternative media file to the sources list.
source code
 
setSources(self, *sources)
Set multiple sources at once.
source code
 
getSources(self)
Returns: The sources pointed to in this media.
source code
 
setShowControls(self, showControls)
Sets whether or not the browser should show native media controls.
source code
 
isShowControls(self)
Returns: true if the browser is to show native media controls.
source code
 
setAltText(self, text)
Sets the alternative text to be displayed if the browser does not support HTML5.
source code
 
getAltText(self)
Returns: The text/html that is displayed when a browser doesn't support HTML5.
source code
 
setHtmlContentAllowed(self, htmlContentAllowed)
Set whether the alternative text (setAltText) is rendered as HTML or not.
source code
 
isHtmlContentAllowed(self)
Returns: true if the alternative text (setAltText) is to be rendered as HTML.
source code
 
setAutoplay(self, autoplay)
Sets whether the media is to automatically start playback when enough data has been loaded.
source code
 
isAutoplay(self)
Returns: true if the media is set to automatically start playback.
source code
 
setMuted(self, muted)
Set whether to mute the audio or not.
source code
 
isMuted(self)
Returns: true if the audio is muted.
source code
 
pause(self)
Pauses the media.
source code
 
play(self)
Starts playback of the media.
source code
 
paintContent(self, target)
Paints any needed component-specific things to the given UIDL stream.
source code

Inherited from abstract_component.AbstractComponent: __getstate__, __setstate__, addCallback, addListener, addStyleName, attach, changeVariables, childRequestedRepaint, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, fireRequestRepaintEvent, focus, getApplication, getCSSHeight, getCSSWidth, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, hasListeners, isEnabled, isImmediate, isReadOnly, isVisible, paint, parseStringSize, registerCallback, registerListener, removeCallback, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setVisible, setWidth, setWidthUnits, withdrawCallback, withdrawListener

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from abstract_component.AbstractComponent: SIZE_PATTERN

Inherited from terminal.sizeable.ISizeable: SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS, UNIT_SYMBOLS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructs a new IComponent.

Overrides: object.__init__
(inherited documentation)

addSource(self, source)

source code 

Adds an alternative media file to the sources list. Which of the sources is used is selected by the browser depending on which file formats it supports. See <a href="http://en.wikipedia.org/wiki/HTML5_video#Table">wikipedia</a> for a table of formats supported by different browsers.

setSources(self, *sources)

source code 

Set multiple sources at once. Which of the sources is used is selected by the browser depending on which file formats it supports. See <a href="http://en.wikipedia.org/wiki/HTML5_video#Table">wikipedia</a> for a table of formats supported by different browsers.

getSources(self)

source code 
Returns:
The sources pointed to in this media.

isShowControls(self)

source code 
Returns:
true if the browser is to show native media controls.

setAltText(self, text)

source code 

Sets the alternative text to be displayed if the browser does not support HTML5. This text is rendered as HTML if setHtmlContentAllowed is set to true. With HTML rendering, this method can also be used to implement fallback to a flash-based player, see the <a href= "https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Using_Flash" >Mozilla Developer Network</a> for details.

getAltText(self)

source code 
Returns:
The text/html that is displayed when a browser doesn't support HTML5.

isHtmlContentAllowed(self)

source code 
Returns:
true if the alternative text (setAltText) is to be rendered as HTML.

isAutoplay(self)

source code 
Returns:
true if the media is set to automatically start playback.

isMuted(self)

source code 
Returns:
true if the audio is muted.

paintContent(self, target)

source code 

Paints any needed component-specific things to the given UIDL stream. The more general paint method handles all general attributes common to all components, and it calls this method to paint any component-specific attributes to the UIDL stream.

Parameters:
  • target - the target UIDL stream where the component should paint itself to
Raises:
Overrides: abstract_component.AbstractComponent.paintContent
(inherited documentation)