zzarcon / video-snapshot

Get snapshots from a video file in the browser :movie_camera: :sunrise:
https://zzarcon.github.io/video-snapshot
MIT License
91 stars 16 forks source link

Fix for non-H264 videos #25

Closed fredguile closed 3 years ago

fredguile commented 3 years ago

I've noticed that when working with MP4/MOV files whose video codec isn't supported by the browser (I'm trying a MP4/MOV embedding HEVC for instance), the created video object would have empty dimensions, hence the library would create a canvas for nothing, draw nothing into it and return the string "data:;".

I suggest that we instead throw an error, assuming that our consumers are already catching them in a try/catch block.