AnyClip Players‎ > ‎

AnyClip Underdog Player



Embedding

You can embed the player using the AnyClip embed class or by using any other Flash player plug-in embedding methods such as swfobejct.

AnyClipPlayer Embed Class

<div id="container"></div>
<script src="http://player.anyclip.com/embed/AnyClipPlayer.js"></script>
<script>
var domID = '#container';
var flashvars = {clipID: 'WZsCt2tY2hbmmn', autoPlay: true};
AnyClipPlayer.load([domID, flashvars]);
</script>

swfobject Embed Code

<div id="container"></div>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script>
var playerURL = 'http://player.anyclip.com/AnyClipPlayer.swf';
var domID = 'container';
var width = '720';
var height = '360';
var swfVersion = '10.0.0';
var expInstallSWFurl = null;
var flashvars = {clipID: 'WZsCt2tY2hbmmn', autoPlay: true};
var parameters = {allowScriptAccess: 'always', allowFullScreen: true};
var attributes = {};
swfobject.embedSWF(playerURL, domID, width, height, swfVersion, expInstallSWFurl, flashvars, parameters, attributes);
</script>




Methods

loadClip

loadClip(id:String):void

Loads a new clip into the player based on the provided id.

Parameters
id:String - Clip code or other id that can be interpreted by the API.


unloadClip

unloadClip():void
Unloads the current clip in the player.

playClip

playClip():void
Starts playback or resumes the stream.

pauseClip

pauseClip():void
Pauses the stream.

seekTo

seekTo(milliseconds:Number):void
Seeks to a specific point in the stream.
Parameters

milliseconds:Number - Point in the stream to which you want to seek.


mute

mute():void
Mutes the volume.


unmute
unmute():void
Unmutes the volume.


setVolume

setVolume(volume:Number):void

Sets the volume.

Parameters

volume:Number - A decimal value between 0-1 where 0 is 0% and 100% volume.

getVolume
getVolume():Number
Returns 

A decimal value between 0-1 where 0 is 0% and 100% volume.


getClipPlayheadPosition

getClipPlayheadPosition():Number

Returns 

The current position of the playhead in the stream.


getTitlePlayheadPosition

getTitlePlayheadPosition():Number

Returns

The current time of the stream relative to the title of the clip.


getClipDuration

getClipDuration():Number

Returns 

The length of the stream.


getEmbedCode

getEmbedCode():String

Returns 

The embed code for the player with the current clip.


getClipID

getClipID():String

Returns 

String representing the id of the current clip.


getPlaylistIndex

getPlaylistIndex():Number

Returns 

Index of the current clip with in the playlist.


getCurrentPlaylistItem

getCurrentPlaylistItem():String

Returns 

String representing the id of the current item in the playlist.


addEventListener

addEventListener(event:String, listener:String):void

Registers a callback to a specific event.

removeEventListener

removeEventListener(event:String):void

Removes all registered callbacks to a specific event.


hasEventListener

hasEventListener(event:String):Boolean

Returns 

true if a callback is registered to the specific event, false if not.



Events

Once embedded you can listen to events that are dispatched from the player. To do this you will have to register to an event that the player dispatches. Before loading the player you must create  a method named anyclipPlayerReady which will be call on by the player once it’s external API is open. You can then use the addEventListener, removeEventListener or hasEventListener method to set, unset or check your listeners respectively.

streamStart

Dispatched when a stream starts playing. Could happen at the start of a stream or after an unpause or stop action.

streamPause

Dispatched when the stream is paused.

streamUnpause

Dispatched when the stream is unpaused.


streamSeek

Dispatched when the stream is seeking to a different time point.

streamComplete

Dispatched when the stream has reached its end.

error

Dispatched when an error occurs.

bof

Dispatched when the playlist reaches the beginning.

eof
Dispatched when the playlist reaches the end.

next

Dispatched when the next clip method is called.

prev

Dispatched when the previous clip method is called.

reset

Dispatched when the playlist is reset.

edit

Dispatched when the edit method is called.

edtiComplete

Dispatched when the edit method has completed and the new clip is loaded into the player.

editError

Dispatched when the edit method returns an error.
Comments