]> git.mdlowis.com Git - proto/atv.git/commitdiff
fix bug with subtitles stacking
authorMike Lowis <mike.lowis@gentex.com>
Thu, 23 Jan 2025 20:49:29 +0000 (15:49 -0500)
committerMike Lowis <mike.lowis@gentex.com>
Thu, 23 Jan 2025 20:49:29 +0000 (15:49 -0500)
atv/assets/index.html
atv/bin/atv-index
atv/lib/atv/channel.rb

index 8fb716869ea07aa734457fb8fed9ac6f2aa1faa1..74bde56b20d76a2a50bc1a85d366c5f0237b2ec2 100644 (file)
@@ -78,6 +78,7 @@ const updatePlayer = (prev)=>{
     {
         ImageView.style.display = "none";
         Video.style.display = "none";
+        Video.textTracks[0].mode = "hidden";
 
         if (current["curr"]["type"] == "image")
         {
@@ -90,6 +91,7 @@ const updatePlayer = (prev)=>{
             Video.style.display = "block";
             Video.src = current["curr"]["path"] + "#t=" + elapsed;
             SubtitleTrack.src = current["curr"]["path"] + ".vtt";
+            Video.textTracks[0].mode = "showing";
             if (current["playing"])
             {
                 Video.play()
index 7347a835a589127d479a5992e1e730f16f66639d..c25ca3202b10859555764cbe0c27756555262904 100755 (executable)
@@ -4,7 +4,7 @@ require 'json'
 require 'fileutils'
 
 IMG_TYPES = %w[jpg jpeg png gif]
-VID_TYPES = %w[mp4 ogg webm]
+VID_TYPES = %w[mp4 m4v ogg webm]
 
 TYPES = "{#{(IMG_TYPES + VID_TYPES).join(",")}}"
 FILES = []
index bd2386495bf1a62188148e1ffd8450321a38f51e..68cabd05a33767d8440eb8793c44c5fc78d6f2a3 100644 (file)
@@ -41,7 +41,8 @@ module ATV
 
     def pick_random()
       if not @ratios.nil? then
-        options = @ratios.map {|e| Array.new(e[1], e[0]) }.flatten.map{|k| filedata[:tree][k] }.compact
+        ratioed_options = @ratios.map {|e| Array.new(e[1], e[0]) }.flatten
+        options = ratioed_options.map{|k| filedata[:tree][k] }.compact
       else
         options = filedata[:tree].values
       end