View comments | RSS feed

NetStream.onPlayStatus

Availability

Usage

public onPlayStatus = function(infoObject:Object) {}

Parameters

infoObject An object containing an error or status message. For more information about this parameter, see NetStream information objects.

Returns

Nothing.

Description

Event handler; invoked when a NetStream object has completely played a stream. The information object gives extra information when a NetStream object has switched from one stream to another stream in a playlist (NetStream.Play.Switch) or when a NetStream object has played to the end (NetStream.Play.Complete). If you want to respond to this event handler, you must create a function to process the information object sent by the server. For more information, see Client-Side Information Objects.

Example

The following example displays data about the stream in the Output panel:

var connection_nc:NetConnection = new NetConnection(); connection_nc.connect(null); var stream_ns:NetStream = new NetStream(connection_nc); my_video.attachVideo(stream_ns); stream_ns.play("video1"); stream_ns.onPlayStatus = function(infoObject:Object) {
    trace("NetStream.onPlayStatus called: ("+getTimer()+" ms)");
    for (var prop in infoObject) {
        trace("\t"+prop+":\t"+infoObject[prop]);
    }
    trace("");
};

Comments


No screen name said on Feb 2, 2006 at 12:44 PM :
That code example at the bottom is formatted in a very unfriendly way. I hope it’s an error.
FlismFlazim said on Apr 5, 2006 at 4:19 PM :
I get this:
duration : 11
level : status
code : NetStream.Play.Complete
bytes : 1463583

what is duration: 11?

my ns.time at end is 14.645s - shouldn't duration match that?
HITdrumHARD said on Apr 25, 2007 at 4:16 PM :
I am guessing that ns.time is more closely related to the 'bytes' field. Is
that a bug?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/fms/2/docs/00000585.html