Main Page | Packages | Class Tree | Index | Help

com.bjc.controls

class VideoPlayer

MovieClip
  |
  +--com.bjc.core.BJCComponent
        |
        +--com.bjc.controls.VideoPlayer


class VideoPlayer
extends BJCComponent

A very basic flv video playback component. Flash Player version 7 is required.

Events:

complete - Fired when the playback reaches the end of the video.


Author:
Flashloaded - www.flashloaded.com


Field Summary

public
addEventListener: Function
See the EventDispatcher Class in Flash Help

public
completeHandler: Function
Can be used to assign a direct event handler to the component instance.

public
removeEventListener: Function
See the EventDispatcher Class in Flash Help

Fields inherited from class com.bjc.core.BJCComponent

version

Property Summary

public
buffer: Number (write)
Sets the amount in seconds that the video will be buffered.

public
buffer: Number (read)
Gets the amount in seconds that the video will be buffered.

public
bytesLoaded: Number (read-only)
Gets the amount of bytes loaded of the flv file.

public
bytesTotal: Number (read-only)
Gets the total amount of bytes of the flv file.

public
maintainRatio: Boolean (write)
Sets whether the video will scale to the correct aspect ratio once it is loaded.

public
maintainRatio: Boolean (read)
Sets the video aspect ratio mode of the component.

public
url: String (write)
Sets the url pointing to the location of an flv file.

public
url: String (read)
Gets the url pointing to the location of an flv file.

Properties inherited from class com.bjc.core.BJCComponent

disabledAlpha, enabled, focusTime, height, keyEnabled, style, width

Constructor

public
VideoPlayer ( Void)


Method Summary

public static
create ( target: MovieClip, id: String, depth: Number, initObj: Object ): VideoPlayer
Static method used to create an instance of a VideoPlayer on stage at run time.

public
pause ( Void ): Void
Pauses the playback of the Video, if currently playing, without altering the currentl playhead time.

public
play ( Void ): Void
If the video has not been played yet, will start the video playing from the beginning. Otherwise, if the video has been started and paused or rewinded, will play the video from the current playhead time.

public
rewind ( Void ): Void
Stops the playback of the Video, if currently playing, and returns the playhead to the beginning of the video.

Methods inherited from class com.bjc.core.BJCComponent

draw, invalidate, move, remove, setSize



Field Documentation

addEventListener

public var addEventListener: Function
See the EventDispatcher Class in Flash Help

completeHandler

public var completeHandler: Function
Can be used to assign a direct event handler to the component instance.

Usage:
myVideoPlayer.completeHandler = function(){
trace("The end.");
}

removeEventListener

public var removeEventListener: Function
See the EventDispatcher Class in Flash Help


Property Documentation

buffer

public buffer: Number (write)
Sets the amount in seconds that the video will be buffered.

Example:
myVideoPlayer.buffer = 5;

buffer

public buffer: Number (read)
Gets the amount in seconds that the video will be buffered.

Example:
myVar = myVideoPlayer.buffer;

bytesLoaded

public bytesLoaded: Number (read-only)
Gets the amount of bytes loaded of the flv file.

Example:
myVar = myVideoPlayer.bytesLoaded;

bytesTotal

public bytesTotal: Number (read-only)
Gets the total amount of bytes of the flv file.

Example:
myVar = myVideoPlayer.bytesTotal;

maintainRatio

public maintainRatio: Boolean (write)
Sets whether the video will scale to the correct aspect ratio once it is loaded.

Example:
myVideoPlayer.maintainRatio = true;

maintainRatio

public maintainRatio: Boolean (read)
Sets the video aspect ratio mode of the component.

Example:
myVar = myVideoPlayer.maintainRatio;

url

public url: String (write)
Sets the url pointing to the location of an flv file.

Example:
myVideoPlayer.url = "http://www.flashloaded.com/sample.flv";

url

public url: String (read)
Gets the url pointing to the location of an flv file.

Example:
myVar = myVideoPlayer.url;


Constructor Documentation

VideoPlayer

public function VideoPlayer(Void)

Method Documentation

create

public static function create(target: MovieClip,
 id: String,
 depth: Number,
 initObj: Object): VideoPlayer
Static method used to create an instance of a VideoPlayer on stage at run time.

Parameters:
target
the movie clip to which the video player will be attached.
id
the instance name given to the new video player attached.
depth
the depth at which to attach the new video player.
initObj
(optional) an object containing any properties you want to assign to the component when it is created
Returns:
a reference to the new video player attached.

Example:
import com.bjc.controls.VideoPlayer;
var newVideoPlayer:VideoPlayer = VideoPlayer.create(_root, "myVideoPlayer", 0);

pause

public function pause(Void): Void
Pauses the playback of the Video, if currently playing, without altering the currentl playhead time.

Returns:
nothing

Example:
myVideoPlayer.pause();

play

public function play(Void): Void
If the video has not been played yet, will start the video playing from the beginning. Otherwise, if the video has been started and paused or rewinded, will play the video from the current playhead time.

Returns:

Example:
myVideo.play();

rewind

public function rewind(Void): Void
Stops the playback of the Video, if currently playing, and returns the playhead to the beginning of the video.

Returns:
nothing

Example:
myVideoPlayer.rewind();


The documentation was generated from the following file:


Copyright Flashloaded - www.flashloaded.com