Class wink.mm.VideoPlayer
Implements a video player An video player based on the HTML5 video tag The video player can take several parameters. It takes at least a video file url but it can also take various parameters to change the player look and behaviour. Use the getDomNode method to add the player to the page
- Defined in: videoplayer.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
wink.mm.VideoPlayer(properties)
|
| Compatibility list | Supported platforms / browsers |
|---|---|
|
Ipad, BlackBerry 7
|
Method Summary
Class Detail
wink.mm.VideoPlayer(properties)
var properties =
{
source:
{
type: 'file',
url: '../files/video.mp4',
height: 270,
width: 480,
poster: './img/myPoster.jpg'
},
customControls: 1,
displayControls: 1,
displayDuration: 1,
displayCursor: 1,
silentSeeking: 1
};
videoPlayer = new wink.mm.VideoPlayer(properties);
wink.byId('video').appendChild(videoPlayer.getDomNode());
- Parameters:
- {object} properties
- The properties object
- {object} properties.source
- The info about the audio file
- {string} properties.source.type
- Either 'stream' or 'file'
- {string} properties.source.url
- The url of the video file to load
- {integer} properties.source.height
- The height in pixels of the video to display
- {integer} properties.source.width
- The width in pixels of the video to display
- {string} properties.source.poster
- The url of the image to display before playing the video
- {integer} properties.customControls Optional, Default: 1
- Specify if the player should display the native controls or the custom controls
- {integer} properties.displayControls Optional, Default: 1
- Display the play/pause button
- {integer} properties.displayDuration Optional, Default: 1
- Display the time left and the duration of the file
- {integer} properties.displayCursor Optional, Default: 1
- Display the cursor
- {integer} properties.silentSeeking Optional, Default: 1
- The audio is stopped while the cursor is moved
- See:
- Test page
Field Detail
{integer}
customControls
Whether the native controls or the custom controls are displayed
- Default Value:
- 1
{integer}
displayControls
Whether the buttons of the player are displayed or not
- Default Value:
- 1
{integer}
displayCursor
Whether the progress bar cursor is displayed or not
- Default Value:
- 1
{integer}
displayDuration
Whether the duration of the audio file is displayed or not
- Default Value:
- 1
{integer}
silentSeeking
Stops the audio while moving the cursor
- Default Value:
- 1
{object}
source
The current audio source
{string}
state
The current state of the player ("play" or "pause")
{integer}
uId
Unique identifier
Method Detail
-
changeSource(type, url, height, width, poster)Change the current video source
- Parameters:
- {string} type
- Either 'file' or 'stream'
- {string} url
- The file to be played (absolute or relative path)
- {nmuber} height Optional
- The height of the video
- {number} width Optional
- The width of the video
- {string} poster Optional
- The image to display before playing the video
-
forward(seconds)Change the current video time
- Parameters:
- {number} seconds
- The number of seconds to change (+: forward ; -: rewind)
-
{HTMLElement} getDomNode()Return the dom node containing the video player
- Returns:
- {HTMLElement} The main dom node
-
pause()Stop the current video file play
-
play()Start playing the current video file
Event Detail
/videoplayer/events/pause
The event is fired when pause is called
/videoplayer/events/play
The event is fired when play is called