Commit 6aaecc4
feat(wasm): network underrun indicator + rebuffer on recovery
When the network is too slow and the decode ring drains mid-playback,
the player previously froze silently with no user feedback.
Two improvements:
1. Visual indicator: after 2 consecutive rAF ticks with an empty ring
(≈33 ms), a pulsing "Buffering…" badge appears at the top-left of
the video. It uses a CSS class on #canvas-wrap so the last rendered
frame stays visible underneath.
2. Rebuffer on recovery: once starved, the display loop waits for
REBUFFER_FILL (2) frames to accumulate before resuming. On
resumption the timeline anchor resets (wallStart=0), so the fresh
frames re-anchor cleanly instead of cascading into pace-drops from
a stale reference.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b5fd4d5 commit 6aaecc4
2 files changed
Lines changed: 61 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1137 | 1134 | | |
1138 | 1135 | | |
1139 | 1136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
208 | 228 | | |
209 | 229 | | |
210 | 230 | | |
| |||
452 | 472 | | |
453 | 473 | | |
454 | 474 | | |
| 475 | + | |
455 | 476 | | |
456 | 477 | | |
457 | 478 | | |
| |||
891 | 912 | | |
892 | 913 | | |
893 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
894 | 925 | | |
895 | 926 | | |
896 | 927 | | |
| |||
1538 | 1569 | | |
1539 | 1570 | | |
1540 | 1571 | | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
1541 | 1596 | | |
1542 | 1597 | | |
1543 | 1598 | | |
| |||
1705 | 1760 | | |
1706 | 1761 | | |
1707 | 1762 | | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
1708 | 1766 | | |
1709 | 1767 | | |
1710 | 1768 | | |
| |||
0 commit comments