-
Notifications
You must be signed in to change notification settings - Fork 21
Feature request: Enable svg elements with video
embeds
#242
Comments
Hi, typst.ts already supports that feature. It is here: https://github.com/Myriad-Dreamin/typst.ts/blob/5121d2e9c093c9ff24bd5ebb593bdea8e28c7d77/exporter/svg/src/lib.rs#L54-L55 /// Whether to enable inlined svg.
const ENABLE_INLINED_SVG: bool; The inlined SVGs are those SVG elements directly put in the parent SVG. That means you can embed any HTML code in an inlined SVG. See for a use case: https://github.com/Myriad-Dreamin/typst.ts/blob/main/fuzzers/corpora/visualize/video_00.typ This is an embedded video.
#xhtml(outer-width: 640pt, outer-height: 360pt, ```html
<iframe
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"
></iframe>
```) However, this feature is disabled. The only blocking thing is that since I feel I don't have some practical idea to do sanitizing on HTML inputs for security consideration. It would be appreciate if we can discuss and find a way on how to make it secure in this issue. @ntjess |
Interesting, thanks for the information. I also see why it would be advantageous to keep this feature disabled until Typst natively supports HTML. In the meantime, how do you feel about only allowing inline previews in the vscode extension, keeping them disabled in the compiler itself? They can be exposed via an
Disadvantage:
Option 2: support an
Disadvantages:
|
I think we can add a cli arg to control whether to enable |
Would it be at all possible to support
video
in the preview pane? Consider the following SVG image:typst-preview
is happy to render the stand-in video viewer, but since the data is converted to animage
, the video of course does not play:It would be a tremendous utility for
polylux
slides to embed video content in this manner, as I am already using the browser slide preview to display the presentation. For this reason, it is acceptable that embeds will not work in the exported SVG or PDF -- especially since I can simply wrap the image in alink
that refers to the original file.One method is to add a vscode setting to specify the name of a label attached to video content:
would then indicate the image should not be base64 but rather directly inserted.
Alternatively, is there any user-facing API to perform this sort of conversion independent from the core previewer? As far as I can tell, labels are not associated with object IDs in the browser preview, so there's no way to know from the user side where to make a replacement:
Thanks!
The text was updated successfully, but these errors were encountered: