From 74954ca45da511f44fad46e3044d5428ea923023 Mon Sep 17 00:00:00 2001 From: rupansh Date: Mon, 15 Jan 2024 12:10:08 +0530 Subject: [PATCH] fix(post_view): tune HLS video parameters --- src/js/mod.rs | 24 +++++++++++++++++++++--- src/js/wasp-wrapper.js | 5 +++-- src/page/post_view/video_loader.rs | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/js/mod.rs b/src/js/mod.rs index b0ea3833..f51d377c 100644 --- a/src/js/mod.rs +++ b/src/js/mod.rs @@ -9,7 +9,11 @@ pub mod wasp { extern "C" { type WaspHlsPlayer; - fn buildPlayer(videoElement: JsValue, config: JsValue) -> WaspHlsPlayer; + fn buildPlayer( + videoElement: JsValue, + initialBandwidth: f64, + config: JsValue, + ) -> WaspHlsPlayer; #[wasm_bindgen(method)] fn load(this: &WaspHlsPlayer, url: &str); @@ -42,10 +46,24 @@ pub mod wasp { pub struct WaspHlsPlayerW(WaspHlsPlayer); impl WaspHlsPlayerW { - pub fn new(video_element: &HtmlElement