about summary refs log tree commit diff
path: root/src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-05-30 00:24:01 +0300
committerGitHub <noreply@github.com>2025-05-30 00:24:01 +0300
commit7b3916c8cc8fc21127b80b9732e047b5549333a9 (patch)
treeec4a967d3d4307e8229062ad67e42ca1668ee701 /src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts
parentbc42d26bc519a26bb94bddc21fa1001b74afea25 (diff)
downloadvoidsky-7b3916c8cc8fc21127b80b9732e047b5549333a9.tar.zst
Share bandwidth estimate between video instances (#8377)
Diffstat (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts')
-rw-r--r--src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts b/src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts
new file mode 100644
index 000000000..122e10aef
--- /dev/null
+++ b/src/view/com/util/post-embeds/VideoEmbedInner/bandwidth-estimate.ts
@@ -0,0 +1,11 @@
+let latestBandwidthEstimate: number | undefined
+
+export function get() {
+  return latestBandwidthEstimate
+}
+
+export function set(estimate: number) {
+  if (!isNaN(estimate)) {
+    latestBandwidthEstimate = estimate
+  }
+}