[fix](trx-frontend): vendor Opus decoder
This commit is contained in:
@@ -1623,7 +1623,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
<div id="decode-history-overlay-sub" class="decode-history-overlay-sub">Preparing recent decodes for the UI</div>
|
||||
</div>
|
||||
</div>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/opus-decoder@0.7.11/dist/opus-decoder.min.js" charset="UTF-8"></script>
|
||||
<script defer src="/vendor/opus-decoder-0.7.11.min.js" charset="UTF-8"></script>
|
||||
<script defer src="/vendor/leaflet.js"></script>
|
||||
<script defer src="/leaflet-ais-tracksymbol.js"></script>
|
||||
<script defer src="/webgl-renderer.js"></script>
|
||||
|
||||
+232
File diff suppressed because one or more lines are too long
@@ -75,6 +75,13 @@ define_gz_cache!(gz_bandplan_json, status::BANDPLAN_JSON, "bandplan.json");
|
||||
// Vendored DSEG14 Classic font
|
||||
// (binary woff2 — served directly, not through gz_cache)
|
||||
|
||||
// Vendored opus-decoder 0.7.11
|
||||
define_gz_cache!(
|
||||
gz_opus_decoder_js,
|
||||
status::OPUS_DECODER_JS,
|
||||
"opus-decoder-0.7.11.min.js"
|
||||
);
|
||||
|
||||
// Vendored Leaflet 1.9.4
|
||||
define_gz_cache!(gz_leaflet_js, status::LEAFLET_JS, "leaflet.js");
|
||||
define_gz_cache!(gz_leaflet_css, status::LEAFLET_CSS, "leaflet.css");
|
||||
@@ -341,6 +348,12 @@ pub(crate) async fn dseg14_classic_woff2() -> impl Responder {
|
||||
.body(status::DSEG14_CLASSIC_WOFF2)
|
||||
}
|
||||
|
||||
#[get("/vendor/opus-decoder-0.7.11.min.js")]
|
||||
pub(crate) async fn opus_decoder_js(req: HttpRequest) -> impl Responder {
|
||||
let c = gz_opus_decoder_js();
|
||||
static_asset_response(&req, "application/javascript; charset=utf-8", c)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Vendored Leaflet 1.9.4
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -668,6 +668,8 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
||||
.service(assets::bandplan_json)
|
||||
// Vendored DSEG14 Classic font
|
||||
.service(assets::dseg14_classic_woff2)
|
||||
// Vendored opus-decoder 0.7.11
|
||||
.service(assets::opus_decoder_js)
|
||||
// Vendored Leaflet 1.9.4
|
||||
.service(assets::leaflet_js)
|
||||
.service(assets::leaflet_css)
|
||||
|
||||
@@ -40,6 +40,9 @@ pub const BANDPLAN_JSON: &str = include_str!("../assets/web/bandplan.json");
|
||||
pub const DSEG14_CLASSIC_WOFF2: &[u8] =
|
||||
include_bytes!("../assets/web/vendor/dseg14-classic-latin-400-normal.woff2");
|
||||
|
||||
// Vendored opus-decoder 0.7.11 browser build (WebAssembly embedded in JS)
|
||||
pub const OPUS_DECODER_JS: &str = include_str!("../assets/web/vendor/opus-decoder-0.7.11.min.js");
|
||||
|
||||
// Vendored Leaflet 1.9.4
|
||||
pub const LEAFLET_JS: &str = include_str!("../assets/web/vendor/leaflet.js");
|
||||
pub const LEAFLET_CSS: &str = include_str!("../assets/web/vendor/leaflet.css");
|
||||
|
||||
Reference in New Issue
Block a user