media
module
There are a few media components provided by media
module.
iframe
: Embed an iframe in the document.video
: Embed a video in the document.audio
: Embed an audio in the document.div
: Embed a div in the document.
Example:
#media.iframe(
outer-width: 640pt,
outer-height: 360pt,
attributes: (
src: "https://player.bilibili.com/player.html?aid=80433022&bvid=BV1GJ411x7h7&cid=137649199&page=1&danmaku=0&autoplay=0",
scrolling: "no",
border: "0",
width: "100%",
height: "100%",
frameborder: "no",
framespacing: "0",
allowfullscreen: "true",
),
)
#media.iframe(
outer-width: 640pt,
outer-height: 360pt,
attributes: (
src: "https://player.bilibili.com/player.html?aid=80433022&bvid=BV1GJ411x7h7&cid=137649199&page=1&danmaku=0&autoplay=0",
scrolling: "no",
border: "0",
width: "100%",
height: "100%",
frameborder: "no",
framespacing: "0",
allowfullscreen: "true",
),
)
Check the Multimedia Components to see the result of the above code.
Explaination:
outer-width
andouter-height
gives a the size to render at the position. You can either use theshiroa.page-width
orstd.layout
to determine a proper size.- The
media
components currently doesn't get render in PDF output, so you have to provide the alternative content whenis-pdf-target
istrue
.