AkamaiMediaSprite is a display component which simplifies the process of robustly playing back Akamai HDN 1 content and RTMP content
from the Akamai network.
NOTE: As of HDCore 3.0, HDS (HTTP Dynamic Streaming) is no longer supported by this class.
The AkamaiMediaSprite class abstracts away the differences in the formats and accepts a string resource as the only required input.
Type detection is performed automatically. The class makes available the underlying OvpConnection and NetStream to facilitate integration
with control components. The video stream is scaled to automatically fit within the component, preserving its aspect ratio.
View the examples
autoStart:Boolean
Sets playback to start automatically once a resource is loaded.
Implementation public function get autoStart():Boolean
public function set autoStart(value:Boolean):void
duration:Number
[read-only]
Returns the duration of the media in seconds.
Implementation public function get duration():Number
enableAlternateServerMapping:Boolean
Implementation public function get enableAlternateServerMapping():Boolean
public function set enableAlternateServerMapping(value:Boolean):void
HDPrimaryToken:String
Primary token used to connect to Akamai HD 1.0 Streams.
Implementation public function get HDPrimaryToken():String
public function set HDPrimaryToken(value:String):void
netStream:NetStream
[read-only]
The NetStream instance being used to render the video. This will be either an AkamaiHDNetstream
or an AkamaiDynamicNetStream, depending on whether the resource points at Akamai HDN content or FMS MBR content.
You may cast it appropriately to extract methods and properties that may be particular to each NetStream type.
This property can only be accessed after the resource has been successfully loaded.
Implementation public function get netStream():NetStream
ovpConnection:OvpConnection
[read-only]
The OvpConnection instance being used to render the video. To access the actual NetConnection, should you need it,
you may use ovpConnection.netConnection. This property can only be accessed
after the resource has been successfully loaded.
Implementation public function get ovpConnection():OvpConnection
rtmpConnectionAuth:String
The connection level auth token for playing secure RTMP VOD streams over Akamai.
Implementation public function get rtmpConnectionAuth():String
public function set rtmpConnectionAuth(value:String):void
rtmpStreamAuth:String
The stream level auth token for playing secure RTMP live streams over Akamai.
Implementation public function get rtmpStreamAuth():String
public function set rtmpStreamAuth(value:String):void
time:Number
[read-only]
Implementation public function get time():Number
video:Video
[read-only]
The Video class instance being used to render the video.
Implementation public function get video():Video
public function AkamaiMediaSprite(width:Number = 320, height:Number = 180)
Constructor. The desired width and height of the component should be passed in as arguments.
Parameters | width:Number (default = 320 ) — the width of the component in pixels
|
|
| height:Number (default = 180 ) — the height of the component in pixels
|
public function closeAndDestroy():void
public function load(source:String, clipStartTime:Number, clipEndTime:Number):void
Initiates playback by accepting a string resource to any Akamai video resource, including MBR SMIL files
and SBR streams across the HDN and RTMP networks. If autoStart is true (which is the default behavior), then
the stream will also begin playing the moment it is loaded. Once the content is loaded, meaning the relevant NetConnection
and NetStream have been established, then the OvpEvent.LOADED will be dispatched.
Parameters
| source:String — the string resource that points at the video content
|
|
| clipStartTime:Number (default = NaN ) — of the media in seconds
|
|
| clipEndTime:Number (default = NaN ) — of the media in seconds
|
See also
public function start():Boolean
Starts the playback of a resource that has been preivously loaded. If auotStart is true then this method will
be called automatically by the class once the resource is loaded.
ReturnsSee also
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Dispatched when the class has debug information. Note that debug dmessages from the underlying netStreams
are also bubbled up.
Event Object Type: org.openvideoplayer.events.OvpEvent
Dispatched when the class encounters a fatal error. The data property
in this case will contain an error string.
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Dispatched when the class has completed initializing the relevant NetConnection and NetStream objects
for the resource.
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Event Object Type: org.openvideoplayer.events.OvpEvent
Example usage:
var player:AkamaiMediaSprite = new AkamaiMediaSprite(640,360);
player.addEventListener(OvpEvent.LOADED,onLoaded);
player.addEventListener(OvpEvent.ERROR,onError);
addChild(player);
player.load("http://mediapm.edgesuite.net/edgeflash/public/debug/assets/smil/earth2.smil");
private function onLoaded(event:OvpEvent):void
{
// You can access the underlying NetStream here in order to set listeners and apply control
// commands such as seek(), pause() and resume().
var netStream:NetStream = player.netStream;
// You can access the underlying OvpConnection object here in order to set listeners or call
// server side methods.
var ovpConnection:OvpConnection = player.ovpConnection;
}
private function onError(event:OvpEvent):void
{
trace("the loader encountered a fatal error: " + (event.data as String));
}
Fri May 6 2016, 10:06 AM +05:30