FlvLoad

Kind of class:class
Inherits from:BytesLoad < RetryableLoad < Load < EventDispatcher < CoreObject
Version:04/10/08
Author:Aaron Clinger
Classpath:org.casalib.load.media.video.FlvLoad
File last modified:Monday, 01 December 2008, 13:34:40
Provides an easy way to load FLVs and includes additional events notifying buffer progress.
Since:
  • Flash Player 7
Example:
  • function onBufferProgress(sender:FlvLoad, percentBuffered:Percent, secondsTillBuffered:Number):Void {
        trace("Video " + Math.round(percentBuffered.getPercentage()) +"% buffered.");
        trace("Video will be buffered in " + Math.round(secondsTillBuffered) + " seconds.");
    }
    
    function onBufferComplete(sender:FlvLoad):Void {
        this.flvLoad.getNetStream().pause(false);
    }
    
    var flvLoad:FlvLoad = new FlvLoad(this.myVideo, "test.flv");
    this.flvLoad.addEventObserver(this, FlvLoad.EVENT_BUFFER_PROGRESS);
    this.flvLoad.addEventObserver(this, FlvLoad.EVENT_BUFFER_COMPLETE);
    this.flvLoad.start();
Events broadcasted to listeners:
  • onStatus = function (sender:FlvLoad, infoObject:Object) {}
  • onMetaData = function (sender:FlvLoad, infoObject:Object) {}
  • onBufferProgress = function (sender:FlvLoad, percentBuffered:Percent, secondsTillBuffered:Number) {}
  • onBufferComplete = function (sender:FlvLoad) {}

Summary


Constructor

FlvLoad

function FlvLoad (
target_vid:Video, flvPath:String, pause:Boolean, duration:Number)

Defines file and location of load triggered by start.
Parameters:
target_vid:
A path to a Video container where the file specified by flvPath should be loaded into.
flvPath :
The absolute or relative URL of the FLV file to be loaded.
pause :
[optional] Indicates to pause video at start true, or to let the video automatically play false; defaults to true.
duration :
[optional] Length of FLV in seconds; if left undefined duration is taken from the FLV's meta data.

Class properties

EVENT_BUFFER_COMPLETE

static EVENT_BUFFER_COMPLETE:String = 'onBufferComplete'
(read,write)

EVENT_BUFFER_PROGRESS

static EVENT_BUFFER_PROGRESS:String = 'onBufferProgress'
(read,write)

EVENT_META_DATA

static EVENT_META_DATA:String = 'onMetaData'
(read,write)

EVENT_STATUS

static EVENT_STATUS:String = 'onStatus'
(read,write)

Instance methods

destroy

function destroy (
) : Void

getBytesLoaded

function getBytesLoaded (
) : Number

getBytesTotal

function getBytesTotal (
) : Number

getNetStream

function getNetStream (
) : NetStream

Returns:
  • Returnes the NetStream object being used internally to load and control the FLV.

getVideo

function getVideo (
) : Video

Returns:
  • Returns Video specified in FlvLoad.