Package | com.akamai.hd |
Class | public class HDThumbnailGenerator |
Inheritance | HDThumbnailGenerator flash.events.EventDispatcher |
var tg:HDThumbnailGenerator = new HDThumbnailGenerator(); tg.addEventListener(HDEvent.THUMBNAIL_READY,onThumbReady); tg.createThumb("http://mediapm.edgesuite.net/edgeflash/public/debug/assets/smil/earth2.smil",160,90,57); function onThumbReady(event:HDEvent):void { addChild(event.data as BitMap); }
Method | Defined By | ||
---|---|---|---|
HDThumbnailGenerator(target:IEventDispatcher = null)
Constructor
| HDThumbnailGenerator | ||
captureImage(videoObj:Video, imageWidth:Number = 320, imageHeight:Number = 240):Bitmap [static]
Creates a screenshot from the Video object at a given size. | HDThumbnailGenerator | ||
createThumb(source:Object, width:Number = 160, height:Number = 90, time:Number = 3):void
Creates a thumbnail for a stream at a given size and offset
| HDThumbnailGenerator |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched if the class encounters an error while attempting to generate the thumbnail. | HDThumbnailGenerator | |||
Dispatched if the stream cannot be found. | HDThumbnailGenerator | |||
Dispatched once the thumbnail has been successfully created. | HDThumbnailGenerator |
HDThumbnailGenerator | () | Constructor |
public function HDThumbnailGenerator(target:IEventDispatcher = null)
Constructor
Parameterstarget:IEventDispatcher (default = null )
|
captureImage | () | method |
public static function captureImage(videoObj:Video, imageWidth:Number = 320, imageHeight:Number = 240):Bitmap
Creates a screenshot from the Video object at a given size. Supports HDN1 only.
Parameters
videoObj:Video — The flash.media.Video object used for displaying the stream.
| |
imageWidth:Number (default = 320 ) — The image width in pixels. Default is 320.
| |
imageHeight:Number (default = 240 ) — The image height in pixels. Default is 240.
|
Bitmap |
ArgumentError — if the Video object argument is null.
|
createThumb | () | method |
public function createThumb(source:Object, width:Number = 160, height:Number = 90, time:Number = 3):void
Creates a thumbnail for a stream at a given size and offset
Parameters
source:Object — the source file on which to generate the thumb. Can be a string reference to a SBR or MBR SMIL as well as an HDMBRObject instance.
| |
width:Number (default = 160 ) — the thumb with in pixels
| |
height:Number (default = 90 ) — the thumb height in pixels
| |
time:Number (default = 3 ) — the offset into the stream at which the thumb should be generated. Specified in seconds relative to the start of the stream.
|
error | Event |
com.akamai.hd.HDEvent
com.akamai.hd.HDEvent
Dispatched if the class encounters an error while attempting to generate the thumbnail.
Data object carries a description of the error as a String.streamnotfound | Event |
com.akamai.hd.HDEvent
com.akamai.hd.HDEvent
Dispatched if the stream cannot be found.
Data object is empty.thumbnailready | Event |
com.akamai.hd.HDEvent
com.akamai.hd.HDEvent
Dispatched once the thumbnail has been successfully created.
Data object carries the thumbnail as a Bitmap.