mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 03:37:53 +01:00
add media control stuff :3
This commit is contained in:
parent
84057e8649
commit
92fd9c8f0f
1 changed files with 10 additions and 0 deletions
|
@ -693,6 +693,16 @@ background-color: #0000;
|
||||||
video.on('volumechange', syncVolume);
|
video.on('volumechange', syncVolume);
|
||||||
audio.addEventListener('volumechange', syncVolumeWithVideo);
|
audio.addEventListener('volumechange', syncVolumeWithVideo);
|
||||||
|
|
||||||
|
// Listen for media control events
|
||||||
|
document.addEventListener('play', () => {
|
||||||
|
video.play();
|
||||||
|
audio.play();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('pause', () => {
|
||||||
|
video.pause();
|
||||||
|
audio.pause();
|
||||||
|
});
|
||||||
document.addEventListener('fullscreenchange', () => {
|
document.addEventListener('fullscreenchange', () => {
|
||||||
if (!document.fullscreenElement) {
|
if (!document.fullscreenElement) {
|
||||||
video.pause();
|
video.pause();
|
||||||
|
|
Loading…
Reference in a new issue