SupraVideoPro v.2- flash component

AS3 SWC flash video component.

Public Properties

videosPath:String
(Optional) The path of the directory where the flv videos resides.
videosXml:String
(Optional) An xml document that contains the videos which are to be loaded.
globalVolume:Number (0 - 100)

(Optional) The global volume defines the max volume that can be set in the player.

videoVolume:Number (0 - 100)
(Optional) The volume of the current video.
videoSmoothing:Boolean
(Optional) Anti-aliasing parameter.
maxScreenWidth:Number
(Optional) The max width of the video when previewed in full-screen mode.
fullVideoAlignment:String ("top", "middle", bottom)
(Optional) Vertical alignment of the video when previewed in full-screen mode.
streamForcedPercent:Number (0 - 100)
(Optional) A percent of the video preload which forces the stream to start playing.
streamSafePercent:Number (0 - 100)
(Optional) A percent that is added to the optimal download percent.
stepTime:Number
(Optional) The amount of seconds that the play-head jumps when playInTime() is invoked
videoRepeat:Boolean
(Optional) Parameter that enables the current video to repeat.

Public Methods

setVideoItem(videoUrl:String, addToList:Boolean = true, toplay:Boolean = true, toLoad:Boolean = true, infoObj:Object = null)
Load and play an flv video.
Return the current playing video object
loadMedia(mediaItem:Object)
Loads a video object.
Start playing of the current video stream.
Clears the video screen.
setFullScreen(toSet:Boolean)
Sets the player into a full-screen mode.
seekInMedia(seekPct:Number)
Seeks to the desired time. This function accepts a number which represents a percent of the play-head position.
Plays the the current video.
Stops the current video.
Pauses the current video.
playInTime(dir:String)
Moves the play-head to the desired direction. The amount of seconds is defined by the public property "stepTime".
Plays the next video item in the current playlist
Plays the previous video item in the current playlist.
createPlaylist(playlistTitle:String, playlistDesc:String)
Create a new playlist.
loadPlaylist(plId:Number)
Load playlist.
deletePlaylist(playlistId:Number)
Delete the playlist located by its id.
Delete all playlists.
Returns an array of all the created playlists.
Sets the chosen item in the playing queue
Shuffles the items in the current playlist.
getPlaylistItem(playlistId:Number, playlistItemId:Number)
Return a video item object.
getPlaylistItems(playlistId:Number)
Returns an array of all items in the selected playlist.
playNextItem(playDir:String)
Plays the next item in the playlist stack, defined by the direction parameter.
Returns the current playlist.
Returns the loaded videos XML.
mergePlaylists(deleteRest:Boolean, baseListId:Number, secondListId:Number, ... listsId)
Merges the specified playlist, with option to delete the rest playlist.
Return a number that represents the player version.

Events

Fired when videos xml has loaded.
Fired each time when the volume has been updated.
Fired when video stops.
Fired when video starts playing.
This event is fired when the queue stack gets to its end.
Fired when the video riches the end of its duration.
If the stream couldn't be located this event is fired.
On successful connection.
This event holds an object that has the current status of the video player.
Fired when the components is added to stage
Fired when the component has been removed from the stage.
This event holds an object with information about the current stream.
Fired on every cue point, if any. This events holds an "info" object that has the following properties: time, name, type
Fired when "onMetaData" function has been invoked.
Fired when the contructor is initialized.

Properties description

videosPath

public var videosPath:String

SupraVideoPro.videosPath = "../videos/";


videosXml

public var videosXml:String

URL of the XML document that contains the video items.

SupraVideoPro.videosXml = "../xml/videos.xml";


globalVolume

public var globalVolume:Number

SupraVideoPro.globalVolume = 100;


videoVolume

public var videoVolume:String

SupraVideoPro.videoVolume = 50;


videoSmoothing

public var videoSmoothing:Boolean

SupraVideoPro.videoSmoothing = true;


maxScreenWidth

public var maxScreenWidth:Number

SupraVideoPro.maxScreenWidth = 500;


fullVideoAlignment

public var fullVideoAlignment:String

SupraVideoPro.fullVideoAlignment = "middle";


streamForcedPercent

public var streamForcedPercent:Number

SupraVideoPro.streamForcedPercent = 20;


streamSafePercent

public var streamSafePercent:Number

SupraVideoPro.streamSafePercent = 10;


stepTime

public var stepTime:String

SupraVideoPro.stepTime = 2000;


videoRepeat

public var videoRepeat:Boolean

SupraVideoPro.videoRepeat = false;


Methods description

setVideoItem

public function setVideoItem(videoUrl:String, addToList:Boolean = true, toplay:Boolean = true, toLoad:Boolean = true, infoObj:Object = null):MediaPlaylistItem

Registers an event listener.

Parameters
videoUrl:String — The url of the video stream.
addToList:Boolean — This parameter defines if the video object is going to be added in the current playlist.
toplay:Boolean — Determines whether the video stream will be played after successful load.
toLoad:Boolean — Determines whether the video will start streaming or just be loaded in the playlist.
infoObj:Object — Object that should have the following parameters: {itemTitle: "", itemAuthor: "", itemYear: ""}
 

getCurrentPlayItem

public function getCurrentPlayItem():MediaPlaylistItem

Return the current playing item which is an object of type MediaPlaylistItem having the following parameters:

Parameters
mediaItemUrl:String — The url of the video stream.
mediaItemToPlay:Boolean —Determines whether the video stream will be played after successful load.
mediaItemInfoObject:Object — This is the info object that has the following parameters: {itemTitle: "", itemAuthor: "", itemYear: ""}
mediaItemId:String — The id of the added video item.

loadMedia

public function loadMedia(mediaItem:MediaPlaylistItem):Void

Loads video item.

Parameters
mediaItem:MediaPlaylistItem — Object that has the following parameters: {mediaItemUrl:String, mediaItemToPlay:Boolean, mediaItemInfoObject:Object, mediaItemId:String}.

startToPlay

public function startToPlay():void

Forces the loaded video stream to start playing.


flushVideo

public function flushVideo():Void

Clears the video screen.


setFullScreen

public function setFullScreen():Void

Set the video player into a full-screen mode.


seekInMedia

public function seekInMedia(seekPct:Number):Void

Moves the play-head to the desired play percent.

Parameters
seekPct:Number — The percent amount.

playMedia

public function playMedia():Void

Plays the current video stream.


stopMedia

public function stopMedia():Void

Stops playing the current video stream.


pauseMedia

public function pauseMedia():Void

Pause the current video stream.


playInTime

public function playInTime(dir:String):Void

Moves the play-head in depending the chosen direction for a certain amount of milliseconds defined by the public parameter "stepTime".

Parameters
dir:String — The value should be "+" or "-" depending of which direction the play-head should move, backwards or forward respectively..
 

nextMediaItem

public function nextMediaItem():Void

Loads the next video from the playlist stack.


prevMediaItem

public function prevMediaItem():Boolean

Loads the previous video from the playlist stack


createPlaylist

public function createPlaylist(playlistTitle:String, playlistDesc:String):MediaPlaylist

Creates a new playlist.

Parameters
playlistTitle:String — The title of the new playlist.
playlistDesc:String —The description of the new playlist.
Returns
MediaPlaylist object

loadPlaylist

public function loadPlaylist(playlistId:Number):Void

Loads playlist by id.

Parameters
playlistId:Number — The playlist id.

deletePlaylist

public function deletePlaylist(playlistId:Number):Void

Deletes the playlist with the id provided as an argument.

Parameters
playlistId:Number — The playlist id.

deleteAllPlaylists

public function deleteAllPlaylists():void

Deletes all the saved playlists.


getPlaylists

public function getPlaylists():Array

Returns an array of all the playlists

Returns
Array

setItemInQueue

public function setItemInQueue(item:MediaPlaylistItem):void

Sets the item in the play stack

Parameters
item:MediaPlaylistItem — The item object.
 

shuffleItems

public function shuffleItems():void

Shuffles the items of the current playlist.


getPlaylistItem

public function getPlaylistItem(playlistId:Number, playlistItemId:Number):MediaPlaylistItem

Returns the desired playlist item.

Parameters
playlistId:Number — The id of the playlist that contains the video item.
playlistItemId:Number — The id of the video playlist item.
Returns
item:MediaPlaylistItem — The item object.

getPlaylistItems

public function getPlaylistItems(playlistId:Number):Array

Returns all the items in the specified playlist.

Parameters
playlistId:Number — The id of the playlist that contains the video item.
 
Returns
Array— The array of video items.

playNextItem

public function playNextItem(dir:String):void

Plays the next item from the playlist stack. The direction is defined by the passed function argument.

Parameters
dir:String — The value must be "+" or "-".

getCurrentPlaylist

public function getCurrentPlaylist():MediaPlaylist

Returns the current playlist.

Returns
MediaPlaylist— The playlist object..

getLoadedXml

public function getLoadedXml():XML

Returns the loaded XML.

Returns
XML— The loaded videos XML

mergePlaylists

public function mergePlaylists(deleteRest:Boolean, baseListId:Number, secondListId:Number, ... listsId):void

Merges the specified playlists ids.

Parameters
deleteRest:Boolean — This parameter defines whether the rest of the playlists after the merging should be deleted.
baseListId:Number —The playlist that will merge all the other playlists..
secondListId:Number — The second playlist.
 

getPlayerVersion

public function getPlayerVersion():String

Returns the verison of the component.

Returns
String— The current version stamp code of the component.
 
 

Events description

XML_LOADED

No properties

VOLUME_STATUS

vol:Number

STOP_VIDEO

No properties

PLAY_VIDEO

No properties

NO_ITEMS_IN_QUEUE

No properties

VIDEO_PLAY_DONE

No properties

STREAM_NOT_FOUND

No properties

CONNECT_SUCCESS

No properties

PLAYER_STATUS

playerStatusObj.playerPlaying;
playerStatusObj.playerVersion;
playerStatusObj.videoRepeat;
playerStatusObj.videoPaused;
playerStatusObj.currentPlaylist;
playerStatusObj.globalVolume;
playerStatusObj.currentVideoDuration;
playerStatusObj.currentVideoTime;
playerStatusObj.videoSmoothing;
playerStatusObj.videosPath;
playerStatusObj.currentMediaItem.mediaItemUrl;
playerStatusObj.currentMediaItem.mediaItemToPlay;
playerStatusObj.currentMediaItem.mediaItemId;
playerStatusObj.currentMediaItem.mediaItemInfoObject.itemTitle;
playerStatusObj.currentMediaItem.mediaItemInfoObject.itemAuthor;
playerStatusObj.currentMediaItem.mediaItemInfoObject.itemYear;
playerStatusObj.currentMediaItem.mediaItemInfoObject.thumbUrl;


PLAYER_ADDED_TO_STAGE

No properties

PLAYER_REMOVED_FROM_STAGE

No properties

STREAM_STATUS

streamStatus.totalBytes;
streamStatus.totalLoadedBytes;
streamStatus.optimalSpeed;
streamStatus.currentSpeed;
streamStatus.bytesLeft;
streamStatus.timeLeft;
streamStatus.dynamicLoadPercentLimit;
streamStatus.safePercent;
streamStatus.forcedPercent;
streamStatus.loadedPercents;

ON_CUE_POINT

info.time;
info.name;
info.type;

ON_META_DATA

metaDataObj;


CONSTRUCTOR

No properties

© 2009 SupravisionMedia. All rights reserved.