Provide captions name in ui and disable by default.

Closes #125
This commit is contained in:
FireMasterK 2021-04-21 20:06:45 +05:30
parent 369aed3e1f
commit 07433033b9
No known key found for this signature in database
GPG Key ID: 8DFF5DD33E93DB58

View File

@ -84,8 +84,14 @@ export default {
setPlayerAttrs(player, videoEl, dash, shaka) {
player.load("data:application/dash+xml;charset=utf-8;base64," + btoa(dash)).then(() => {
this.video.subtitles.map(subtitle => {
player.addTextTrack(subtitle.url, "eng", "SUBTITLE", subtitle.mimeType, null, "English");
player.setTextTrackVisibility(true);
player.addTextTrack(
subtitle.url,
subtitle.code,
"SUBTITLE",
subtitle.mimeType,
null,
subtitle.name,
);
});
if (localStorage) videoEl.volume = localStorage.getItem("volume") || 1;