I'm trying to build a live feed in React, and have hit a perf issue regarding autolooping videos, as there's no API to automatically pause them when the video has gone out of view in the viewport.
Facebook have solved this fairly efficiently by (what it looks like) unmounting the video when out of view, and remounting when it comes back into view.
I'm trying to mimic this behaviour, but i'm not sure where to start. Is it even possible to unmount and remount components at will?
Does anyone have any suggestions to tackling this issue?
Plugins and code snippets definitely welcome!!