Add HLS support (and upgrade Video.JS)
This commit is contained in:
parent
da99ea8288
commit
d06c614ccc
10 changed files with 6217 additions and 1392 deletions
23
player/hls.coffee
Normal file
23
player/hls.coffee
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
window.HLSPlayer = class HLSPlayer extends VideoJSPlayer
|
||||
constructor: (data) ->
|
||||
if not (this instanceof HLSPlayer)
|
||||
return new HLSPlayer(data)
|
||||
|
||||
@setupMeta(data)
|
||||
super(data)
|
||||
|
||||
load: (data) ->
|
||||
@setupMeta(data)
|
||||
super(data)
|
||||
|
||||
setupMeta: (data) ->
|
||||
data.meta.direct =
|
||||
# Quality is required for data.meta.direct processing but doesn't
|
||||
# matter here because it's dictated by the stream. Arbitrarily
|
||||
# choose 480.
|
||||
480: [
|
||||
{
|
||||
link: data.id
|
||||
contentType: 'application/x-mpegURL'
|
||||
}
|
||||
]
|
||||
|
|
@ -15,6 +15,7 @@ TYPE_MAP =
|
|||
us: UstreamPlayer
|
||||
im: ImgurPlayer
|
||||
vm: VideoJSPlayer
|
||||
hl: HLSPlayer
|
||||
|
||||
window.loadMediaPlayer = (data) ->
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue