flash.net

# NetStreamPlayTransitions - AS3

Package | flash.net
Class | public class NetStreamPlayTransitions
Inheritance | NetStreamPlayTransitions Object

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

NetStreamPlayOptions
NetStream.play2()

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants

| Constant | Defined By
--- | --- | ---
|  | APPEND : String = "append" [static] Adds the stream to a playlist and begins playback with the first stream. | NetStreamPlayTransitions
|  | APPEND_AND_WAIT : String = "appendAndWait" [static] Builds a playlist without starting to play it from the first stream. | NetStreamPlayTransitions
|  | RESET : String = "reset" [static] Clears any previous play calls and plays the specified stream immediately. | NetStreamPlayTransitions
|  | RESUME : String = "resume" [static] Requests data from the new connection starting from the point at which the previous connection ended. | NetStreamPlayTransitions
|  | STOP : String = "stop" [static] Stops playing the streams in a playlist. | NetStreamPlayTransitions
|  | SWAP : String = "swap" [static] Replaces a content stream with a different content stream and maintains the rest of the playlist. | NetStreamPlayTransitions
|  | SWITCH : String = "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:String = "append"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

Adds the stream to a playlist and begins playback with the first stream. 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.

Related API Elements

APPEND_AND_WAIT
NetStream.play()
NetStream.play2()
NetStreamPlayOptions.oldStreamName
NetStreamPlayOptions.streamName

### APPEND_AND_WAIT

Constant

`public static const APPEND_AND_WAIT:String = "appendAndWait"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10.1, AIR 2, Flash Lite 4

Builds a playlist without starting to play it from the first stream.

The `APPEND_AND_WAIT` transition mode is used with the `NetStream.play2()` method to build a playlist without immediately starting to play it from the first stream. Use this mode to load each item in the playlist except the last one. When you load the last stream in the playlist, set the transition mode to `RESUME`. At this point, Flash Player begins to stream and play the playlist.

You can use this mode to build a playlist from scratch, or to rebuild a playlist after a lost connection is recovered. For a new playlist, when `NetStream.play2()` is called with `RESUME`, Flash Player begins streaming and playing from the first stream, or from the start position specified. To recover from a lost connection, when you call the `NetStream.play2()` method with `RESUME`, Flash Player determines where the stream was interrupted and instructs the server to start streaming from that location. The server in turn is able to determine which stream in the playlist corresponds to that location, and starts streaming from that location.

This transition mode is in contrast to the `APPEND` mode, where playback starts immediately with the first stream.

Related API Elements

APPEND
RESUME
NetStream.play2()

### RESET

Constant

`public static const RESET:String = "reset"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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.

Related API Elements

NetStream.play()
NetStream.play2()
NetStreamPlayOptions.oldStreamName
NetStreamPlayOptions.streamName

### RESUME

Constant

`public static const RESUME:String = "resume"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10.1, AIR 2, Flash Lite 4

Requests data from the new connection starting from the point at which the previous connection ended. The `RESUME` mode aligns the stream across the two connections so no artifacts or jumps are observed in the video playback. Use this mode when you reconnect a stream that was dropped due to server issues or other connection problems.

Related API Elements

APPEND_AND_WAIT
NetStream.play2()

### STOP

Constant

`public static const STOP:String = "stop"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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

Related API Elements

NetStream.play()
NetStream.play2()

### SWAP

Constant

`public static const SWAP:String = "swap"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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

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 doesn't switch to `streamName`, and a `NetStream.Play.Failed` event is sent.

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

To switch from one stream to another with the same content, use the `SWITCH` mode instead.

Related API Elements

SWITCH
NetStreamPlayOptions.oldStreamName
NetStreamPlayOptions.streamName

### SWITCH

Constant

`public static const SWITCH:String = "switch"`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 10, AIR 1.5, Flash Lite 4

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 `SWAP` mode instead.

Related API Elements

SWAP
NetStreamPlayOptions.oldStreamName
NetStreamPlayOptions.streamName

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00