function bind_ready_state(media, set) {
	listen(
		media,
		['loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'emptied'],
		() => set(media.readyState)
	);
}
@param {HTMLVideoElement | HTMLAudioElement} media
@param {(ready_state: number) => void} set