bugfix
This commit is contained in:
parent
da8d752ed0
commit
c2b4f50571
@ -44,6 +44,7 @@ bricks.VideoPlayer = class extends bricks.VBox {
|
|||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
this.video = this.dom_element.querySelector('.video-element');
|
this.video = this.dom_element.querySelector('.video-element');
|
||||||
|
this.video.textTracks[0].mode = 'hidden';
|
||||||
this.controls = this.dom_element.querySelector('.controls');
|
this.controls = this.dom_element.querySelector('.controls');
|
||||||
|
|
||||||
this.hls = null;
|
this.hls = null;
|
||||||
@ -88,10 +89,15 @@ bricks.VideoPlayer = class extends bricks.VBox {
|
|||||||
|
|
||||||
if (src.endsWith('.m3u8') || src.includes('m3u8')) {
|
if (src.endsWith('.m3u8') || src.includes('m3u8')) {
|
||||||
if (Hls.isSupported()) {
|
if (Hls.isSupported()) {
|
||||||
this.hls = new Hls();
|
this.hls = new Hls({
|
||||||
|
enableWebVTT: false, // 不加载 WebVTT
|
||||||
|
enableIMSC1: false, // 不加载 IMSC1/TTML
|
||||||
|
renderTextTracksNatively: false // 不用浏览器原生 track
|
||||||
|
});
|
||||||
this.hls.subtitleTrack = -1; // 关闭字幕轨道
|
this.hls.subtitleTrack = -1; // 关闭字幕轨道
|
||||||
this.hls.loadSource(src);
|
this.hls.loadSource(src);
|
||||||
this.hls.attachMedia(this.video);
|
this.hls.attachMedia(this.video);
|
||||||
|
this.video.textTracks[0].mode = 'hidden';
|
||||||
this.hls.on(Hls.Events.MANIFEST_PARSED, () => this.onLoaded());
|
this.hls.on(Hls.Events.MANIFEST_PARSED, () => this.onLoaded());
|
||||||
} else {
|
} else {
|
||||||
console.error('HLS not supported');
|
console.error('HLS not supported');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user