简体   繁体   English

在HLS.JS播放器中显示字幕

[英]Show captions in HLS.JS player

I am trying to turn on captions (*.ts format) in HLS.JS, but I can't found out how. 我正在尝试在HLS.JS中打开字幕(* .ts格式),但我不知道如何。 Here is hls.js player's official demo website: https://video-dev.github.io/hls.js/demo/ There is video with CC (Closed Captions) named: "CNN special report, with CC". 这是hls.js播放器的官方演示网站: https ://video-dev.github.io/hls.js/demo/有带有CC(隐藏式字幕)的视频,名为:“带有CC的CNN特别报告”。 It is playing, but not showing CC. 它正在播放,但未显示CC。 There is some sort of controls beneath, but nothing about subtitles/cc. 下面有一些控件,但是关于字幕/抄送没有任何意义。 I checked in Dev mode: hls.subtitleTracks = [] 我在开发人员模式下检查过:hls.subtitleTracks = []

However, if I load this video into VLC player or *.ts chunks, then I can turn on subtitles within VLC player. 但是,如果我将此视频加载到VLC播放器或* .ts块中,则可以在VLC播放器中打开字幕。

Please, tell me how to turn on Closed Captions on that website or through the code? 请告诉我如何在该网站上或通过代码打开隐藏式字幕?

Omg, I found it. 天哪,我找到了。 I should have just hover on player's UI and find three small dots in right bottom corner. 我应该将鼠标悬停在玩家的用户界面上,并在右下角找到三个小点。 There is control for Captions. 字幕有控制权。 Hope somebody will save time on this. 希望有人可以节省时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM