Indicates whether to enable CORS for http fetching
boolean
β
β
withCredentials
Indicates whether to do http fetching with cookies
boolean
β
β
hasAudio
Indicates whether the stream has audio track
boolean
β
β
hasVideo
Indicates whether the stream has video track
boolean
β
β
duration
Indicates total media duration, in milliseconds
number
β
β
filesize
Indicates total file size of media file, in bytes
number
β
β
url
Indicates media URL, can be starts with 'https(s)' or 'ws(s)' (WebSocket)
string
https(s) / ws(s)
β
segments
Optional field for multipart playback, see MediaSegment
Array
β
β
MediaSegment
Attribute
Type
Description
duration
number
Required field, indicates segment duration in milliseconds
filesize
number
Optional field, indicates segment file size in bytes
url
string
Required field, indicates segment file URL
Config
Attribute
Type
Default
Description
enableWorker?
boolean
false
Enable separated thread for transmuxing (unstable for now)
enableStashBuffer?
boolean
true
Enable IO stash buffer. Set to false if you need realtime (minimal latency) for live stream playback, but may stalled if there's network jittering.
stashInitialSize?
number
384KB
Indicates IO stash buffer initial size. Default is 384KB. Indicate a suitable size can improve video load/seek time.
isLive?
boolean
false
Same to isLive in MediaDataSource, ignored if has been set in MediaDataSource structure.
lazyLoad?
boolean
true
Abort the http connection if there's enough data for playback.
lazyLoadMaxDuration?
number
3 * 60
Indicates how many seconds of data to be kept for lazyLoad.
lazyLoadRecoverDuration?
number
30
Indicates the lazyLoad recover time boundary in seconds.
deferLoadAfterSourceOpen?
boolean
true
Do load after MediaSource sourceopen event triggered. On Chrome, tabs which be opened in background may not trigger sourceopen event until switched to that tab.
autoCleanupSourceBuffer
boolean
false
Do auto cleanup for SourceBuffer
autoCleanupMaxBackwardDuration
number
3 * 60
When backward buffer duration exceeded this value (in seconds), do auto cleanup for SourceBuffer
autoCleanupMinBackwardDuration
number
2 * 60
Indicates the duration in seconds to reserve for backward buffer when doing auto cleanup.
fixAudioTimestampGap
boolean
true
Fill silent audio frames to avoid a/v unsync when detect large audio timestamp gap.
accurateSeek?
boolean
false
Accurate seek to any frame, not limited to video IDR frame, but may a bit slower. Available on Chrome > 50, FireFox and Safari.
seekType?
string
'range'
'range' use range request to seek, or 'param' add params into url to indicate request range.
seekParamStart?
string
'bstart'
Indicates seek start parameter name for seekType = 'param'
seekParamEnd?
string
'bend'
Indicates seek end parameter name for seekType = 'param'
rangeLoadZeroStart?
boolean
false
Send Range: bytes=0- for first time load if use Range seek
customSeekHandler?
object
undefined
Indicates a custom seek handler
reuseRedirectedURL?
boolean
false
Reuse 301/302 redirected url for subsequence request like seek, reconnect, etc.