0

Is it possible with just javascript?

Or will we have to process the video on the backend before everything else?

I saw this library http://bgrins.github.io/videoconverter.js/demo/ as a possibility, but wanted to explore if other solutions were available

Anthony Chung
  • 1,467
  • 2
  • 22
  • 44

1 Answers1

1

So long as the video is not DRM protected, you can use a frame grab technique to do this.

You add a player to your page, auto play the video, grab a frame at certain point and display the frame at whatever size you want.

There is an excellent example of frame grab here: https://stackoverflow.com/a/29806483/334402

You can use CSS to hide the video.

Caveats are that it won't work for videos which are DRM protected and autoplay does not generally work on mobile devices.

Having said all this, most video services will do the thumbnail generation at the backend.

Community
  • 1
  • 1
Mick
  • 24,231
  • 1
  • 54
  • 120