diff --git a/assets/js/image_expansion.js b/assets/js/image_expansion.js index b0e4b318..abf7c595 100644 --- a/assets/js/image_expansion.js +++ b/assets/js/image_expansion.js @@ -160,13 +160,19 @@ function bindImageForClick(target) { function bindImageTarget() { const target = document.getElementById('image_target'); - if (target) { - pickAndResize(target); - bindImageForClick(target); - window.addEventListener('resize', () => { - pickAndResize(target); - }); + if (!target) return; + + pickAndResize(target); + + if (target.dataset.mimeType === 'video/webm') { + // Don't interfere with media controls on video + return; } + + bindImageForClick(target); + window.addEventListener('resize', () => { + pickAndResize(target); + }); } export { bindImageTarget };