Class: Player

Player()

new Player()

Properties:
Name Type Description
sourceURL string The url of the video to play
source string The url of the video to play
defaultRate Object The default value of playing rate
type string The type of the video, such as HLS
rateList Array.<Object> The rate list of the player
processURL function process the url of video source
maxBufferLength Number The maximum value of the buffer, its default value is 5000(ms)
autoPlay Boolean If auto play after initializing the Player
libPath string The path of decoder
preload Boolean If pre load video before playing
startTime Number Start time to play the video
playbackRate string Playback speed
controlBarHeight Number The height of the control bar
alertError AlertError The alert info when error happens
httpWorker Worker set User's web worker
afterLoadPlaylist function To handle operations after playlist is loaded
Source:
Example

Example of rateList.

// let options = {
       rateList:[
           {"url":"http://localhost/20190902/01/a5/029f8fad8868a7116f20d8ae5b075996.m3u8","id":51,"name":"720P","value":"720"},
           {"url":"http://localhost/20190902/f0/db/ee545466ced38973a9d60fe7f24ed409.m3u8","id":51,"name":"高清","value":"600"},
           {"url":"http://localhost/20190902/78/6c/5a5a99476f4f792e2e7a701ba1f6d5ad.m3u8","id":264,"name":"极速","value":"jisu"},
           {"url":"http://localhost/20190902/54/05/7e714a321d9e7d92c937582b2e439833.m3u8","id":265,"name":"流畅","value":"300"}]
       }

Events

end

Event handling after playing ends
Type:
Source:

pause

Event handling when playing pauses
Type:
Source:

play

Event handling during player playing
Type:
Source:

seeking

Event handling when player seeking data
Type:
Source: