swfdec.Loader — Object used for input
class swfdec.Loader(gobject.GObject): |
|
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.
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.
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.
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.
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.
def set_size(size)
| The amount of bytes in this loader. |
Sets the size of bytes in this loader. This function may only be called once.
def set_size(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.