Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy videos at export time and support videos using obsidian syntax #261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

None yet

2 participants