correct mimetype for mov
This commit is contained in:
parent
cb4702f7b8
commit
3db930cb93
@ -104,15 +104,18 @@ end
|
|||||||
# write out html to view the gif
|
# write out html to view the gif
|
||||||
function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
|
function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
|
||||||
ext = file_extension(agif.filename)
|
ext = file_extension(agif.filename)
|
||||||
write(io, if ext == "gif"
|
if ext == "gif"
|
||||||
"<img src=\"data:image/gif;base64," * base64encode(read(agif.filename)) * "\" />"
|
html = "<img src=\"data:image/gif;base64," * base64encode(read(agif.filename)) * "\" />"
|
||||||
elseif ext in ("mov", "mp4")
|
elseif ext in ("mov", "mp4")
|
||||||
"<video controls><source src=\"data:video/$ext;base64," *
|
mimetype = ext == "mov" ? "video/quicktime" : "video/mp4"
|
||||||
|
html = "<video controls><source src=\"data:$mimetype;base64," *
|
||||||
base64encode(read(agif.filename)) *
|
base64encode(read(agif.filename)) *
|
||||||
"\" type = \"video/$ext\"></video>"
|
"\" type = \"video/$ext\"></video>"
|
||||||
else
|
else
|
||||||
error("Cannot show animation with extension $ext: $agif")
|
error("Cannot show animation with extension $ext: $agif")
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
write(io, html)
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user