Namespace: media

media

Provides a simple way to play media in a variety of environments and operating systems.

Classes

Audio
ErrorOccurredEvent
FullScreenStatusChangedEvent
InvalidMediaTypeError
LoadProgressEvent
MediaIsLiveStreamError
MediaItem
MediaSource
MediaTypeDetectionFailedError
PlaybackPausedEvent
PlaybackResumedEvent
PlaybackStartedEvent
PlaybackStoppedEvent
PositionChangedEvent
SourceChangedEvent
Video
VolumeChangedEvent

Namespaces

timedText
ui

Members

<static, constant> AudioType :string

Constants for audio types. To prevent confusion with mime types the values must not contain a forward slash ("/").
Properties:
Name Type Default Description
MP3 string audio-mp3 Mp3 audio
WEBM string audio-webm WebM audio
WMA string audio-wma Wma audio
WAV string audio-wav Wav audio
OGG string audio-ogg Ogg audio
AAC string audio-aac Aac audio
UNKNOWN string sometechie.media.MediaType.UNKNOWN

<static> ErrorType :string

Constants for error types that can occur in the media player.
Properties:
Name Type Default Description
REQUIRES_USER_CLICK string requiresUserClick The current media service provider requires the user to click on the play button. For example, iOS requires the playback to be triggered by user interaction. See User Control of Downloads Over Cellular Networks
SERVICE_PROVIDER_ERROR string serviceProviderError There has been an unexpected error in the media service provider. It may have thought it could play but was unable to.
DATA_ENDED string dataEnded The media data ended unexpectedly.
SOURCE_ERROR string sourceError There is a problem with the source. The server might have been down or returned a 404 error.
PLAY_FAILED string playFailed All media service providers failed to play the media source. If multiple sources were specified, the player will attempt to play others.
CANT_PLAY_ITEM string cantPlayItem None of the media service providers were able to play any of the sources.
UNKNOWN_ERROR string unknownError An unknown error has occurred.

<static> EventType :string

Constants for event types that can be dispatched by the media player.
Properties:
Name Type Default Description
PLAYBACK_STARTED string CALL Dispatched when the player starts playing. See sometechie.media.PlaybackStartedEvent.
PLAYBACK_STOPPED string CALL Dispatched when the player stops playing. See sometechie.media.PlaybackStoppedEvent.
PLAYBACK_PAUSED string CALL Dispatched when playback is paused. See sometechie.media.PlaybackPausedEvent.
PLAYBACK_RESUMED string CALL Dispatched when playback is resumed. See sometechie.media.PlaybackResumedEvent.
VOLUME_CHANGED string CALL Dispatched when the volume is changed. See sometechie.media.VolumeChangedEvent.
SOURCE_CHANGED string CALL Dispatched when the media source changes. See sometechie.media.SourceChangedEvent.
LOAD_PROGRESS string CALL Dispatched when the loading of the media progresses. See sometechie.media.LoadProgressEvent.
POSITION_CHANGED string CALL Dispatched when the position of the media playback changes. See sometechie.media.PositionChangedEvent.
ERROR_OCCURRED string CALL Dispatched when an error occurs. See sometechie.media.ErrorOccurredEvent.
FULL_SCREEN_STATUS_CHANGED string CALL Dispatched when the video player enters or leaves full screen mode. See sometechie.media.FullScreenStatusChangedEvent.

<static, constant> MediaType :string

Constants for media types. To prevent confusion with mime types the values must not contain a forward slash ("/").
See:

<static> PlayerState :string

Constants for states that the media player can be in.
Properties:
Name Type Default Description
NEW string new The player has just been created and has not been told to do anything yet.
PREPARING string preparing The curent media service provider is initializing. The player is able to accept requests in this stat, and will hold them until the service provider is ready.
PREPARED string prepared The media service provider has initialized and can accept requests. Requests to start playback should take effect immediately.
PLAYING string playing The player is now playing the media. See sometechie.media.PlaybackStartedEvent.
PAUSED string paused Playback is paused and can be resumed using .resume, which will cause playback to resume where it left off. See sometechie.media.PlaybackPausedEvent.
STOPPED string stopped Playback has been stopped, but can be restarted at the beginning calling play function. See sometechie.media.PlaybackStoppedEvent.
FINISHED string finished The given media has been played to the end. See sometechie.media.PlaybackStoppedEvent.mediaComplete.
ERROR string error The player is in a state of error. No media is being played. This state can happen when the media fails to play, or there is a problem part way through. See sometechie.media.ErrorOccurredEvent

<static, constant> VideoType :string

Constants for video types. To prevent confusion with mime types the values must not contain a forward slash ("/").
Properties:
Name Type Default Description
MP4 string video-mp4 Mp4 video
OGG string video-ogg Ogg video
WEBM string video-webm WebM video
WMV string video-wmv Windows Media video
FLV string video-flv Flash video
UNKNOWN string sometechie.media.MediaType.UNKNOWN

Methods

<static> setAudioSwfPath

Set the audio player swf path.
Parameters:
Name Type Description
path string The path to the swf.

<static> setVideoSwfPath

Set the video player swf path.
Parameters:
Name Type Description
path string The path to the swf.