This commit is contained in:
yumoqing 2025-09-12 23:09:07 +08:00
parent c2b4f50571
commit 1f94b7f635

View File

@ -44,7 +44,6 @@ 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;
@ -97,7 +96,6 @@ bricks.VideoPlayer = class extends bricks.VBox {
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');