@w0s/button-media-same-play
v3.0.4
Published
Simultaneous playback button for multiple audio / video
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';
buttonMediaSamePlay(document.querySelectorAll('.js-button-media-same-play')); // `getElementById()` or `getElementsByClassName()` or `getElementsByTagName()` or `querySelector()` or `querySelectorAll()`
</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>