Fix 'corrupt video' error when posting .webm from Safari.

This commit is contained in:
ccd0 2015-07-05 03:16:14 -07:00
parent f5c7779d33
commit 50aebd3ddd

View File

@ -207,6 +207,8 @@ QR.post = class
readFile: ->
isVideo = /^video\//.test @file.type
el = $.el(if isVideo then 'video' else 'img')
return if isVideo and !el.canPlayType @file.type
event = if isVideo then 'loadeddata' else 'load'
onload = =>
$.off el, event, onload