FInishing support of webvtt (subrip transcoded).

This commit is contained in:
Zoe Roux 2019-09-19 23:16:41 +02:00
parent cb306d6a34
commit 6534ea2e99
4 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,5 @@
@import "../../libraries/subtitles"; @import "../../libraries/subtitles";
@import "./vtt-subtitles";
.player .player
{ {

View File

@ -189,7 +189,7 @@ export class PlayerComponent implements OnInit
document.getElementById("hover").classList.add("idle"); document.getElementById("hover").classList.add("idle");
document.documentElement.style.cursor = "none"; document.documentElement.style.cursor = "none";
} }
}, 2000); }, 1000);
document.addEventListener("fullscreenchange", () => document.addEventListener("fullscreenchange", () =>
{ {
@ -313,6 +313,7 @@ export class PlayerComponent implements OnInit
$(document).unbind(); $(document).unbind();
$(window).unbind(); $(window).unbind();
document.exitFullscreen();
$('[data-toggle="tooltip"]').hide(); $('[data-toggle="tooltip"]').hide();
} }
@ -419,6 +420,7 @@ export class PlayerComponent implements OnInit
track.label = subtitle.displayName; track.label = subtitle.displayName;
track.srclang = subtitle.language; track.srclang = subtitle.language;
track.src = subtitle.link.replace(".srt", ".vtt"); track.src = subtitle.link.replace(".srt", ".vtt");
track.classList.add("subtitle_container");
track.default = true; track.default = true;
track.onload = () => track.onload = () =>
{ {

View File

@ -0,0 +1,5 @@
::cue
{
background-color: transparent;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

View File

@ -12,7 +12,7 @@ using System.Threading.Tasks;
namespace Kyoo.Controllers namespace Kyoo.Controllers
{ {
[Route("api/[controller]")] [Route("api/[controller]")]
//[ApiController] [ApiController]
public class SubtitleController : ControllerBase public class SubtitleController : ControllerBase
{ {
private readonly ILibraryManager libraryManager; private readonly ILibraryManager libraryManager;
@ -133,7 +133,10 @@ namespace Kyoo.Controllers
line = null; line = null;
if (lastLine == null) //The line is a timecode only if the last line is an index line and we already set it to null. if (lastLine == null) //The line is a timecode only if the last line is an index line and we already set it to null.
{
line = line.Replace(',', '.'); line = line.Replace(',', '.');
line += " line:93%";
}
return line; return line;
} }