ec-node: WebTransport publish + web hang-watch
This commit is contained in:
parent
791c7beee7
commit
339aef50e0
19 changed files with 1355 additions and 2229 deletions
3
.envrc
3
.envrc
|
|
@ -1,2 +1,5 @@
|
|||
# Work around `NO_COLOR=1` being interpreted as `--no-color 1` by some nix versions.
|
||||
export NO_COLOR=true
|
||||
|
||||
use flake
|
||||
export EVERY_CHANNEL_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ jobs:
|
|||
"https://codeberg.org/api/v1/repos/every-channel/every.channel/statuses/${GITHUB_SHA}" \
|
||||
-d '{"context":"deploy-cloudflare/breadcrumb","state":"pending","description":"decrypt ok"}' >/dev/null
|
||||
|
||||
- name: Build site (Dioxus web)
|
||||
- name: Build site (web)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
shell: bash
|
||||
|
|
@ -195,7 +195,7 @@ jobs:
|
|||
| tar -xz -C "$HOME/.local/bin" trunk
|
||||
fi
|
||||
|
||||
cd apps/tauri/ui
|
||||
cd apps/web
|
||||
trunk build --release --public-url /
|
||||
|
||||
curl -fsSL -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
|
|
|
|||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -5,6 +5,8 @@ apps/tauri/ui/target/
|
|||
apps/tauri/ui/apps/
|
||||
apps/tauri/dist/
|
||||
apps/tauri/gen/
|
||||
apps/web/dist/
|
||||
apps/web/target/
|
||||
.direnv/
|
||||
result
|
||||
.wrangler/
|
||||
|
|
|
|||
619
Cargo.lock
generated
619
Cargo.lock
generated
|
|
@ -51,6 +51,15 @@ dependencies = [
|
|||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.25.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
|
||||
dependencies = [
|
||||
"gimli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "adler2"
|
||||
version = "2.0.1"
|
||||
|
|
@ -186,6 +195,9 @@ name = "anyhow"
|
|||
version = "1.0.100"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arc-swap"
|
||||
|
|
@ -239,6 +251,22 @@ dependencies = [
|
|||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1-rs"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56624a96882bb8c26d61312ae18cb45868e5a9992ea73c58e45c3101e56a1e60"
|
||||
dependencies = [
|
||||
"asn1-rs-derive 0.6.0",
|
||||
"asn1-rs-impl 0.2.0",
|
||||
"displaydoc",
|
||||
"nom",
|
||||
"num-traits",
|
||||
"rusticata-macros",
|
||||
"thiserror 2.0.18",
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1-rs-derive"
|
||||
version = "0.4.0"
|
||||
|
|
@ -263,6 +291,18 @@ dependencies = [
|
|||
"synstructure 0.13.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1-rs-derive"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.114",
|
||||
"synstructure 0.13.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "asn1-rs-impl"
|
||||
version = "0.1.0"
|
||||
|
|
@ -310,6 +350,18 @@ dependencies = [
|
|||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-compression"
|
||||
version = "0.4.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68650b7df54f0293fd061972a0fb05aaf4fc0879d3b3d21a638a182c5c543b9f"
|
||||
dependencies = [
|
||||
"compression-codecs",
|
||||
"compression-core",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.89"
|
||||
|
|
@ -411,6 +463,29 @@ version = "1.5.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-rs"
|
||||
version = "1.15.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256"
|
||||
dependencies = [
|
||||
"aws-lc-sys",
|
||||
"untrusted 0.7.1",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-sys"
|
||||
version = "0.37.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b092fe214090261288111db7a2b2c2118e5a7f30dc2569f1732c4069a6840549"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cmake",
|
||||
"dunce",
|
||||
"fs_extra",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "axum"
|
||||
version = "0.7.9"
|
||||
|
|
@ -477,6 +552,21 @@ dependencies = [
|
|||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.76"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"miniz_oxide",
|
||||
"object",
|
||||
"rustc-demangle",
|
||||
"windows-link 0.2.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
|
|
@ -602,6 +692,15 @@ dependencies = [
|
|||
"alloc-stdlib",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "buf-list"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a6b175f9cf8fffedd4c4b18bcfef092356e952b81f596e148f18e98280994593"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.19.1"
|
||||
|
|
@ -629,6 +728,15 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytestring"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "113b4343b5f6617e7ad401ced8de3cc8b012e73a594347c307b90db3e9271289"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
version = "0.18.5"
|
||||
|
|
@ -712,6 +820,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
|
||||
dependencies = [
|
||||
"find-msvc-tools",
|
||||
"jobserver",
|
||||
"libc",
|
||||
"shlex",
|
||||
]
|
||||
|
||||
|
|
@ -853,6 +963,15 @@ version = "0.7.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
|
||||
|
||||
[[package]]
|
||||
name = "cmake"
|
||||
version = "0.1.57"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cobs"
|
||||
version = "0.3.0"
|
||||
|
|
@ -878,6 +997,23 @@ dependencies = [
|
|||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "compression-codecs"
|
||||
version = "0.4.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a"
|
||||
dependencies = [
|
||||
"compression-core",
|
||||
"flate2",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "compression-core"
|
||||
version = "0.4.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d"
|
||||
|
||||
[[package]]
|
||||
name = "concurrent-queue"
|
||||
version = "2.5.0"
|
||||
|
|
@ -1300,6 +1436,20 @@ dependencies = [
|
|||
"rusticata-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "der-parser"
|
||||
version = "10.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6"
|
||||
dependencies = [
|
||||
"asn1-rs 0.7.1",
|
||||
"displaydoc",
|
||||
"nom",
|
||||
"num-bigint",
|
||||
"num-traits",
|
||||
"rusticata-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "deranged"
|
||||
version = "0.5.5"
|
||||
|
|
@ -1644,7 +1794,7 @@ dependencies = [
|
|||
"hex",
|
||||
"iroh",
|
||||
"iroh-moq",
|
||||
"moq-lite",
|
||||
"moq-lite 0.10.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
|
|
@ -1668,10 +1818,13 @@ dependencies = [
|
|||
"ec-linux-iptv",
|
||||
"ec-moq",
|
||||
"futures-util",
|
||||
"hang",
|
||||
"headless_chrome",
|
||||
"hex",
|
||||
"iroh",
|
||||
"just-webrtc",
|
||||
"moq-mux",
|
||||
"moq-native",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
@ -1679,6 +1832,7 @@ dependencies = [
|
|||
"tokio-tungstenite",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"urlencoding",
|
||||
"which 6.0.3",
|
||||
]
|
||||
|
|
@ -1984,6 +2138,12 @@ version = "0.1.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.5.7"
|
||||
|
|
@ -2059,6 +2219,12 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fs_extra"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||
|
||||
[[package]]
|
||||
name = "futf"
|
||||
version = "0.1.5"
|
||||
|
|
@ -2113,7 +2279,7 @@ version = "7.7.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "175cd8cca9e1d45b87f18ffa75088f2099e3c4fe5e2f83e42de112560bea8ea6"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"fixedbitset 0.5.7",
|
||||
"futures-core",
|
||||
"futures-lite",
|
||||
"pin-project",
|
||||
|
|
@ -2379,6 +2545,12 @@ dependencies = [
|
|||
"polyval",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gimli"
|
||||
version = "0.32.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
|
||||
|
||||
[[package]]
|
||||
name = "gio"
|
||||
version = "0.18.4"
|
||||
|
|
@ -2569,6 +2741,35 @@ dependencies = [
|
|||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h264-parser"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "253b313319f7109de64e480ffb606f89475cd758bae82e096e00c5d95341d30e"
|
||||
|
||||
[[package]]
|
||||
name = "hang"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f548f7cdc8ec3b9eae085f7b61ff9603d6dc9f09192c5f4b0db4c02577786070"
|
||||
dependencies = [
|
||||
"buf-list",
|
||||
"bytes",
|
||||
"derive_more 2.1.1",
|
||||
"futures",
|
||||
"hex",
|
||||
"lazy_static",
|
||||
"moq-lite 0.14.0",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_with",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hash32"
|
||||
version = "0.2.1"
|
||||
|
|
@ -2793,6 +2994,22 @@ version = "1.0.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||
|
||||
[[package]]
|
||||
name = "humantime"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424"
|
||||
|
||||
[[package]]
|
||||
name = "humantime-serde"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
|
||||
dependencies = [
|
||||
"humantime",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hybrid-array"
|
||||
version = "0.4.6"
|
||||
|
|
@ -3257,7 +3474,7 @@ name = "iroh-moq"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"iroh",
|
||||
"moq-lite",
|
||||
"moq-lite 0.10.1",
|
||||
"n0-error",
|
||||
"n0-future",
|
||||
"tokio",
|
||||
|
|
@ -3472,6 +3689,16 @@ version = "0.3.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.34"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
|
||||
dependencies = [
|
||||
"getrandom 0.3.4",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.85"
|
||||
|
|
@ -3677,6 +3904,16 @@ version = "0.1.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
|
||||
|
||||
[[package]]
|
||||
name = "m3u8-rs"
|
||||
version = "5.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c1d7ba86f7ea62f17f4310c55e93244619ddc7dadfc7e565de1967e4e41e6e7"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mac"
|
||||
version = "0.1.1"
|
||||
|
|
@ -3869,6 +4106,99 @@ dependencies = [
|
|||
"web-transport-trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "moq-lite"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8a4c4e66081bc21067488da13f4131540b38b1cb79fb5176ef4ddacd104786b"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"bytes",
|
||||
"futures",
|
||||
"hex",
|
||||
"num_enum",
|
||||
"rand 0.9.2",
|
||||
"serde",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"web-async",
|
||||
"web-transport-trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "moq-mux"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73e2570aa39feef3aa00fa0990862dcdfb44937d3eb9c448c3a4eb1fb8ff43d3"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"buf-list",
|
||||
"bytes",
|
||||
"derive_more 2.1.1",
|
||||
"h264-parser",
|
||||
"hang",
|
||||
"m3u8-rs",
|
||||
"moq-lite 0.14.0",
|
||||
"mp4-atom",
|
||||
"num_enum",
|
||||
"reqwest",
|
||||
"scuffle-av1",
|
||||
"scuffle-h265",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "moq-native"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9848c21bf5db3f8ff5e5a7d89bf2c567f0eb526390c26d5f66f3fec99a6751a5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"futures",
|
||||
"hex",
|
||||
"humantime",
|
||||
"humantime-serde",
|
||||
"moq-lite 0.14.0",
|
||||
"parking_lot",
|
||||
"quinn",
|
||||
"rand 0.9.2",
|
||||
"rcgen 0.14.7",
|
||||
"reqwest",
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"rustls-pemfile",
|
||||
"rustls-webpki",
|
||||
"serde",
|
||||
"serde_with",
|
||||
"time",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"web-transport-quinn",
|
||||
"web-transport-ws",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp4-atom"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e8e949244bbd26ea7eb6d936af3a6a0202be68bcfc9afce700f3c9026860ff7"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"derive_more 2.1.1",
|
||||
"num",
|
||||
"paste",
|
||||
"serde",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "muda"
|
||||
version = "0.17.1"
|
||||
|
|
@ -4187,6 +4517,20 @@ dependencies = [
|
|||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
|
||||
dependencies = [
|
||||
"num-bigint",
|
||||
"num-complex",
|
||||
"num-integer",
|
||||
"num-iter",
|
||||
"num-rational",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.4.6"
|
||||
|
|
@ -4197,6 +4541,15 @@ dependencies = [
|
|||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-complex"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-conv"
|
||||
version = "0.2.0"
|
||||
|
|
@ -4212,6 +4565,28 @@ dependencies = [
|
|||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-iter"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-rational"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
|
||||
dependencies = [
|
||||
"num-bigint",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.19"
|
||||
|
|
@ -4252,6 +4627,15 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nutype-enum"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1e13adea6de269faa0724df58f43f6fe2a81af7094f1dcb8b5b968eb2103cb3"
|
||||
dependencies = [
|
||||
"scuffle-workspace-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2"
|
||||
version = "0.6.3"
|
||||
|
|
@ -4480,6 +4864,15 @@ dependencies = [
|
|||
"objc2-security",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.37.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oid-registry"
|
||||
version = "0.7.1"
|
||||
|
|
@ -4489,6 +4882,15 @@ dependencies = [
|
|||
"asn1-rs 0.6.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "oid-registry"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7"
|
||||
dependencies = [
|
||||
"asn1-rs 0.7.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.21.3"
|
||||
|
|
@ -4604,8 +5006,10 @@ version = "0.9.12"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"petgraph",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-link 0.2.1",
|
||||
|
|
@ -4651,6 +5055,16 @@ version = "2.3.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
|
||||
dependencies = [
|
||||
"fixedbitset 0.4.2",
|
||||
"indexmap 2.13.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pharos"
|
||||
version = "0.5.3"
|
||||
|
|
@ -5137,7 +5551,9 @@ version = "0.11.13"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"bytes",
|
||||
"fastbloom",
|
||||
"getrandom 0.3.4",
|
||||
"lru-slab",
|
||||
"rand 0.9.2",
|
||||
|
|
@ -5145,6 +5561,7 @@ dependencies = [
|
|||
"rustc-hash",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"rustls-platform-verifier",
|
||||
"slab",
|
||||
"thiserror 2.0.18",
|
||||
"tinyvec",
|
||||
|
|
@ -5307,7 +5724,20 @@ dependencies = [
|
|||
"ring",
|
||||
"rustls-pki-types",
|
||||
"time",
|
||||
"x509-parser",
|
||||
"x509-parser 0.16.0",
|
||||
"yasna",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rcgen"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10b99e0098aa4082912d4c649628623db6aba77335e4f4569ff5083a6448b32e"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"rustls-pki-types",
|
||||
"time",
|
||||
"x509-parser 0.18.1",
|
||||
"yasna",
|
||||
]
|
||||
|
||||
|
|
@ -5448,7 +5878,7 @@ dependencies = [
|
|||
"cfg-if",
|
||||
"getrandom 0.2.17",
|
||||
"libc",
|
||||
"untrusted",
|
||||
"untrusted 0.9.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
|
|
@ -5477,6 +5907,12 @@ dependencies = [
|
|||
"webrtc-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "2.1.1"
|
||||
|
|
@ -5533,6 +5969,7 @@ version = "0.23.36"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"log",
|
||||
"once_cell",
|
||||
"ring",
|
||||
|
|
@ -5554,6 +5991,15 @@ dependencies = [
|
|||
"security-framework",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pemfile"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.14.0"
|
||||
|
|
@ -5597,9 +6043,10 @@ version = "0.103.9"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
|
||||
dependencies = [
|
||||
"aws-lc-rs",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"untrusted",
|
||||
"untrusted 0.9.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5695,6 +6142,61 @@ version = "1.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "scuffle-av1"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "028eddc8b17fe9dba817b238c56d3acf03748bdbed4c35783cfb93857ef15955"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"scuffle-bytes-util",
|
||||
"scuffle-workspace-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scuffle-bytes-util"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0417748c2a42f4a08d4e634b68b1d64f22a8c24bef2e7ac93df33aa61202a45b"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"bytestring",
|
||||
"scuffle-workspace-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scuffle-expgolomb"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48d21330974c941e4c0aedc1e7255ea809e8cbac51e135209f6d67843ad1b94d"
|
||||
dependencies = [
|
||||
"scuffle-bytes-util",
|
||||
"scuffle-workspace-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scuffle-h265"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b04b276c2f79846b7968abe6f87cedf951e06fd2a2b72d99c457e85d7e40f3fb"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"nutype-enum",
|
||||
"scuffle-bytes-util",
|
||||
"scuffle-expgolomb",
|
||||
"scuffle-workspace-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scuffle-workspace-hack"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8028ded836a0d9fabdfa4d713389b76a2098b5153f50a135c8faed7e3a3d5ae2"
|
||||
|
||||
[[package]]
|
||||
name = "sdp"
|
||||
version = "0.6.2"
|
||||
|
|
@ -6015,6 +6517,17 @@ dependencies = [
|
|||
"stable_deref_trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sfv"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d471eaefb14f4b30032525bdb124b36e55ba9cb1292080e06f1a236cd10fe87"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"indexmap 2.13.0",
|
||||
"ref-cast",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha1"
|
||||
version = "0.10.6"
|
||||
|
|
@ -7126,13 +7639,18 @@ version = "0.6.8"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"bitflags 2.10.0",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"http-body-util",
|
||||
"iri-string",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
|
|
@ -7396,6 +7914,12 @@ dependencies = [
|
|||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.9.0"
|
||||
|
|
@ -7767,7 +8291,7 @@ dependencies = [
|
|||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
"web-transport-proto",
|
||||
"web-transport-proto 0.3.1",
|
||||
"web-transport-trait",
|
||||
]
|
||||
|
||||
|
|
@ -7785,12 +8309,61 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-transport-trait"
|
||||
version = "0.3.1"
|
||||
name = "web-transport-proto"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ae5c857e6b426610648b39c6b48f9e66ae97b27b166d7c2f1ec369596548271"
|
||||
checksum = "17633ea7058419f87cbb7f341ab75ac5c1d6d187c154b0bd4c87539e66f4c4e4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
"sfv",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-transport-quinn"
|
||||
version = "0.11.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96b195557749e84091d7b912a25e190e9606283b5121d041faf538b0b55f40d7"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures",
|
||||
"http",
|
||||
"quinn",
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
"web-transport-proto 0.5.2",
|
||||
"web-transport-trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-transport-trait"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "802d6aa508f2c63c9050ceabc17265bbf90ed4d6f4e4357e987583883628e79c"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-transport-ws"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7b1cd89c36a28eae759329839e85f7dbca733896f048a6daaf5f8fc80f3bcba"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures",
|
||||
"thiserror 2.0.18",
|
||||
"tokio",
|
||||
"tokio-tungstenite",
|
||||
"web-transport-proto 0.5.2",
|
||||
"web-transport-trait",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -7880,7 +8453,7 @@ dependencies = [
|
|||
"log",
|
||||
"portable-atomic",
|
||||
"rand 0.8.5",
|
||||
"rcgen",
|
||||
"rcgen 0.13.2",
|
||||
"regex",
|
||||
"ring",
|
||||
"rtcp",
|
||||
|
|
@ -7945,7 +8518,7 @@ dependencies = [
|
|||
"portable-atomic",
|
||||
"rand 0.8.5",
|
||||
"rand_core 0.6.4",
|
||||
"rcgen",
|
||||
"rcgen 0.13.2",
|
||||
"ring",
|
||||
"rustls",
|
||||
"sec1",
|
||||
|
|
@ -7957,7 +8530,7 @@ dependencies = [
|
|||
"tokio",
|
||||
"webrtc-util",
|
||||
"x25519-dalek",
|
||||
"x509-parser",
|
||||
"x509-parser 0.16.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -8868,13 +9441,31 @@ dependencies = [
|
|||
"der-parser 9.0.0",
|
||||
"lazy_static",
|
||||
"nom",
|
||||
"oid-registry",
|
||||
"oid-registry 0.7.1",
|
||||
"ring",
|
||||
"rusticata-macros",
|
||||
"thiserror 1.0.69",
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x509-parser"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d43b0f71ce057da06bc0851b23ee24f3f86190b07203dd8f567d0b706a185202"
|
||||
dependencies = [
|
||||
"asn1-rs 0.7.1",
|
||||
"aws-lc-rs",
|
||||
"data-encoding",
|
||||
"der-parser 10.0.0",
|
||||
"lazy_static",
|
||||
"nom",
|
||||
"oid-registry 0.8.1",
|
||||
"rusticata-macros",
|
||||
"thiserror 2.0.18",
|
||||
"time",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xml-rs"
|
||||
version = "0.8.28"
|
||||
|
|
|
|||
17
README.md
17
README.md
|
|
@ -47,6 +47,23 @@ Runbook:
|
|||
cat docs/USAGE.md
|
||||
```
|
||||
|
||||
## WebTransport Watch (MoQ)
|
||||
|
||||
Publish (node -> Cloudflare relay):
|
||||
|
||||
```sh
|
||||
cargo run -p ec-node -- wt-publish \
|
||||
--url https://relay.cloudflare.mediaoverquic.com/ \
|
||||
--name la-nbc \
|
||||
--input http://<hdhr-host>/auto/v4.1
|
||||
```
|
||||
|
||||
Watch (web):
|
||||
|
||||
```txt
|
||||
https://every.channel/watch?url=https%3A%2F%2Frelay.cloudflare.mediaoverquic.com%2F&name=la-nbc
|
||||
```
|
||||
|
||||
Coverage:
|
||||
|
||||
```sh
|
||||
|
|
|
|||
1857
apps/web/Cargo.lock
generated
1857
apps/web/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,14 +0,0 @@
|
|||
[package]
|
||||
name = "ec-web"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
dioxus = { version = "0.6", features = ["web"] }
|
||||
js-sys = "0.3"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
wasm-bindgen = "0.2"
|
||||
wasm-bindgen-futures = "0.4"
|
||||
web-sys = { version = "0.3", features = ["Window", "Navigator", "Clipboard"] }
|
||||
|
||||
[workspace]
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
# every.channel web site (static)
|
||||
|
||||
This is a static web site built in Rust with Dioxus and compiled to WASM.
|
||||
This is a static web watcher site.
|
||||
|
||||
It embeds the upstream `@kixelated/hang` WebTransport player component (`<hang-watch>`).
|
||||
|
||||
## Dev
|
||||
|
||||
|
|
@ -15,4 +17,3 @@ nix develop -c bash -lc 'cd apps/web && trunk serve --port 1421 --public-url /'
|
|||
```bash
|
||||
nix develop -c bash -lc 'cd apps/web && trunk build --release --public-url /'
|
||||
```
|
||||
|
||||
|
|
|
|||
181
apps/web/app.js
Normal file
181
apps/web/app.js
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
// every.channel web watcher
|
||||
//
|
||||
// This uses the upstream hang web component (WebTransport + WebCodecs).
|
||||
// It is intentionally dependency-light: no framework, no bundler.
|
||||
|
||||
import "https://cdn.jsdelivr.net/npm/@kixelated/hang@0.7.0/watch/element.js";
|
||||
|
||||
const DEFAULT_RELAY_URL = "https://relay.cloudflare.mediaoverquic.com/";
|
||||
|
||||
function $(id) {
|
||||
const el = document.getElementById(id);
|
||||
if (!el) throw new Error(`missing element: ${id}`);
|
||||
return el;
|
||||
}
|
||||
|
||||
function normalizeRelayUrl(s) {
|
||||
const trimmed = (s || "").trim();
|
||||
if (!trimmed) return DEFAULT_RELAY_URL;
|
||||
// Ensure trailing slash so relative fetches behave consistently.
|
||||
return trimmed.endsWith("/") ? trimmed : `${trimmed}/`;
|
||||
}
|
||||
|
||||
function normalizeName(s) {
|
||||
return (s || "").trim();
|
||||
}
|
||||
|
||||
function currentShareLink(relayUrl, name) {
|
||||
const u = new URL(window.location.href);
|
||||
u.pathname = "/watch";
|
||||
u.searchParams.set("url", relayUrl);
|
||||
u.searchParams.set("name", name);
|
||||
// Avoid leaking other params.
|
||||
for (const k of [...u.searchParams.keys()]) {
|
||||
if (k !== "url" && k !== "name") u.searchParams.delete(k);
|
||||
}
|
||||
return u.toString();
|
||||
}
|
||||
|
||||
function setHint(text, kind) {
|
||||
const el = $("hint");
|
||||
el.textContent = text || "";
|
||||
el.dataset.kind = kind || "";
|
||||
}
|
||||
|
||||
function setShareLink(text) {
|
||||
const el = $("shareLink");
|
||||
el.textContent = text || "";
|
||||
}
|
||||
|
||||
function mountPlayer(relayUrl, name) {
|
||||
const mount = $("playerMount");
|
||||
mount.textContent = "";
|
||||
|
||||
const watch = document.createElement("hang-watch");
|
||||
watch.setAttribute("url", relayUrl);
|
||||
watch.setAttribute("name", name);
|
||||
watch.setAttribute("controls", "");
|
||||
|
||||
// A canvas enables video rendering. Without it, only audio is played.
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.className = "canvas";
|
||||
watch.appendChild(canvas);
|
||||
|
||||
mount.appendChild(watch);
|
||||
}
|
||||
|
||||
async function copyToClipboard(text) {
|
||||
if (!text) return;
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return;
|
||||
}
|
||||
// Fallback: best-effort.
|
||||
const ta = document.createElement("textarea");
|
||||
ta.value = text;
|
||||
document.body.appendChild(ta);
|
||||
ta.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(ta);
|
||||
}
|
||||
|
||||
function readParams() {
|
||||
const u = new URL(window.location.href);
|
||||
const relay = u.searchParams.get("url");
|
||||
const name = u.searchParams.get("name");
|
||||
return {
|
||||
relayUrl: normalizeRelayUrl(relay || DEFAULT_RELAY_URL),
|
||||
name: normalizeName(name || ""),
|
||||
};
|
||||
}
|
||||
|
||||
function writeParams(relayUrl, name) {
|
||||
const u = new URL(window.location.href);
|
||||
u.pathname = "/watch";
|
||||
u.searchParams.set("url", relayUrl);
|
||||
u.searchParams.set("name", name);
|
||||
window.history.replaceState({}, "", u.toString());
|
||||
}
|
||||
|
||||
function hasWebTransport() {
|
||||
return typeof window.WebTransport !== "undefined";
|
||||
}
|
||||
|
||||
function main() {
|
||||
const relayInput = $("relayUrl");
|
||||
const nameInput = $("broadcastName");
|
||||
const watchBtn = $("watchBtn");
|
||||
const copyBtn = $("copyLinkBtn");
|
||||
|
||||
const initial = readParams();
|
||||
relayInput.value = initial.relayUrl;
|
||||
nameInput.value = initial.name;
|
||||
|
||||
function updateSharePreview() {
|
||||
const relayUrl = normalizeRelayUrl(relayInput.value);
|
||||
const name = normalizeName(nameInput.value);
|
||||
if (!name) {
|
||||
setShareLink("");
|
||||
return;
|
||||
}
|
||||
setShareLink(currentShareLink(relayUrl, name));
|
||||
}
|
||||
|
||||
function start() {
|
||||
const relayUrl = normalizeRelayUrl(relayInput.value);
|
||||
const name = normalizeName(nameInput.value);
|
||||
|
||||
updateSharePreview();
|
||||
|
||||
if (!name) {
|
||||
setHint("Enter a broadcast name to watch.", "warn");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasWebTransport()) {
|
||||
setHint(
|
||||
"WebTransport is not available in this browser. Try Chrome or Firefox Nightly. Safari support is still incomplete.",
|
||||
"warn",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
writeParams(relayUrl, name);
|
||||
setHint(`Connecting to relay and subscribing: ${name}`, "ok");
|
||||
mountPlayer(relayUrl, name);
|
||||
}
|
||||
|
||||
relayInput.addEventListener("input", updateSharePreview);
|
||||
nameInput.addEventListener("input", updateSharePreview);
|
||||
|
||||
watchBtn.addEventListener("click", start);
|
||||
nameInput.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") start();
|
||||
});
|
||||
|
||||
copyBtn.addEventListener("click", async () => {
|
||||
const relayUrl = normalizeRelayUrl(relayInput.value);
|
||||
const name = normalizeName(nameInput.value);
|
||||
if (!name) {
|
||||
setHint("Enter a broadcast name first.", "warn");
|
||||
return;
|
||||
}
|
||||
const link = currentShareLink(relayUrl, name);
|
||||
try {
|
||||
await copyToClipboard(link);
|
||||
setHint("Link copied.", "ok");
|
||||
setShareLink(link);
|
||||
} catch (e) {
|
||||
setHint(`Copy failed: ${String(e)}`, "warn");
|
||||
setShareLink(link);
|
||||
}
|
||||
});
|
||||
|
||||
updateSharePreview();
|
||||
|
||||
// Auto-start if a name was provided.
|
||||
if (initial.name) start();
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
|
|
@ -9,9 +9,58 @@
|
|||
content="Watch and share free over-the-air TV. Local first, global when you want."
|
||||
/>
|
||||
<link data-trunk rel="css" href="style.css" />
|
||||
<link data-trunk rel="rust" data-wasm-opt="z" />
|
||||
<link data-trunk rel="copy-file" href="app.js" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="main"></div>
|
||||
<main class="shell">
|
||||
<header class="top">
|
||||
<div class="brand">
|
||||
<div class="brand-title">every.channel</div>
|
||||
<div class="brand-subtitle">Watch live streams over WebTransport.</div>
|
||||
</div>
|
||||
<div class="badge" title="MoQ over WebTransport">
|
||||
WebTransport
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-title">Watch</div>
|
||||
<div class="row">
|
||||
<label class="field">
|
||||
<div class="label">Relay URL</div>
|
||||
<input id="relayUrl" class="input" type="text" spellcheck="false" />
|
||||
</label>
|
||||
<label class="field">
|
||||
<div class="label">Broadcast name</div>
|
||||
<input id="broadcastName" class="input" type="text" spellcheck="false" />
|
||||
</label>
|
||||
<button id="watchBtn" class="btn">Watch</button>
|
||||
</div>
|
||||
<div class="hint" id="hint"></div>
|
||||
<div class="row share">
|
||||
<button id="copyLinkBtn" class="btn secondary">Copy link</button>
|
||||
<div class="shareLink" id="shareLink" aria-live="polite"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="player">
|
||||
<div class="tv">
|
||||
<div class="tv-glow"></div>
|
||||
<div class="tv-frame">
|
||||
<div id="playerMount" class="mount"></div>
|
||||
<div class="tv-scanlines" aria-hidden="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="foot">
|
||||
<div class="foot-left">AGPLv3</div>
|
||||
<div class="foot-right">
|
||||
For Safari: WebTransport is behind a Developer/Advanced feature flag and may be incomplete.
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
<script type="module" src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,125 +0,0 @@
|
|||
use dioxus::prelude::*;
|
||||
use wasm_bindgen_futures::JsFuture;
|
||||
|
||||
fn main() {
|
||||
dioxus::launch(App);
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn App() -> Element {
|
||||
let mut link = use_signal(|| "".to_string());
|
||||
let mut status = use_signal(|| "".to_string());
|
||||
|
||||
rsx! {
|
||||
div { class: "page",
|
||||
header { class: "top",
|
||||
div { class: "brand",
|
||||
div { class: "brand-title", "every.channel" }
|
||||
div { class: "brand-subtitle",
|
||||
"Watch and share free over-the-air TV. Local first, global when you want."
|
||||
}
|
||||
}
|
||||
nav { class: "nav",
|
||||
a { href: "#watch", "Watch" }
|
||||
a { href: "#directory", "Directory" }
|
||||
a { href: "#join", "Join" }
|
||||
a { href: "#about", "Info" }
|
||||
}
|
||||
}
|
||||
|
||||
div { class: "grid",
|
||||
section { class: "card section", id: "watch",
|
||||
div { class: "card-title", "Watch" }
|
||||
div { class: "h1", "Watch a link" }
|
||||
div { class: "p",
|
||||
"Got a link from a friend? Paste it here to copy, then open the desktop app."
|
||||
}
|
||||
div { class: "row",
|
||||
input {
|
||||
class: "input",
|
||||
placeholder: "every.channel://watch?...",
|
||||
value: "{link.read()}",
|
||||
oninput: move |evt| link.set(evt.value()),
|
||||
}
|
||||
button {
|
||||
class: "btn primary",
|
||||
onclick: move |_| {
|
||||
let value = link.read().trim().to_string();
|
||||
if value.is_empty() {
|
||||
status.set("Paste a link first".to_string());
|
||||
return;
|
||||
}
|
||||
let mut status = status.clone();
|
||||
spawn(async move {
|
||||
match copy_to_clipboard(value).await {
|
||||
Ok(_) => status.set("Copied! Open the app and paste under Watch a Link.".to_string()),
|
||||
Err(err) => status.set(format!("Copy failed: {err}")),
|
||||
}
|
||||
});
|
||||
},
|
||||
"Copy"
|
||||
}
|
||||
}
|
||||
if !status.read().is_empty() {
|
||||
div { class: "kicker",
|
||||
span { class: "dot" }
|
||||
span { "{status.read()}" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
section { class: "card section", id: "directory",
|
||||
div { class: "card-title", "Directory" }
|
||||
div { class: "h1", "Find channels from people you trust" }
|
||||
div { class: "p",
|
||||
"The directory is opt-in. You choose what to share and who to connect with."
|
||||
}
|
||||
div { class: "kicker",
|
||||
span { class: "dot" }
|
||||
span { "Enable Nearby or Public reach in the app to find others." }
|
||||
}
|
||||
}
|
||||
|
||||
section { class: "card section", id: "join",
|
||||
div { class: "card-title", "Join" }
|
||||
div { class: "h1", "Run your own" }
|
||||
div { class: "p",
|
||||
"Anyone can watch, share, and relay. Works with HDHomeRun, Linux TV tuners, and live streams."
|
||||
}
|
||||
div { class: "kicker",
|
||||
span { class: "dot" }
|
||||
span { "Desktop app and CLI available now." }
|
||||
}
|
||||
}
|
||||
|
||||
section { class: "card section", id: "about",
|
||||
div { class: "card-title", "About" }
|
||||
div { class: "h1", "A small promise" }
|
||||
div { class: "p",
|
||||
"TV signals are just waves in the air. This project makes it easier to pick them up and share them with others."
|
||||
}
|
||||
div { class: "kicker",
|
||||
span { class: "dot" }
|
||||
span { "Open source. No central server." }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
footer { class: "footer",
|
||||
span { "AGPLv3" }
|
||||
span { "every.channel" }
|
||||
a { href: "https://every.channel", "every.channel" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn copy_to_clipboard(text: String) -> Result<(), String> {
|
||||
let window = web_sys::window().ok_or_else(|| "window unavailable".to_string())?;
|
||||
let clipboard = window.navigator().clipboard();
|
||||
let promise = clipboard.write_text(&text);
|
||||
JsFuture::from(promise)
|
||||
.await
|
||||
.map_err(|err| format!("clipboard write rejected: {err:?}"))?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1,285 +1,272 @@
|
|||
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500&display=swap");
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg: #f8f5f0;
|
||||
--bg-muted: #f2ede5;
|
||||
--card: rgba(255, 255, 255, 0.82);
|
||||
--ink: #1a1814;
|
||||
--ink-muted: #5c574d;
|
||||
--border: rgba(26, 24, 20, 0.10);
|
||||
--shadow: 0 16px 40px rgba(26, 24, 20, 0.10);
|
||||
--accent: #18a89b;
|
||||
--accent-ink: #0c6f68;
|
||||
--warm: #d4915a;
|
||||
--warm-muted: rgba(232, 160, 92, 0.12);
|
||||
font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
|
||||
font-feature-settings: "ss01" 1;
|
||||
--bg0: #0b0f14;
|
||||
--bg1: #0f1720;
|
||||
--panel: rgba(255, 255, 255, 0.06);
|
||||
--panel2: rgba(255, 255, 255, 0.08);
|
||||
--text: rgba(255, 255, 255, 0.92);
|
||||
--muted: rgba(255, 255, 255, 0.65);
|
||||
--faint: rgba(255, 255, 255, 0.45);
|
||||
--line: rgba(255, 255, 255, 0.12);
|
||||
--accent: #ffb86c;
|
||||
--accent2: #6ee7ff;
|
||||
--ok: #7cf7a2;
|
||||
--warn: #ffd36e;
|
||||
--shadow: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
color: var(--ink);
|
||||
background: linear-gradient(168deg, #fdfaf5 0%, #f8f5f0 35%, #f4f1ec 70%, #f0ece6 100%);
|
||||
margin: 0;
|
||||
color: var(--text);
|
||||
background:
|
||||
radial-gradient(1200px 700px at 15% 10%, rgba(255, 184, 108, 0.16), transparent 55%),
|
||||
radial-gradient(900px 600px at 85% 20%, rgba(110, 231, 255, 0.12), transparent 60%),
|
||||
radial-gradient(900px 900px at 50% 120%, rgba(255, 255, 255, 0.08), transparent 55%),
|
||||
linear-gradient(180deg, var(--bg0), var(--bg1));
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
|
||||
"Segoe UI Emoji";
|
||||
}
|
||||
|
||||
/* Subtle "old TV" nod: soft phosphor glow and faint scanlines */
|
||||
body::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background-image:
|
||||
radial-gradient(ellipse 80% 60% at 15% 10%, rgba(232, 160, 92, 0.08), transparent 50%),
|
||||
radial-gradient(ellipse 60% 50% at 85% 15%, rgba(24, 168, 155, 0.06), transparent 45%),
|
||||
radial-gradient(ellipse 70% 40% at 50% 90%, rgba(232, 160, 92, 0.05), transparent 50%),
|
||||
repeating-linear-gradient(
|
||||
0deg,
|
||||
transparent 0px,
|
||||
transparent 2px,
|
||||
rgba(26, 24, 20, 0.012) 2px,
|
||||
rgba(26, 24, 20, 0.012) 4px
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#main {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.page {
|
||||
max-width: 1120px;
|
||||
.shell {
|
||||
max-width: 1100px;
|
||||
margin: 0 auto;
|
||||
padding: 24px clamp(16px, 4vw, 40px) 40px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
animation: fadeIn 0.5s ease-out;
|
||||
padding: 28px 18px 22px;
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 16px;
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
|
||||
box-shadow: 0 18px 38px var(--shadow);
|
||||
}
|
||||
|
||||
.brand-title {
|
||||
font-size: clamp(24px, 2.6vw, 30px);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.025em;
|
||||
color: var(--ink);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
font-size: 22px;
|
||||
line-height: 1.05;
|
||||
}
|
||||
|
||||
.brand-subtitle {
|
||||
font-size: 12px;
|
||||
color: var(--ink-muted);
|
||||
max-width: 44ch;
|
||||
line-height: 1.4;
|
||||
margin-top: 4px;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
text-decoration: none;
|
||||
color: var(--ink-muted);
|
||||
.badge {
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 6px 10px;
|
||||
color: rgba(0, 0, 0, 0.78);
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--border);
|
||||
background: rgba(255, 255, 255, 0.65);
|
||||
transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
transform: translateY(-1px);
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
color: var(--ink);
|
||||
box-shadow: 0 8px 20px rgba(26, 24, 20, 0.06);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
.panel {
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 16px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--card);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 18px;
|
||||
backdrop-filter: blur(12px);
|
||||
background: var(--panel);
|
||||
box-shadow: 0 18px 38px var(--shadow);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--ink-muted);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.h1 {
|
||||
font-size: clamp(16px, 1.8vw, 19px);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.015em;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.p {
|
||||
.panel-title {
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: var(--ink-muted);
|
||||
letter-spacing: 0.22em;
|
||||
text-transform: uppercase;
|
||||
color: var(--muted);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 6px;
|
||||
margin-top: 10px;
|
||||
grid-template-columns: 1.15fr 1fr auto;
|
||||
gap: 10px;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.field .label {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.input {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 8px 10px;
|
||||
font-size: 11px;
|
||||
background: rgba(242, 237, 229, 0.6);
|
||||
color: var(--ink);
|
||||
width: 100%;
|
||||
padding: 11px 12px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
background: rgba(0, 0, 0, 0.28);
|
||||
color: var(--text);
|
||||
outline: none;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.input:focus {
|
||||
outline: none;
|
||||
border-color: rgba(24, 168, 155, 0.4);
|
||||
box-shadow: 0 0 0 3px rgba(24, 168, 155, 0.08);
|
||||
border-color: rgba(255, 184, 108, 0.55);
|
||||
box-shadow: 0 0 0 3px rgba(255, 184, 108, 0.16);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
padding: 8px 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
padding: 11px 14px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(255, 184, 108, 0.35);
|
||||
background: linear-gradient(180deg, rgba(255, 184, 108, 0.22), rgba(255, 184, 108, 0.12));
|
||||
color: var(--text);
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
color: var(--ink);
|
||||
transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
|
||||
transition: transform 80ms ease, background 120ms ease, border-color 120ms ease;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 16px rgba(26, 24, 20, 0.06);
|
||||
border-color: rgba(255, 184, 108, 0.55);
|
||||
background: linear-gradient(180deg, rgba(255, 184, 108, 0.28), rgba(255, 184, 108, 0.14));
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background: var(--accent-ink);
|
||||
color: #fff;
|
||||
border-color: rgba(12, 111, 104, 0.3);
|
||||
}
|
||||
|
||||
.btn.primary:hover {
|
||||
box-shadow: 0 6px 16px rgba(12, 111, 104, 0.2);
|
||||
}
|
||||
|
||||
.kicker {
|
||||
margin-top: 8px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--warm-muted);
|
||||
color: var(--ink-muted);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--warm);
|
||||
box-shadow: 0 0 0 3px rgba(232, 160, 92, 0.2);
|
||||
}
|
||||
|
||||
.section {
|
||||
scroll-margin-top: 12px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
||||
font-size: 0.9em;
|
||||
background: rgba(26, 24, 20, 0.05);
|
||||
padding: 2px 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 6px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--border);
|
||||
font-size: 10px;
|
||||
color: var(--ink-muted);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.footer a {
|
||||
color: var(--ink-muted);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.footer a:hover {
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(4px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
.btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.top {
|
||||
flex-direction: column;
|
||||
.btn.secondary {
|
||||
border-color: rgba(255, 255, 255, 0.18);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.hint {
|
||||
margin-top: 10px;
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
min-height: 18px;
|
||||
}
|
||||
|
||||
.hint[data-kind="ok"] {
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.hint[data-kind="warn"] {
|
||||
color: var(--warn);
|
||||
}
|
||||
|
||||
.share {
|
||||
margin-top: 8px;
|
||||
grid-template-columns: auto 1fr;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shareLink {
|
||||
color: var(--faint);
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.player {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tv {
|
||||
position: relative;
|
||||
border-radius: 24px;
|
||||
padding: 18px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
background:
|
||||
radial-gradient(900px 500px at 10% 10%, rgba(255, 184, 108, 0.10), transparent 55%),
|
||||
radial-gradient(700px 500px at 90% 10%, rgba(110, 231, 255, 0.08), transparent 58%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.10));
|
||||
box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
|
||||
}
|
||||
|
||||
.tv-glow {
|
||||
position: absolute;
|
||||
inset: -40px -20px -20px -20px;
|
||||
background:
|
||||
radial-gradient(350px 220px at 18% 22%, rgba(255, 184, 108, 0.18), transparent 70%),
|
||||
radial-gradient(320px 220px at 82% 26%, rgba(110, 231, 255, 0.14), transparent 72%);
|
||||
filter: blur(18px);
|
||||
opacity: 0.95;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tv-frame {
|
||||
position: relative;
|
||||
border-radius: 18px;
|
||||
padding: 12px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.22));
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.mount {
|
||||
aspect-ratio: 16 / 9;
|
||||
width: 100%;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
background: #000;
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
.canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tv-scanlines {
|
||||
position: absolute;
|
||||
inset: 12px;
|
||||
border-radius: 12px;
|
||||
background: repeating-linear-gradient(
|
||||
to bottom,
|
||||
rgba(255, 255, 255, 0.03),
|
||||
rgba(255, 255, 255, 0.03) 1px,
|
||||
rgba(0, 0, 0, 0.00) 3px,
|
||||
rgba(0, 0, 0, 0.00) 6px
|
||||
);
|
||||
mix-blend-mode: overlay;
|
||||
pointer-events: none;
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 10px 2px 0;
|
||||
color: var(--faint);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.row {
|
||||
grid-template-columns: 1fr;
|
||||
align-items: stretch;
|
||||
}
|
||||
.nav {
|
||||
justify-content: flex-start;
|
||||
.share {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.badge {
|
||||
display: none;
|
||||
}
|
||||
.foot {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,12 @@ version = "0.0.0"
|
|||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
ffmpeg-ffi = ["dep:ac-ffmpeg"]
|
||||
|
||||
[dependencies]
|
||||
ac-ffmpeg = "0.19.0"
|
||||
ac-ffmpeg = { version = "0.19.0", optional = true }
|
||||
anyhow.workspace = true
|
||||
blake3.workspace = true
|
||||
ec-core = { path = "../ec-core" }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
//! Deterministic chunking and transcode scaffolding.
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
use ac_ffmpeg::format::{
|
||||
demuxer::Demuxer,
|
||||
io::IO,
|
||||
|
|
@ -15,6 +16,7 @@ use std::fs;
|
|||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Child, Command, Stdio};
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
use std::time::Duration;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -202,6 +204,14 @@ pub fn collect_segments(output_dir: &Path) -> Result<ChunkManifest> {
|
|||
})
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn probe_read_stream<T: Read>(_stream: T) -> Result<Vec<StreamProbe>> {
|
||||
Err(anyhow!(
|
||||
"probe_read_stream requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg) and FFmpeg headers"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn probe_read_stream<T: Read>(stream: T) -> Result<Vec<StreamProbe>> {
|
||||
let io = IO::from_read_stream(stream);
|
||||
let demuxer = Demuxer::builder()
|
||||
|
|
@ -401,6 +411,19 @@ pub fn hash_file_blake3(path: &Path) -> Result<String> {
|
|||
Ok(hasher.finalize().to_hex().to_string())
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn chunk_stream_ffmpeg<T: Read>(
|
||||
_stream: T,
|
||||
_output_dir: &Path,
|
||||
_chunk_duration_ms: u64,
|
||||
_max_chunks: Option<usize>,
|
||||
) -> Result<TsChunkManifest> {
|
||||
Err(anyhow!(
|
||||
"chunk_stream_ffmpeg requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg)"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn chunk_stream_ffmpeg<T: Read>(
|
||||
stream: T,
|
||||
output_dir: &Path,
|
||||
|
|
@ -610,6 +633,20 @@ pub fn manifest_for_ts_chunks(
|
|||
Ok((body, hashed))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ffmpeg-ffi"))]
|
||||
pub fn chunk_stream_ffmpeg_live<T: Read, F: FnMut(TsChunk) -> Result<()>>(
|
||||
_stream: T,
|
||||
_output_dir: &Path,
|
||||
_chunk_duration_ms: u64,
|
||||
_max_chunks: Option<usize>,
|
||||
_on_chunk: F,
|
||||
) -> Result<()> {
|
||||
Err(anyhow!(
|
||||
"chunk_stream_ffmpeg_live requires feature `ec-chopper/ffmpeg-ffi` (ac-ffmpeg)"
|
||||
))
|
||||
}
|
||||
|
||||
#[cfg(feature = "ffmpeg-ffi")]
|
||||
pub fn chunk_stream_ffmpeg_live<T: Read, F: FnMut(TsChunk) -> Result<()>>(
|
||||
stream: T,
|
||||
output_dir: &Path,
|
||||
|
|
|
|||
|
|
@ -24,11 +24,15 @@ reqwest = { version = "0.12", default-features = false, features = ["json", "rus
|
|||
urlencoding = "2"
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] }
|
||||
futures-util = "0.3"
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
hang = "0.14.0"
|
||||
moq-mux = "0.2.1"
|
||||
moq-native = { version = "0.13.1", default-features = true }
|
||||
url = "2"
|
||||
|
||||
[dev-dependencies]
|
||||
headless_chrome = "1"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@ use std::sync::{Arc, Mutex};
|
|||
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
|
||||
use tokio_tungstenite::tungstenite::Message as WsMessage;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use hang as hang_moq;
|
||||
use moq_mux as moq_mux_lib;
|
||||
use moq_native as moq_native_lib;
|
||||
use tokio::process::Command as TokioCommand;
|
||||
use url::Url;
|
||||
|
||||
const DIRECT_WIRE_TAG_FRAME: u8 = 0x00;
|
||||
const DIRECT_WIRE_TAG_STREAM: u8 = 0x01;
|
||||
|
|
@ -75,6 +80,8 @@ enum Commands {
|
|||
WsPublish(WsPublishArgs),
|
||||
/// Subscribe to the global one-to-many relay (`/api/stream/ws`) and capture CMAF fragments + an mp4 proof.
|
||||
WsSubscribe(WsSubscribeArgs),
|
||||
/// Publish a CMAF (fMP4) stream to a MoQ relay over WebTransport (Cloudflare preview by default).
|
||||
WtPublish(WtPublishArgs),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
|
||||
|
|
@ -394,6 +401,33 @@ struct WsSubscribeArgs {
|
|||
mp4: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
struct WtPublishArgs {
|
||||
/// Relay URL (WebTransport) to connect to.
|
||||
/// Default points at Cloudflare's MoQ technical preview relay.
|
||||
#[arg(long, default_value = "https://relay.cloudflare.mediaoverquic.com/")]
|
||||
url: String,
|
||||
/// Broadcast name to publish.
|
||||
///
|
||||
/// This should be stable so you can share:
|
||||
/// `https://every.channel/watch?url=...&name=<broadcast>`.
|
||||
#[arg(long)]
|
||||
name: String,
|
||||
/// Input URL or file for ffmpeg (e.g. HDHomeRun `http://hdhomerun.local/auto/v4.1`).
|
||||
#[arg(long)]
|
||||
input: String,
|
||||
/// If set, transcode to H.264/AAC before fragmenting to fMP4.
|
||||
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
|
||||
transcode: bool,
|
||||
/// Transmit fMP4 fragments directly (passthrough mode).
|
||||
/// When false, the importer may reframe into CMAF fragments.
|
||||
#[arg(long, default_value_t = true, action = clap::ArgAction::Set)]
|
||||
passthrough: bool,
|
||||
/// Danger: disable TLS verification for the relay.
|
||||
#[arg(long, default_value_t = false)]
|
||||
tls_disable_verify: bool,
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum IngestSource {
|
||||
/// Ingest from an HDHomeRun device.
|
||||
|
|
@ -460,6 +494,7 @@ fn main() -> Result<()> {
|
|||
Commands::DirectSubscribe(args) => run_async(direct_subscribe(args))?,
|
||||
Commands::WsPublish(args) => run_async(ws_publish(args))?,
|
||||
Commands::WsSubscribe(args) => run_async(ws_subscribe(args))?,
|
||||
Commands::WtPublish(args) => run_async(wt_publish(args))?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
@ -4191,3 +4226,147 @@ fn wait_for_stable_file(path: &Path, timeout: Duration) -> Result<()> {
|
|||
timeout
|
||||
))
|
||||
}
|
||||
|
||||
async fn wt_publish(args: WtPublishArgs) -> Result<()> {
|
||||
let relay_url = Url::parse(&args.url)
|
||||
.with_context(|| format!("invalid relay url: {}", args.url))?;
|
||||
|
||||
// Build the WebTransport client.
|
||||
let mut client_cfg = moq_native_lib::ClientConfig::default();
|
||||
if args.tls_disable_verify {
|
||||
client_cfg.tls.disable_verify = Some(true);
|
||||
}
|
||||
let client = client_cfg.init().context("failed to init moq-native client")?;
|
||||
|
||||
// Build a hang broadcast producer + catalog + fMP4 importer.
|
||||
// This matches the moq-dev/moq-cli publishing strategy, but with our own ffmpeg input.
|
||||
let origin = hang_moq::moq_lite::Origin::produce();
|
||||
|
||||
let mut broadcast = hang_moq::moq_lite::BroadcastProducer::default();
|
||||
let catalog = hang_moq::Catalog::default().produce();
|
||||
broadcast.insert_track(catalog.track.clone());
|
||||
|
||||
let mut importer = moq_mux_lib::import::Fmp4::new(
|
||||
broadcast.clone(),
|
||||
catalog.clone(),
|
||||
moq_mux_lib::import::Fmp4Config {
|
||||
passthrough: args.passthrough,
|
||||
},
|
||||
);
|
||||
|
||||
origin.publish_broadcast(&args.name, broadcast.consume());
|
||||
|
||||
tracing::info!(url=%relay_url, name=%args.name, "connecting to relay");
|
||||
let session = client
|
||||
.with_publish(origin.consume())
|
||||
.connect(relay_url)
|
||||
.await
|
||||
.context("failed to connect to relay")?;
|
||||
|
||||
// Spawn ffmpeg to generate fMP4 suitable for hang/moq-mux.
|
||||
// We keep this conservative and deterministic-ish by default:
|
||||
// - single threaded x264
|
||||
// - fixed GOP settings to reduce drift
|
||||
let mut cmd = TokioCommand::new("ffmpeg");
|
||||
cmd.arg("-hide_banner")
|
||||
.arg("-loglevel")
|
||||
.arg("error")
|
||||
.arg("-nostats")
|
||||
.arg("-fflags")
|
||||
.arg("+nobuffer")
|
||||
.arg("-flags")
|
||||
.arg("low_delay")
|
||||
.arg("-i")
|
||||
.arg(&args.input);
|
||||
|
||||
if args.transcode {
|
||||
cmd.args([
|
||||
"-c:v",
|
||||
"libx264",
|
||||
"-preset",
|
||||
"veryfast",
|
||||
"-tune",
|
||||
"zerolatency",
|
||||
"-pix_fmt",
|
||||
"yuv420p",
|
||||
"-profile:v",
|
||||
"main",
|
||||
"-g",
|
||||
"48",
|
||||
"-keyint_min",
|
||||
"48",
|
||||
"-sc_threshold",
|
||||
"0",
|
||||
"-threads",
|
||||
"1",
|
||||
"-c:a",
|
||||
"aac",
|
||||
"-b:a",
|
||||
"128k",
|
||||
"-ac",
|
||||
"2",
|
||||
"-ar",
|
||||
"48000",
|
||||
]);
|
||||
} else {
|
||||
cmd.args(["-c", "copy"]);
|
||||
}
|
||||
|
||||
cmd.args([
|
||||
"-f",
|
||||
"mp4",
|
||||
"-movflags",
|
||||
"empty_moov+frag_every_frame+separate_moof+omit_tfhd_offset",
|
||||
"pipe:1",
|
||||
]);
|
||||
|
||||
cmd.stdout(Stdio::piped());
|
||||
cmd.stderr(Stdio::inherit());
|
||||
|
||||
tracing::info!(input=%args.input, "spawning ffmpeg");
|
||||
let mut child = cmd.spawn().context("failed to spawn ffmpeg")?;
|
||||
let mut stdout = child
|
||||
.stdout
|
||||
.take()
|
||||
.ok_or_else(|| anyhow!("ffmpeg stdout unavailable"))?;
|
||||
|
||||
tracing::info!("publishing fMP4 -> hang -> relay");
|
||||
let decode_task = tokio::spawn(async move { importer.decode_from(&mut stdout).await });
|
||||
|
||||
tokio::select! {
|
||||
res = session.closed() => {
|
||||
if let Err(err) = res {
|
||||
// moq-lite errors are not always `std::error::Error`; keep this explicit.
|
||||
return Err(anyhow!("relay session closed: {err:?}"));
|
||||
}
|
||||
let _ = child.kill().await;
|
||||
Ok(())
|
||||
}
|
||||
res = decode_task => {
|
||||
match res {
|
||||
Ok(Ok(())) => {
|
||||
let status = child.wait().await.context("failed to wait for ffmpeg")?;
|
||||
if !status.success() {
|
||||
return Err(anyhow!("ffmpeg exited with {status}"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Ok(Err(err)) => {
|
||||
let _ = child.kill().await;
|
||||
Err(err).context("fmp4 import failed")
|
||||
}
|
||||
Err(err) => {
|
||||
let _ = child.kill().await;
|
||||
Err(anyhow!("import task join failed: {err}"))
|
||||
}
|
||||
}
|
||||
}
|
||||
_ = tokio::signal::ctrl_c() => {
|
||||
tracing::info!("ctrl-c; shutting down");
|
||||
session.close(hang_moq::moq_lite::Error::Cancel);
|
||||
let _ = child.kill().await;
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ routes = [
|
|||
|
||||
# Static assets built by Trunk (apps/tauri/ui -> apps/tauri/dist)
|
||||
[assets]
|
||||
directory = "../../apps/tauri/dist"
|
||||
directory = "../../apps/web/dist"
|
||||
|
||||
[[durable_objects.bindings]]
|
||||
name = "EC_API"
|
||||
|
|
|
|||
65
evolution/proposals/ECP-0063-cloudflare-moq-webtransport.md
Normal file
65
evolution/proposals/ECP-0063-cloudflare-moq-webtransport.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# ECP-0063: Cloudflare MoQ Relay + WebTransport-Only Web Watch
|
||||
|
||||
Status: Draft
|
||||
|
||||
## Decision
|
||||
|
||||
Adopt Cloudflare's MoQ relay preview as the default "global" distribution layer and make the web watcher path WebTransport-only.
|
||||
|
||||
Concrete changes:
|
||||
|
||||
1. `ec-node` gains a WebTransport MoQ publisher path that can publish a live CMAF (fMP4) stream to a relay URL (default: `https://relay.cloudflare.mediaoverquic.com/`).
|
||||
2. `every.channel` (the deployed static site) becomes a real web watcher by embedding a WebTransport-capable MoQ player component (`<hang-watch>`).
|
||||
3. The existing WebRTC/WS bootstrap directory/relay remains temporarily for compatibility, but is treated as deprecated once MoQ/WebTransport is stable.
|
||||
|
||||
## Motivation
|
||||
|
||||
The project goal is one-to-many live streaming at global scale without rebuilding a bespoke stateful SFU stack.
|
||||
|
||||
MoQ over WebTransport moves the core system boundary to:
|
||||
- publisher produces timed objects (CMAF fragments),
|
||||
- relays cache/fanout,
|
||||
- subscribers fetch via a single WebTransport session.
|
||||
|
||||
This aligns the "global watcher" story with an infrastructure-native model rather than point-to-point rendezvous.
|
||||
|
||||
## Scope
|
||||
|
||||
In scope for this ECP:
|
||||
- "Watch from the web" using WebTransport to a MoQ relay.
|
||||
- "Publish from a node" to the relay, using ffmpeg to create fMP4 fragments.
|
||||
- A shareable link format for `every.channel` to open a specific relay + broadcast name.
|
||||
|
||||
Out of scope (explicitly deferred):
|
||||
- Global discovery/index of broadcasts.
|
||||
- Manifest signing / Merkle availability / anti-junk (separate ECPs already exist).
|
||||
- Safari support guarantees (implement anyway; provide guidance/flag notes).
|
||||
- Multi-variant ladders and ABR (follow-on ECP once single-variant publish/watch works end-to-end).
|
||||
|
||||
## Technical Notes
|
||||
|
||||
### Relay default
|
||||
|
||||
Default relay endpoint is:
|
||||
- `https://relay.cloudflare.mediaoverquic.com/`
|
||||
|
||||
Nodes may override via CLI flags for self-hosted relays or future Cloudflare relay endpoints.
|
||||
|
||||
### Web player
|
||||
|
||||
Use the `@kixelated/hang` web component:
|
||||
- `<hang-watch url="..." name="..." controls>`
|
||||
|
||||
This is WebTransport + WebCodecs based, and is expected to interoperate with Cloudflare's current relay preview.
|
||||
|
||||
### Share link
|
||||
|
||||
Web share link:
|
||||
- `https://every.channel/watch?url=<relay-url>&name=<broadcast-name>`
|
||||
|
||||
## Rollout / Reversibility
|
||||
|
||||
- Keep existing `/api/*` bootstrap endpoints during migration.
|
||||
- Make the web site prefer MoQ/WebTransport; keep legacy paths hidden behind "advanced" until removed.
|
||||
- Reversible by switching the deployed assets back to the previous UI build, and/or pointing users at the legacy paths.
|
||||
|
||||
|
|
@ -66,6 +66,8 @@
|
|||
] ++ lib.optionals stdenv.isLinux linuxTauriDeps;
|
||||
|
||||
shellHook = ''
|
||||
# Ensure nix-provided tools win over any host-local installs (e.g. a wrong-arch trunk).
|
||||
export PATH=${pkgs.trunk}/bin:$PATH
|
||||
export FFMPEG_INCLUDE_DIR=${pkgs.ffmpeg.dev}/include
|
||||
export FFMPEG_LIB_DIR=${pkgs.ffmpeg.lib}/lib
|
||||
export LLVM_COV=${pkgs.llvmPackages.llvm}/bin/llvm-cov
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue