swfdec.Loader

swfdec.Loader — Object used for input

Synopsis

class swfdec.Loader(gobject.GObject):
    def get_data_type()
def get_loaded()
def get_size()
def get_url()
def set_size(size)
def set_url(url)

Ancestry

+-- gobject.GObject
    +-- swfdec.Stream
	+-- swfdec.Loader

swfdec.Loader Properties

"data-type"ReadThe data's type as identified by Swfdec. Default value: swfdec.LOADER_DATA_UNKNOWN
"loaded"Read/WriteBytes already loaded.
"size"Read/WriteAmount of bytes in loader. Allowed values: >= -1. Default value: -1
"url"ReadThe swfdec.URL.

Description

swfdec.Loader is the base class used for input. Since developers normally need to adapt input to the needs of their application, this class is provided to be adapted to their needs.

Since Flash files can load new resources while operating, a swfdec.Loader can be instructed to load another resource. It's the loader's responsibility to make sure the player is allowed to access the resource and provide its data.

For convenience, a swfdec.Loader for file access is provided by Swfdec.

Methods

swfdec.Loader.get_data_type

    def get_data_type()

Returns :

The type this data was identified to be in or swfdec.LOADER_DATA_UNKNOWN if not identified.

Queries the type of data this loader provides. The type is determined automatically by Swfdec.

swfdec.Loader.get_loaded

    def get_loaded()

Returns :

Amount of bytes in loader.

Gets the amount of bytes that have already been pushed into loader and are available to Swfdec.

swfdec.Loader.get_size

    def get_size()

Returns :

The total number of bytes for this loader or 0 if unknown.

Queries the amount of bytes inside loader. If the size is unknown, 0 is returned.

swfdec.Loader.get_url

    def get_url()

Returns :

a swfdec.URL describing loader or None if the url is not known yet.

Gets the url this loader is handling. This is mostly useful for writing subclasses of swfdec.Loader.

swfdec.Loader.set_size

    def set_size(size)

size :

The amount of bytes in this loader.

Sets the size of bytes in this loader. This function may only be called once.

swfdec.Loader.set_url

    def set_size(url)

url :

string specifying the new URL. The url must be a valid absolute URL.

Updates the url of the given loader to point to the new url. This is useful whe encountering HTTP redirects, as the loader is supposed to reference the final URL after all rdirections. This function may only be called once and must have been called before calling swfdec_stream_open() on loader.