From 2e41b2b373d5a057061a7694aa5e83001efeaf0f Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 26 Jan 2024 03:46:05 +0100 Subject: fix a bunch of stupid things regarding subtitles. still doesnt work --- stream/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'stream/src/lib.rs') diff --git a/stream/src/lib.rs b/stream/src/lib.rs index ee47857..833af3e 100644 --- a/stream/src/lib.rs +++ b/stream/src/lib.rs @@ -25,7 +25,7 @@ use tokio::{ io::{duplex, AsyncReadExt, AsyncSeekExt, AsyncWriteExt, DuplexStream}, }; use tokio_util::io::SyncIoBridge; -use webvtt::webvtt_stream; +use webvtt::vtt_stream; pub struct StreamHead { pub content_type: &'static str, @@ -42,6 +42,7 @@ pub fn stream_head(spec: &StreamSpec) -> StreamHead { StreamFormat::JhlsIndex => StreamHead { content_type: "application/jellything-seekindex+json", range_supported: false }, StreamFormat::Webvtt => StreamHead { content_type: "text/vtt", range_supported: false }, StreamFormat::Snippet => StreamHead { content_type: webm_or_mkv, range_supported: false }, + StreamFormat::Jvtt => StreamHead { content_type: "applcation/jellything-vtt+json", range_supported: false }, } } @@ -87,7 +88,8 @@ pub async fn stream( StreamFormat::HlsVariant => hls_variant_stream(node, local_tracks, spec, b).await?, StreamFormat::JhlsIndex => jhls_index(node, &local_tracks, spec, b, perms).await?, StreamFormat::Snippet => segment_stream(node, local_tracks, spec, b, perms).await?, - StreamFormat::Webvtt => webvtt_stream(node, local_tracks, spec, b).await?, + StreamFormat::Webvtt => vtt_stream(false, node, local_tracks, spec, b).await?, + StreamFormat::Jvtt => vtt_stream(true, node, local_tracks, spec, b).await?, } Ok(a) -- cgit v1.2.3-70-g09d2