baker icon indicating copy to clipboard operation
baker copied to clipboard

How to disable media autoplay in "three-card" mode? If it not current page.

Open aspek opened this issue 13 years ago • 4 comments

Hi, Many user don't want to wait loading page in "-baker-page-screenshots" mode. I decided to use "three-card". But the problem is that the video plays automatically. It's important and I need to use it.

SampleImage

aspek avatar Jan 17 '13 04:01 aspek

Just create a javascript that listen to window.focus and window.blur so you can trigger the video when it gets visible. :)

folletto avatar Jan 17 '13 10:01 folletto

here's a coffescript snippet that works for me, with #html5-video being the ID of the embedded video:

window.addEventListener "blur", (-> $("#html5-video")[0].pause() ), true

nonuts avatar Jan 17 '13 10:01 nonuts

Oh that work. Thanks

aspek avatar Jan 17 '13 12:01 aspek

You're welcome. :)

folletto avatar Jan 17 '13 12:01 folletto