Skip to content

Commit

Permalink
animation: autoplay <video> in HTML (#5006)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Oct 24, 2024
1 parent 912824f commit b51c665
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PlotsBase/src/animation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
"<img src=\"data:image/png;base64,$(base64encode(read(agif.filename)))\" />"
elseif ext in ("mov", "mp4", "webm")
mimetype = ext == "mov" ? "video/quicktime" : "video/$ext"
"<video controls><source src=\"data:$mimetype;base64,$(base64encode(read(agif.filename)))\" type = \"$mimetype\"></video>"
"<video autoplay controls><source src=\"data:$mimetype;base64,$(base64encode(read(agif.filename)))\" type = \"$mimetype\"></video>"
else
error("Cannot show animation with extension $ext: $agif")
end
Expand Down

0 comments on commit b51c665

Please sign in to comment.