Streaming services API

getStreamLength()

getStreamLength(streamObj)

Returns the length of a stream, in seconds. Call this method from a client-side script and specify a response object to receive the returned value.

Availability

Flash Media Server 3, vod streaming service

Parameters

streamObj
A Stream object.

Returns

A number.

Example

The following client-side code gets the length of the sample_video stream and returns the value to returnObj:

nc.call("getStreamLength", returnObj, "sample_video"); 

getPageUrl()

getPageUrl()

Returns the URL of the web page in which the client SWF file is embedded. If the SWF file isn’t embedded in a web page, the value is the location of the SWF file. The following code shows the two examples:

// trace.swf file is embedded in trace.html. 
getPageUrl returns: http://www.example.com/trace.html 
 
// trace.swf is not embedded in an HTML file. 
getPageUrl returns: http://www.example.com/trace.swf

The value must be an HTTP address. For security reasons, local file address (for example, file:///C:/Flash Media Server applications/example.html) are not displayed.

Availability

Flash Media Server 3, vod streaming service, live streaming service

Example

The following example calls the getPageUrl() method on the server:
nc.call("getPageUrl", returnObj); 

getReferrer()

getReferrer()

Returns the URL of the SWF file or the server where the connection originated.

Availability

Flash Media Server 3, vod streaming service, live streaming service

Example

The following code calls the getReferrer() method on the server:

myNetConnection.call("getReferrer", returnObj);