Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flash.net 
NetStreamPlayTransitions 
Packageflash.net
Classpublic class NetStreamPlayTransitions
InheritanceNetStreamPlayTransitions Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

The NetStreamPlayTransitions class specifies the valid strings that you can use with the NetStreamPlayOptions.transition property. These strings control the behavior that is used to transition to a new stream or to play a stream, depending on the transition mode that is used.

See also



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  APPEND : * = append
[static] Adds the stream to a playlist.
NetStreamPlayTransitions
  RESET : * = reset
[static] Clears any previous play calls and plays the specified stream immediately.
NetStreamPlayTransitions
  STOP : * = stop
[static] Stops playing the streams in a playlist.
NetStreamPlayTransitions
  SWAP : * = swap
[static] Replaces a content stream with a different content stream and maintains the rest of the playlist.
NetStreamPlayTransitions
  SWITCH : * = switch
[static] Switches from playing one stream to another stream, typically with streams of the same content.
NetStreamPlayTransitions
Constant Detail

APPEND

Constant
public static const APPEND:* = append

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds the stream to a playlist. This mode does the same thing as the NetStream.play() method with the reset flag set to false.

In this mode, Flash Media Server queues up the stream specified in NetStreamPlayOptions.streamName at the end of the playlist and ignores the NetStreamPlayOptions.oldStreamName parameter.

RESET

Constant 
public static const RESET:* = reset

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Clears any previous play calls and plays the specified stream immediately. This mode does the same thing as the NetStream.play() method with the reset flag set to true (the default behavior for NetStream.play()).

In this mode, the currently playing stream is flushed and the stream specified in NetStreamPlayOptions.streamName starts to play. The NetStreamPlayOptions.oldStreamName parameter is ignored.

STOP

Constant 
public static const STOP:* = stop

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Stops playing the streams in a playlist. This mode does the same thing as calling NetStream.play(false). It stops and resets the playlist.

SWAP

Constant 
public static const SWAP:* = swap

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Replaces a content stream with a different content stream and maintains the rest of the playlist.

Like SWITCH, this mode replaces the stream specified in NetStreamPlayOptions.oldStreamName with the stream specified in NetStreamPlayOptions.streamName. The rest of the playlist is maintained. In this mode, Flash Media Server does not make assumptions about the content of the streams and treats them like different content. If oldStreamName has not yet been sent, the server performs the switch at the stream boundary and sends the bits for streamName from the beginning. If the server has already started sending the bits for oldStreamName, it will not switch to streamName and dispatches a NetStream.Play.Failed event.

Use this mode if the streams you want to switch are not related to each other and have different content or lengths. One example is to swap one commercial for another based on user tracking and past commercial-viewing statistics.

SWITCH

Constant 
public static const SWITCH:* = switch

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Switches from playing one stream to another stream, typically with streams of the same content. Specify the streams to switch in NetStreamPlayOptions.oldStreamName and NetStreamPlayOptions.streamName.

Use this mode when you want to switch to a stream that has the same content but is encoded at a different bit rate or resolution. For example, use this mode when the application queues up streams in a playlist or is playing a single stream at a particular bit rate, then calculates that the bandwidth availability or the CPU capability is either lower or higher than the stream requirements. The application can then update the streams with their higher or lower bit rate versions.

In this mode, Flash Media Server makes certain assumptions about the relationship between the oldStreamName and streamName streams. The server assumes that the streams contain the same content and have the same keyframe interval but have different resolutions or bit rates.

When a playlist has been queued up and oldStreamName is one of the streams in the playlist or is currently playing, oldStreamName is replaced by streamName.

If oldStreamName is null or undefined, or if it is not found in the playlist, the server switches to streamName at the next logical point, to ensure a smooth switch.

To switch from one stream to another with different content, use the RESET mode instead.