diff options
Diffstat (limited to 'stream/src/jhls.rs')
-rw-r--r-- | stream/src/jhls.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stream/src/jhls.rs b/stream/src/jhls.rs index 5e15d6f..4488dac 100644 --- a/stream/src/jhls.rs +++ b/stream/src/jhls.rs @@ -13,11 +13,9 @@ pub async fn jhls_stream( _spec: StreamSpec, mut b: DuplexStream, ) -> Result<()> { + let media = node.public.media.clone().unwrap(); let tracks = tokio::task::spawn_blocking(move || { - node.public - .media - .as_ref() - .unwrap() + media .tracks .iter() .enumerate() @@ -37,7 +35,10 @@ pub async fn jhls_stream( }) .await??; - let out = serde_json::to_string(&JhlsMetadata { tracks })?; + let out = serde_json::to_string(&JhlsMetadata { + tracks, + duration: media.duration, + })?; tokio::spawn(async move { b.write_all(out.as_bytes()).await }); Ok(()) } |