| β¦ | β¦ | @@ -0,0 +1,65 @@ | |
| 28 | + | const element = container.current; | |
| 29 | + | if (!element) return; | |
| 30 | + | const observer = new IntersectionObserver((entries) => { | |
| 31 | + | setVisible(entries.some((entry) => entry.isIntersecting)); | |
π‘ Medium files/InlineAudioPreview.tsx:31
Scrolling an audio preview out of view resets its playback position: this sets visible to false, makes src undefined, and unmounts AudioPreview, so scrolling back creates a new audio element at the beginning. Keep visible true after the preview first intersects so scrolling offscreen doesn't discard playback state.
No longer relevant as of 6c00dcbd0f65a28f705b0b79f217fcb5e7dccd74