Skip to content

Conversation

marcbenedi
Copy link

Hi,

I had been experiencing this issue for a while aswell #260 .

This PR adds support to videos included with obsidian syntax (which were not rendered before)

![[myVideo.mp4]]

And copies the video file when exporting the slides. It also copies the file if it is embedded using html code. For example:

<video data-autoplay="" controls="" loop="" height="700" data-paused-by-reveal="">
  <source src="/99-Attachments/2023-09-12_jumping_jacks.mp4" type="video/mp4">
</video>

@jericjan
Copy link

![[myVideo.mp4]] seems to default with loop enabled. is it possible to implement some way to disable it without using the video HTML tag? Maybe something like ![[myVideo.mp4|noloop]]

@marcbenedi
Copy link
Author

![[myVideo.mp4]] seems to default with loop enabled. is it possible to implement some way to disable it without using the video HTML tag? Maybe something like ![[myVideo.mp4|noloop]]

Hey @jericjan, good catch!

I hardcoded some attributes which should not be there. I updated the PR. Now the generated html only contains the following:

<video> <source src="example.mp4" alt="" type="video/mp4"></video>

To modify it, we can use the same "element annotation" feature used in images or others: https://mszturc.github.io/obsidian-advanced-slides/extend-syntax/classes/

For example:

![[example.mp4]] <!-- element data-autoplay -->

Generates

<video data-autoplay="true"> <source src="example.mp4" alt="" type="video/mp4"></video>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants