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

inline video #25

Open
jronallo opened this issue Mar 31, 2018 · 7 comments
Open

inline video #25

jronallo opened this issue Mar 31, 2018 · 7 comments

Comments

@jronallo
Copy link

https://github.com/remy/inliner now supports optional inlining of video. It would be nice to expose a similar option for backslide to inline video as well.

@jronallo
Copy link
Author

jronallo commented Apr 3, 2018

I see now that the bigger issue that nothing referenced from the Markdown is inlined. So an image referred to like this would not get inlined:

# Title

Content....

![](http://example/SCRC/image.png)

More content....

This means that the slideshow cannot be completely self-contained.

I think this is a general limitation and bigger issue with inliner + remarkjs, so I'm closing this issue.

@jronallo jronallo closed this as completed Apr 3, 2018
@sinedied
Copy link
Owner

sinedied commented Apr 3, 2018

@jronallo Yes, that's why custom JS scripts were added to inline images from markdown, while inliner takes care of the scripts and css.

While technically feasible, I'm not sure about inlining videos: from my tests, when the self-contained HTML file grows bigger, it tends to become much slower, and with 15MB+ HTML files it starts to lag terribly during presentations. With (often much larger) videos, I'm not sure how it would behave...

@jronallo
Copy link
Author

jronallo commented Apr 3, 2018

@sinedied Since I closed the issue I dug into the code more and found the regular expressions. I hadn't realized how the inlining was really two separate processes and that only local files would be inlined.

I've been embedding small videos in slide decks for years now and it has worked really well for me. Mostly they're short videos more like GIFs or small pew pew audio. Media does need to be compressed to not make the HTML too large. My only concern in this case is with the remark.js processing of the Markdown. Do you think the lag you've seen is due to remarkjs or maybe just the hardware and browser you're presenting in?

I thought I'd give adding the feature a try though and I've got something working by adding a couple more regular expressions to the image inlining code. The video and audio regular expressions are very naive, but they work for me. I added another CLI option for including media (video and audio) while poster image inlining is done by default.

Here's the commit:
jronallo@b0f4b5a

Would you accept a pull request something like this? Anything you'd like done differently?

I've also considered what might be done in the case where there is media in the Markdown, but the media option is not set. Maybe those files could get "exported" into a folder within dist to make it clear what all is needed to allow the presentation to work in a semi-self-contained way?

@jronallo jronallo reopened this Apr 7, 2018
@jronallo
Copy link
Author

Here's an example self-contained slide deck with a video using the code from this pull request.

https://ronallo.com/presentations/sunsetting-cni/#56

@sinedied
Copy link
Owner

Sorry I missed your previous comment! Sure I would accept a PR with these changes, I would just prefer a more explicit flag name, like --video instead of --media 😉

@jronallo
Copy link
Author

I used --media as this includes inlining <audio> elements as well. Would you prefer different options for each AV type? So --video and --audio as separate options? Or maybe a name like --av?

@sinedied
Copy link
Owner

I think a single flag is enough for both audio/video inlining, let's keep it simple :)

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

No branches or pull requests

2 participants