Support enabling custom media subtitle by default
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track#Attributes
This commit is contained in:
parent
8fc951350e
commit
750509eaf1
3 changed files with 20 additions and 3 deletions
|
|
@ -96,12 +96,16 @@ window.VideoJSPlayer = class VideoJSPlayer extends Player
|
|||
if data.meta.textTracks
|
||||
data.meta.textTracks.forEach((track) ->
|
||||
label = track.name
|
||||
$('<track/>').attr(
|
||||
attrs =
|
||||
src: track.url
|
||||
kind: 'subtitles'
|
||||
type: track.type
|
||||
label: label
|
||||
).appendTo(video)
|
||||
|
||||
if track.default? and track.default
|
||||
attrs.default = ''
|
||||
|
||||
$('<track/>').attr(attrs).appendTo(video)
|
||||
)
|
||||
|
||||
@player = videojs(video[0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue