diff --git a/src/animation.jl b/src/animation.jl index d05c92e3..7e5f9a8e 100644 --- a/src/animation.jl +++ b/src/animation.jl @@ -21,9 +21,9 @@ function frame(anim::Animation, plt::P=current()) where P<:AbstractPlot push!(anim.frames, filename) end -giffn() = (isijulia() ? "tmp_"*randstring()*".gif" : tempname()*".gif") -movfn() = (isijulia() ? "tmp_"*randstring()*".mov" : tempname()*".mov") -mp4fn() = (isijulia() ? "tmp_"*randstring()*".mp4" : tempname()*".mp4") +giffn() = (isijulia() ? "tmp.gif" : tempname()*".gif") +movfn() = (isijulia() ? "tmp.mov" : tempname()*".mov") +mp4fn() = (isijulia() ? "tmp.mp4" : tempname()*".mp4") mutable struct FrameIterator itr @@ -104,13 +104,18 @@ end # write out html to view the gif function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif) ext = file_extension(agif.filename) - write(io, if ext == "gif" - "" + if ext == "gif" + html = "" elseif ext in ("mov", "mp4") - "" + mimetype = ext == "mov" ? "video/quicktime" : "video/mp4" + html = "" else error("Cannot show animation with extension $ext: $agif") - end) + end + + write(io, html) return nothing end