diff options
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) |