Skip to main content

Monitoring NetStream activity

You can monitor NetStream activity to collect the information required to support media usage analysis and reporting. The monitoring features discussed in this section allow you to create media measurement libraries that collect data without close coupling to the particular video player displaying the media. This allows your client developers to choose their favorite video players when using your library. Use the NetMonitor class to monitor the creation and activity of NetStream objects in an application. The NetMonitor class provides a list of the active NetStreams existing at any given time and also dispatches an event whenever a NetStream object is created.

A NetStream object dispatches the events listed in the following table, depending on the type of media being played:

EventProgressive downloadRTMP streamingHTTP streaming
NetStream.Play.StartYesYesNo
NetStream.Play.StopYesYesNo
NetStream.Play.CompleteYesYesNo
NetStream.SeekStart.NotifyYesYesYes
NetStream.Seek.NotifyYesYesYes
NetStream.Unpause.NotifyYesYesYes
NetStream.Unpause.NotifyYesYesYes
NetStream.Play.TransitionNot applicableYesNot applicable
NetStream.Play.TransitionCompleteNot applicableYesNot applicable
NetStream.Buffer.FullYesYesYes
NetStream.Buffer.FlushYesYesYes
NetStream.Buffer.EmptyYesYesYes

The NetStreamInfo object associated with a NetStream instance also stores the last metadata and XMP data objects that were encountered in the media.

When media is played via HTTP streaming, the NetStream.Play.Start, NetStream.Play.Stop, and NetStream.Play.Complete are not dispatched since the application has complete control of the media stream. A video player should synthesize and dispatch these events for HTTP streams.

Likewise, NetStream.Play.Transition and NetStream.Play.TransitionComplete are not dispatched for either progressive download or HTTP media. Dynamic bitrate switching is an RTMP feature. If a video player using an HTTP stream supports a similar feature, the player can synthesize and dispatch transition events.

More Help topics

Monitoring NetStream events

Detecting player domain

Adobe Developer Connection: Measuring video consumption in Flash