| 1 | package com.longtailvideo.jwplayer.player { |
|---|
| 2 | import com.longtailvideo.jwplayer.events.IGlobalEventDispatcher; |
|---|
| 3 | import com.longtailvideo.jwplayer.model.IInstreamOptions; |
|---|
| 4 | import com.longtailvideo.jwplayer.model.IPlaylist; |
|---|
| 5 | import com.longtailvideo.jwplayer.model.PlayerConfig; |
|---|
| 6 | import com.longtailvideo.jwplayer.model.PlaylistItem; |
|---|
| 7 | import com.longtailvideo.jwplayer.plugins.IPlugin; |
|---|
| 8 | import com.longtailvideo.jwplayer.view.IPlayerComponents; |
|---|
| 9 | import com.longtailvideo.jwplayer.view.interfaces.IPlayerComponent; |
|---|
| 10 | import com.longtailvideo.jwplayer.view.interfaces.ISkin; |
|---|
| 11 | |
|---|
| 12 | import flash.events.IEventDispatcher; |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | /** |
|---|
| 16 | * Interface for JW Flash Media Player |
|---|
| 17 | * |
|---|
| 18 | * @author Zachary Ozer |
|---|
| 19 | */ |
|---|
| 20 | public interface IPlayer extends IEventDispatcher, IGlobalEventDispatcher { |
|---|
| 21 | /** |
|---|
| 22 | * The player's current configuration |
|---|
| 23 | */ |
|---|
| 24 | function get config():PlayerConfig; |
|---|
| 25 | /** |
|---|
| 26 | * Player version getter |
|---|
| 27 | */ |
|---|
| 28 | function get version():String; |
|---|
| 29 | /** |
|---|
| 30 | * Reference to player's skin. If no skin has been loaded, returns null. |
|---|
| 31 | */ |
|---|
| 32 | function get skin():ISkin; |
|---|
| 33 | /** |
|---|
| 34 | * The current player state |
|---|
| 35 | */ |
|---|
| 36 | function get state():String; |
|---|
| 37 | /** |
|---|
| 38 | * The player's playlist |
|---|
| 39 | */ |
|---|
| 40 | function get playlist():IPlaylist; |
|---|
| 41 | /** |
|---|
| 42 | * Set to true when the player is in a locked state. |
|---|
| 43 | */ |
|---|
| 44 | function get locked():Boolean; |
|---|
| 45 | /** |
|---|
| 46 | * Request that the player enter the locked state. When the Player is locked, the currently playing stream is |
|---|
| 47 | * paused, and no new playback-related commands will be honored until <code>unlock</code> is |
|---|
| 48 | * called. |
|---|
| 49 | * |
|---|
| 50 | * @param target Reference to plugin requesting the player lock |
|---|
| 51 | * @param callback The function to be executed once a lock is aquired. |
|---|
| 52 | */ |
|---|
| 53 | function lock(target:IPlugin, callback:Function):void; |
|---|
| 54 | /** |
|---|
| 55 | * Unlocks the player. If the player was buffering or playing when it was locked, playback will resume. |
|---|
| 56 | * |
|---|
| 57 | * @param target Reference to the requesting plugin. |
|---|
| 58 | * @return <code>true</code>, if <code>target</code> had previously requested player locking. |
|---|
| 59 | * |
|---|
| 60 | */ |
|---|
| 61 | function unlock(target:IPlugin):Boolean; |
|---|
| 62 | function volume(volume:Number):Boolean; |
|---|
| 63 | function mute(state:Boolean):void; |
|---|
| 64 | function play():Boolean; |
|---|
| 65 | function pause():Boolean; |
|---|
| 66 | function stop():Boolean; |
|---|
| 67 | function seek(position:Number):Boolean; |
|---|
| 68 | function load(item:*):Boolean; |
|---|
| 69 | function playlistItem(index:Number):Boolean; |
|---|
| 70 | function playlistNext():Boolean; |
|---|
| 71 | function playlistPrev():Boolean; |
|---|
| 72 | /** Force a redraw of the player **/ |
|---|
| 73 | function redraw():Boolean; |
|---|
| 74 | function fullscreen(on:Boolean):void; |
|---|
| 75 | function get controls():IPlayerComponents; |
|---|
| 76 | function overrideComponent(plugin:IPlayerComponent):void; |
|---|
| 77 | function loadInstream(target:IPlugin, item:PlaylistItem, options:IInstreamOptions=null):IInstreamPlayer; |
|---|
| 78 | } |
|---|
| 79 | } |
|---|