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

Added support for embedding media files from <audio src="..."> and <video src="..."> in the self-contained mode #355

Merged
merged 11 commits into from
Jun 16, 2022

Conversation

robertfromont
Copy link
Contributor

@robertfromont robertfromont commented Jun 16, 2022

To contribute to this repo, please make sure to:

  • Sign the CLA (contributor license agreement). The CLA assistant will remind you below if you have not signed the agreement before.
  • Add a news item to NEWS.md and your name to DESCRIPTION (by alphabetical order) unless you have already been listed there.
  • Provide a URL to a live example (and even better, a couple of screenshots) if you are contributing a new theme.

Thank you!

@robertfromont
Copy link
Contributor Author

It turns out that media structured <audio src...> (rather than <audio><source src...></audio>) is more robust, so I added support for that.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

NEWS.md Outdated Show resolved Hide resolved
Co-authored-by: Yihui Xie <xie@yihui.name>
@CLAassistant
Copy link

CLAassistant commented Jun 16, 2022

CLA assistant check
All committers have signed the CLA.

@robertfromont
Copy link
Contributor Author

CLA assistant is saying:

Error

There is no CLA to sign for yihui/xaringan
(upstream request timeout)

I'll keep trying...

@yihui
Copy link
Owner

yihui commented Jun 16, 2022

It seems the CLA assistant could be extremely slow: cla-assistant/cla-assistant#872 I just tried to open https://cla-assistant.io/yihui/xaringan?pullRequest=355 and it failed to load for a few times before it finally showed up.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code could be simplified a little bit.

inst/rmarkdown/templates/xaringan/resources/js/data-uri.js Outdated Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
sprintf('<%s .*?src\\s*=\\s*"', '".*?>', c('audio', 'video', 'source')),
'<audio .*?src\\s*=\\s*"', '".*?>',
'<video .*?src\\s*=\\s*"', '".*?>',
'<source .*?src\\s*=\\s*"', '".*?>',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that you wanted to revert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the changes broke the CI tests (and my own local knit), and I don't understand the surrounding code well enough to debug it in a timely manner. I figured having it working sooner rather than later was better.

Copy link
Owner

@yihui yihui Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I know what's going on now. I meant something like

sprintf('<%s .*?src\\s*=\\s*"', c('audio', 'video', 'source')), rep('".*?>', 3)

I'll tweak this part after merging this PR. Thanks!

@yihui yihui merged commit cce9236 into yihui:master Jun 16, 2022
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.

3 participants