asciidoc-py/asciidoc-py2

How can I embed video in github flavored asciidoc file?

repomorphic opened this issue · 3 comments

I am trying to embed youtube video in GitHub gist asciidoc file. I have tried Embedded Youtube video but it didn't work on GitHub Gist. There is no video on Github Gist view.
For example, I tried the following:

video::rPQoq7ThGAU[youtube]

And view like this:https://gist.github.com/lostdinar2/289c29e93730af3a6f798b23b89d8c42

I also have tried with raw HTML iframe but it didn't work:

++++
<iframe width="1078" height="480" src="https://www.youtube.com/embed/rPQoq7ThGAU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
++++

Well, if the iframe doesn't work then Asciidoc is also unlikely to work. Github sanitizes the HTML produced before displaying it so it may be removing the video. Perhaps look at the gist page source to see if the iframe made it through unscathed.

Thanks,this iframe work properly on html but it didn't work on github gist asciidoc file.I think that there is a issue about embedding video on github gist because other raw HTML formats work properly in github gist.

++++
<iframe width="1078" height="480" src="https://www.youtube.com/embed/rPQoq7ThGAU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
++++

I have finally noticed the problem. Content-Security-Policy is the root of the problem. Github doesn't allow https iframes. The problem is not caused by asciidoc.