var Parser = (function(){
var Parser = {}
Parser.integrations = [{
type: 'image',
regex: /\.(jpeg|jpg|gif|png|svg)(\?.*)?$/i,
fetch: function(url, done) {
var img = new Image ()
img.onload = function(){
if (!img) return
var width = img.naturalWidth, height = img.naturalHeight
img = null
done({
url: url,
type: "image",
token: "",
thumbnail: "",
title: "",
width: width,
height: height,
})
}
img.src = url
if (img.complete) {
img.onload()
}
},
tag: function (media) {
return '
';
}
}, {
type: 'video',
regex: /\.(mp4|webm)(\?.*)?$/i,
fetch: function(url, done) {
var video = document.createElement("video")
video.addEventListener("loadedmetadata", function(){
var width = video.videoWidth, height = video.videoHeight
video = null
done({
url: url,
type: "video",
token: "",
thumbnail: "",
title: "",
width: width,
height: height,
})
})
video.src = url
video.load()
},
tag: function (media) {
return '