@w0s/button-media-same-play
v2.1.0
Published
Simultaneous playback button for multiple audio / video
Downloads
16
Readme
Simultaneous playback button for multiple audio / video
- If you press the button during pause, the playback starts from the position with the lowest playback time.
- Pause if you press a button during playback.
- If all the target media elements has finished playing, start playing from the beginning.
Demo
Examples
<script type="importmap">
{
"imports": {
"@w0s/button-media-same-play": "..."
}
}
</script>
<script type="module">
import ButtonMediaSamePlay from '@w0s/button-media-same-play';
for (const targetElement of document.querySelectorAll('.js-button-media-same-play')) {
new ButtonMediaSamePlay(targetElement);
}
</script>
<button type="button" class="js-button-media-same-play"
aria-controls="video1 video2"
>Simultaneous playback</button>
<video src="video.webm" controls="" id="video1"></video>
<video src="video.webm" controls="" id="video2"></video>