[morethanwords/tweb/master](https://github.com/morethanwords/tweb/tree/master) • [d232274](https://github.com/morethanwords/tweb/commit/d23227488212bd377ae49408994a7e9e1d4b79ef) • _1 files, +10/-12_
Fix voice waveform dropped for non-standard (62-byte) waveforms

decodeWaveform read each 5-bit sample via DataView.getUint16, which
over-reads one byte past the needed one. For a 62-byte / 99-sample
waveform the last sample's read landed out of bounds, threw a
RangeError, and the catch returned an empty array — so the whole
waveform silently failed to render (flat line). Standard 63-byte
waveforms have a spare trailing byte and happened to work.

Read the two bytes manually with a bounds-guarded high byte instead;
output is bit-identical for 63-byte waveforms and now correct for
shorter ones. Also fixes the latent byteOffset bug in the old
new DataView(waveform.buffer) on view-backed arrays.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

[morethanwords/tweb/master](https://github.com/morethanwords/tweb/tree/master) • [29ce0b6](https://github.com/morethanwords/tweb/commit/29ce0b6a17f5e294f38fb4d00dc22dc5a17a5329) • _5 files, +106/-16_
Pause video avatars when not visible (incl. right sidebar closed)

Video avatars kept animating while off-screen and, notably, while sitting in
the right sidebar after it was slid closed — the column is hidden with a
transform but stays mounted, so an IntersectionObserver never reports it as
hidden.

- avatarNew: register avatar <video>s with animationIntersector instead of an
  ad-hoc IntersectionObserver (pauses on off-screen / blur / idle / lite-mode,
  resumes when visible, survives Document-PiP). Covers both the chat-list /
  topbar overlay and the profile-carousel / service-bubble path, which had no
  visibility gating at all.
- animationIntersector: add toggleVideosUnder(element, paused) to pause+lock
  (or resume) every registered video inside a container.
- sidebarRight: pause/resume the column's avatar videos on hide()/show(), since
  the transform-based hide is invisible to the observer.
- peerProfileAvatars: self-suspend the tab-progress rAF loop when the active
  video isn't advancing (restart on a captured 'play' / carousel nav), and free
  the carousel's registered videos on cleanup so a video locked while the
  sidebar was closed can't leak when the profile is torn down.
- createLoopingMutedVideo: set autoplay only after the start-frame seek so the
  clip isn't briefly flashed from frame 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

[morethanwords/tweb/master](https://github.com/morethanwords/tweb/tree/master) • [388a8b4](https://github.com/morethanwords/tweb/commit/388a8b48db2e374eb4241fc7280cc3ef11252418) • _32 files, +1260/-777_
Merge branch 'master' of [https://github.com/morethanwords/tweb](https://github.com/morethanwords/tweb)

[#webk](?q=%23webk)