| Package | org.openvideoplayer.net |
| Class | public class OvpConnection |
| Inheritance | OvpConnection flash.events.EventDispatcher |
| Implements | INetConnection |
| Subclasses | AkamaiConnection |
| Property | Defined By | ||
|---|---|---|---|
| actualPort : String [read-only]
The port on which the class has connected. | OvpConnection | ||
| actualProtocol : String [read-only]
The protocol over which the class has connected. | OvpConnection | ||
| appNameInstanceName : String [read-only]
The last appName/instanceName used by the class. | OvpConnection | ||
| attemptInterval : uint
The connection attempt interval when trying multiple ports and protocols. | OvpConnection | ||
| cacheable : Boolean
True if connections can be cached and re-used, false otherwise. | OvpConnection | ||
| connected : Boolean [read-only]
Indicates whether the application is connected to a server through a persistent RTMP connection (true) or not (false). | OvpConnection | ||
| connectedProxyType : String [read-only]
If a successful connection is made, indicates the method that was used to make it: a direct connection, the CONNECT method, or HTTP tunneling. | OvpConnection | ||
| defaultObjectEncoding : uint
The default object encoding for NetConnection objects. | OvpConnection | ||
| hostName : String [read-only]
The last hostName used by the class. | OvpConnection | ||
| isProgressive : Boolean [read-only]
Informs whether the current connection is progressive or not. | OvpConnection | ||
| netConnection : NetConnection [read-only]
Returns a reference to the active NetConnection object. | OvpConnection | ||
| objectEncoding : uint
The object encoding for this NetConnection instance. | OvpConnection | ||
| proxyType : String
A reference to the prototype object of a class or function object. | OvpConnection | ||
| requestedPort : String
The port(s) over which the class may attempt to connect. | OvpConnection | ||
| requestedProtocol : String
The protocol(s) over which the class was originally requested to connect via the requestedProtocol property. | OvpConnection | ||
| timeout : Number The server connection timeout in milliseconds. | OvpConnection | ||
| uri : String [read-only]
The URI passed to the NetConnection.connect() method. | OvpConnection | ||
| usingTLS : Boolean [read-only]
Indicates whether a secure connection was made using native Transport Layer Security (TLS) rather than HTTPS. | OvpConnection | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor
| OvpConnection | ||
addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):void
Adds a context header to the Action Message Format (AMF) packet structure. | OvpConnection | ||
call(command:String, responder:Responder, ... arguments):void
Invokes a command or method on Flash Media Server or on an application server running Flash Remoting. | OvpConnection | ||
close():void
Closes the connection that was opened locally or to the server and dispatches a netStatus event with a code property of NetConnection.Connect.Closed. | OvpConnection | ||
connect(command:String, ... arguments):void
The connect method initiates a connection to either a streaming service or a progressive
link to a HTTP server. | OvpConnection | ||
detectBandwidth():Boolean
Initiates a new bandwidth measurement. | OvpConnection | ||
reconnect():void
Attempts to establish a connection based on the arguments passed to the connect method. | OvpConnection | ||
requestStreamLength(filename:String):Boolean
Initiates the server request to measure the stream length of a file. | OvpConnection | ||
serverVersion(info:Object):String
Returns the server version if detectable. | OvpConnection | ||
streamLengthAsTimeCode(value:Number):String
Returns the given stream length (duration) in timecode HH:MM:SS format. | OvpConnection | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| See the INetConnection interface for information on this event. | OvpConnection | |||
| Dispatched when a bandwidth estimate is complete. | OvpConnection | |||
| Dispatched when an OVP error condition has occurred. | OvpConnection | |||
| See the INetConnection interface for information on this event. | OvpConnection | |||
| See the INetConnection interface for information on this event. | OvpConnection | |||
| See the INetConnection interface for information on this event. | OvpConnection | |||
| Dispatched when a stream length request is complete. | OvpConnection | |||
| actualPort | property |
actualPort:String [read-only] The port on which the class has connected. This parameter will only be returned if the class has managed to successfully connect to the server. Possible port values are "1935", "443", and "80". This property differs from requestedPort since it returns the port that was actually used and not the port combination that was requested.
This property is not available with progressive playback. public function get actualPort():StringSee also
| actualProtocol | property |
actualProtocol:String [read-only] The protocol over which the class has connected. This parameter will only be returned if the class has managed to successfully connect to the server. Possible protocol values are "rtmp","rtmpt","rtmpe" or "rtmpte". This property will differ from requestedProtocol if the requestedProtocol value was "any", in which case this property will return the protocol that was actually used.
This property is not available with progressive playback. public function get actualProtocol():StringSee also
| appNameInstanceName | property |
appNameInstanceName:String [read-only] The last appName/instanceName used by the class.
public function get appNameInstanceName():String| attemptInterval | property |
attemptInterval:uintThe connection attempt interval when trying multiple ports and protocols. If connection authentication parameters are set from a derived class instance, 150 milliseconds will be added to ensure the server has enough time to process the auth information.
public function get attemptInterval():uint public function set attemptInterval(value:uint):void| cacheable | property |
cacheable:BooleanTrue if connections can be cached and re-used, false otherwise.
public function get cacheable():Boolean public function set cacheable(value:Boolean):void| connected | property |
connected:Boolean [read-only] Indicates whether the application is connected to a server through a persistent RTMP connection (true) or not (false).
public function get connected():Boolean| connectedProxyType | property |
connectedProxyType:String [read-only] If a successful connection is made, indicates the method that was used to make it: a direct connection, the CONNECT method, or HTTP tunneling.
public function get connectedProxyType():String| defaultObjectEncoding | property |
defaultObjectEncoding:uintThe default object encoding for NetConnection objects.
public function get defaultObjectEncoding():uint public function set defaultObjectEncoding(value:uint):void| hostName | property |
hostName:String [read-only]
The last hostName used by the class. If the hostName was sent in the connect method
concatenated with the application name (for example connect("cpxxxx.edgefcs.net/myappalias"))
then this method will only return "cpxxxx.edgefcs.net". Use the appNameInstanceName
property to retrieve the application name.
public function get hostName():StringSee also
| isProgressive | property |
isProgressive:Boolean [read-only] Informs whether the current connection is progressive or not.
public function get isProgressive():BooleanSee also
| netConnection | property |
netConnection:NetConnection [read-only] Returns a reference to the active NetConnection object. This property will only return a valid reference if the connection was successful.
public function get netConnection():NetConnection| objectEncoding | property |
objectEncoding:uintThe object encoding for this NetConnection instance.
public function get objectEncoding():uint public function set objectEncoding(value:uint):void| proxyType | property |
proxyType:StringA reference to the prototype object of a class or function object.
public function get proxyType():String public function set proxyType(value:String):void| requestedPort | property |
requestedPort:StringThe port(s) over which the class may attempt to connect. These combinations are specified as a single string of ports separated by a delimiter. Possible requested port values are "any", "1935", "443" and "80", or any combination of these values, separated by the ',' delimiter. "any" is a reserved word meaning that the class should attempt all of the ports which the target network supports. Valid examples include "1935,80", "443,80" etc. The order in which the ports are specified is the order in which the connection attempts are made. All the ports for the first protocol (as specified by requestedProtocol) are attempted, followed by all the ports for the second protocol etc. For example, if requestedPort was set to "1935,80" and requestedProtocol to "rtmpt,rtmpe", then the connection attempt sequence would be:
The default value is "any".
public function get requestedPort():String public function set requestedPort(value:String):voidSee also
| requestedProtocol | property |
requestedProtocol:String
The protocol(s) over which the class was originally requested to connect via the requestedProtocol property.
These combinations are specified as a single string of protocols separated by a delimiter.
Possible requested protocol values are "any", "rtmp","rtmpt","rtmpe" or "rtmpte", or
any combination of these values, separated by the ',' delimiter. "any" is a reserved word meaning that the
class should attempt all of the protocols which the target network supports. Valid examples include
"rtmpt,rtmp", "rtmpe,rtmpte" etc. The order in which the protocols are specified is the order in which the connection
attempts are made. This property will differ from actualProtocol if the requestedProtocol value was "any", in which case actualProtocol
will return the protocol that was actually used. The order in which the protocols are specified is the order in which the connection
attempts are made. All the ports (as specified by requestedPort) for the first protocol are attempted,
followed by all the ports for the second protocol etc. For example, if requestedPort was set to "1935,80" and requestedProtocol
to "rtmpt,rtmpe", then the connection attempt sequence would be:
The default value is "any".
public function get requestedProtocol():String public function set requestedProtocol(value:String):voidSee also
| timeout | property |
timeout:NumberThe server connection timeout in milliseconds. If a successful connection has not been established within this time period, an OvpEvent.TIMEOUT will be dispatched.
public function get timeout():Number public function set timeout(value:Number):void| uri | property |
uri:String [read-only] The URI passed to the NetConnection.connect() method.
public function get uri():String| usingTLS | property |
usingTLS:Boolean [read-only] Indicates whether a secure connection was made using native Transport Layer Security (TLS) rather than HTTPS.
public function get usingTLS():Boolean| OvpConnection | () | Constructor |
public function OvpConnection()Constructor
| addHeader | () | method |
public function addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):voidAdds a context header to the Action Message Format (AMF) packet structure.
Parameters
operation:String | |
mustUnderstand:Boolean (default = false) | |
param:Object (default = null) |
| call | () | method |
public function call(command:String, responder:Responder, ... arguments):voidInvokes a command or method on Flash Media Server or on an application server running Flash Remoting.
Parameters
command:String | |
responder:Responder | |
... arguments |
| close | () | method |
public function close():voidCloses the connection that was opened locally or to the server and dispatches a netStatus event with a code property of NetConnection.Connect.Closed.
| connect | () | method |
public function connect(command:String, ... arguments):void
The connect method initiates a connection to either a streaming service or a progressive
link to a HTTP server. A progressive connection is requested by passing
the null object, or the string "null". All other strings
are treated as requests for a streaming connection.
Parameters
command:String — A string containing hostname/appname/instance
| |
... arguments |
| detectBandwidth | () | method |
public function detectBandwidth():Boolean
Initiates a new bandwidth measurement.
To recover the estimated bandwidth value, wait for the OvpEvent.BANDWIDTH event and then inspect
the data.bandwidth property.
Boolean — true if the connection has been established, otherwise false.
|
See also
| reconnect | () | method |
public function reconnect():voidAttempts to establish a connection based on the arguments passed to the connect method.
| requestStreamLength | () | method |
public function requestStreamLength(filename:String):Boolean
Initiates the server request to measure the stream length of a file. Since this measurement is an asynchronous
process, the stream length value can retrieved using the data property of the OvpEvent object, i.e., event.data.streamLength.
Note the name of the file being measured is decoupled from the file being played, meaning you can request the
length of one file while playing another.
Parameters
filename:String — The name of the streaming file for which length is to be requested.
|
Boolean — true if the connection has been established, otherwise false.
|
See also
| serverVersion | () | method |
public function serverVersion(info:Object):StringReturns the server version if detectable.
Parameters
info:Object — An object that, upon return, will contain the major, minor, sub-minor and build information as
integers for ease of making comparisons. If the server version is not available, these values will be zero.
|
String — the server version as a string "major, minor, sub-minor, build", i.e., "3,5,0,1234"
|
| streamLengthAsTimeCode | () | method |
public function streamLengthAsTimeCode(value:Number):StringReturns the given stream length (duration) in timecode HH:MM:SS format.
Parameters
value:Number |
String — the length as timecode HH:MM:SS
|
| asyncError | Event |
flash.events.AsyncErrorEvent.ASYNC_ERRORSee the INetConnection interface for information on this event.
See also
| bandwidth | Event |
org.openvideoplayer.events.OpvEvent.BANDWIDTHDispatched when a bandwidth estimate is complete.
See also
| error | Event |
org.openvideoplayer.events.OpvEvent.ERRORDispatched when an OVP error condition has occurred. The OvpEvent object contains a data property. The contents of the data property will contain the error number and a description.
See also
| ioError | Event |
flash.events.IOErrorEvent.IO_ERRORSee the INetConnection interface for information on this event.
See also
| netStatus | Event |
flash.events.NetStatusEvent.NET_STATUSSee the INetConnection interface for information on this event.
See also
| securityError | Event |
flash.events.SecurityErrorEvent.SECURITY_ERRORSee the INetConnection interface for information on this event.
See also
| streamlength | Event |
org.openvideoplayer.events.OpvEvent.STREAMLENGTHDispatched when a stream length request is complete.
See also