From 92fd9c8f0f1cb17026f2428f37178a78a536cca6 Mon Sep 17 00:00:00 2001 From: ashley Date: Mon, 5 Aug 2024 17:43:18 +0000 Subject: [PATCH] add media control stuff :3 --- html/poketube.ejs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/html/poketube.ejs b/html/poketube.ejs index 10bf9c9c..f8a36a6f 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -692,7 +692,17 @@ background-color: #0000; video.on('volumechange', syncVolume); 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', () => { if (!document.fullscreenElement) { video.pause();