Skip to content

Commit b7b8ec9

Browse files
authored
fix(VIDEO-20021): subtitles defined in HLS manifest (#909)
1 parent 5f8748a commit b7b8ec9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/plugins/adaptive-streaming/videojs-contrib-hlsjs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ function Html5HlsJS(source, tech) {
105105
// if native text tracks are not supported on this browser.
106106
if (!tech.featuresNativeTextTracks) {
107107
Object.defineProperty(el, 'textTracks', {
108-
value: tech.textTracks,
109-
writable: false
108+
get: function() {
109+
try {
110+
return typeof tech.textTracks === 'function' ? tech.textTracks() : tech.textTracks;
111+
} catch {
112+
return [];
113+
}
114+
}
110115
});
111116
el.addTextTrack = function() {
112117
return tech.addTextTrack.apply(tech, arguments);

0 commit comments

Comments
 (0)