francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.58k stars 161 forks source link

Is there a way to add <video> support? #154

Open damirkotoric opened 4 years ago

damirkotoric commented 4 years ago

Great library. I'd love to do the same effect but for video tags. Is there a way of doing this?

I have some autoplaying screen recordings like so:

<video src="..." autoplay muted loop></video>

And it'd be great if these videos had the same zoom functionality as the rest of the images on the page. And I don't want to use GIF images because of quality.

I tried setting data-zoomable on the video tags but that didn't do anything.

wzhkobe2408 commented 3 years ago

@damirkotoric this is the source code in utils.js. If you want to support video, you can try to modify it with export const isSupported = node => node.tagName === 'IMG' || node.tagName === 'VIDEO'

source code

export const isSupported = node => node.tagName === 'IMG'