<body>
<video id="Video" width="100%" height="100%" src="" autoplay muted playsinline>
+ <track id="SubtitleTrack"
+ label="English"
+ kind="subtitles"
+ srclang="en"
+ src=""
+ default />
</video>
<div class="badge" style="left: 1em;">
if (diffTooBig || srcChanged || playStateChanged || chanChanged)
{
Video.src = current["curr"]["path"] + "#t=" + elapsed;
+ SubtitleTrack.src = current["curr"]["path"] + ".vtt";
if (current["playing"])
{
Video.play();
--- /dev/null
+#!/bin/env ruby
+
+TYPES = "{mp4,ogg,webm,avi}"
+FILES = ARGV.map {|f| Dir.glob("#{f}/**/*.#{TYPES}") }.flatten
+FILES.each do |f|
+ if not File.exist? "#{f}.vtt"
+ puts f
+ system("whisper \"#{f}\" --model small.en --language en -f vtt --threads 4 > \"#{f}.vtt.tmp\"")
+ FileUtils.mv("#{f}.vtt.tmp", "#{f}.vtt")
+ end
+end
--- /dev/null
+#!/bin/env ruby
+
+TYPES = "{mp4,ogg,webm}"
+FILES = ARGV.map {|f| Dir.glob("#{f}/**/*.#{TYPES}") }.flatten
+FILES.each do |f|
+end
+
def scan()
# scan for videos
@dirs.each do |dir|
- Dir.glob("#{@root}/#{dir}/**/*.{mp4,webm,ogg}").each do |f|
+ Dir.glob("#{@root}/#{dir}/**/*.{mp4,m4v,webm,ogg}").each do |f|
short_path = f.sub("#{@root}/", '')
next if @data[short_path]
puts f