diff options
author | metamuffin <metamuffin@disroot.org> | 2023-11-28 13:31:28 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-11-28 13:31:28 +0100 |
commit | 1d2ed0a54c21e0ab7dd01b5f3975bb5df12d40ea (patch) | |
tree | a7531389b2a8ad6d8b89d92900b96fcf0e431774 /stream/src/lib.rs | |
parent | 9ac41109362dc118f1dbd2e86e9c8d64fd7364e9 (diff) | |
download | jellything-1d2ed0a54c21e0ab7dd01b5f3975bb5df12d40ea.tar jellything-1d2ed0a54c21e0ab7dd01b5f3975bb5df12d40ea.tar.bz2 jellything-1d2ed0a54c21e0ab7dd01b5f3975bb5df12d40ea.tar.zst |
ass to webvtt conversion
Diffstat (limited to 'stream/src/lib.rs')
-rw-r--r-- | stream/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/src/lib.rs b/stream/src/lib.rs index e9b9a4b..604e3eb 100644 --- a/stream/src/lib.rs +++ b/stream/src/lib.rs @@ -7,6 +7,7 @@ pub mod hls; pub mod jhls; pub mod segment; +pub mod webvtt; use anyhow::{anyhow, bail, Context, Result}; use hls::{hls_master_stream, hls_variant_stream}; @@ -24,6 +25,7 @@ use tokio::{ io::{duplex, AsyncReadExt, AsyncSeekExt, AsyncWriteExt, DuplexStream}, }; use tokio_util::io::SyncIoBridge; +use webvtt::webvtt_stream; pub struct StreamHead { pub content_type: &'static str, @@ -38,6 +40,7 @@ pub fn stream_head(spec: &StreamSpec) -> StreamHead { StreamFormat::Matroska => StreamHead { content_type: webm_or_mkv, range_supported: true }, StreamFormat::HlsMaster | StreamFormat::HlsVariant => StreamHead { content_type: "application/vnd.apple.mpegurl", range_supported: false }, StreamFormat::Jhls => StreamHead { content_type: "application/jellything-jhls+json", range_supported: false }, + StreamFormat::Webvtt => StreamHead { content_type: "text/vtt", range_supported: false }, StreamFormat::Segment => StreamHead { content_type: webm_or_mkv, range_supported: false }, } } @@ -69,6 +72,7 @@ pub async fn stream( StreamFormat::HlsVariant => hls_variant_stream(node, track_sources, spec, b).await?, StreamFormat::Jhls => jhls_stream(node, track_sources, spec, b, perms).await?, StreamFormat::Segment => segment_stream(node, track_sources, spec, b, perms).await?, + StreamFormat::Webvtt => webvtt_stream(node, track_sources, spec, b).await?, } Ok(a) |