7

Context

I usually set up quick GitHub pages to document a few developments I do. They are usually very simple pages, which I generate from the repo settings using the Page Generator. I want to continue using this method, as moving to proper gh-pages with jekyll is too much of an overhead for something so simple.

Recently I came across a use case, where adding a simple 2 min video to the first section made a lot of sense. Not knowing any native markdown for HTML video I've decided to add the HTML code directly as I do in a lot of other situations:

<video width="640" height="400" controls preload> 
    <source src="https://github.my.company.com/Org/sample/blob/master/intro.mp4?raw=true"></source> 
</video>

Problem

When I generate the page the tag is not there, which normally happens when the video tag is not supported. If I open the chrome console and edit the HTML directly, as expected, the video shows fine and I can play it, etc.

I can only assume that GitHub markdown engine, is removing the video tag because the context in which is running does not support video (headless, non-compatible agent, whatnot).

Since GitHub says it supports native HTML into page rendering, there's no specific markdown to say "DO NOT PARSE THIS AT ALL COSTS", leaving me without many options left.

Question

Has anyone come across this issue, and do you know if it's possible to have a video tag in a generated page without moving on to Jekyll?

bitoiu
  • 6,893
  • 5
  • 38
  • 60
  • I thought I might have an answer for you as I'm hosting Camtasia-generated screencasts from my GitHub Enterprise Pages, but the embed code it is generating doesn't have the video tag. This is something that GitHub Enterprise Support should be able to answer though. – busse Sep 14 '14 at 21:28

2 Answers2

1

As a quick solution to encounter this issue: you can convert your video into gif using any converter then insert it in your markdown ex:

## Website Overview

![alt_text](path_to_the_.gif)
0

You can delegate all the heavy job to a video hosting service.

Advantages are :

  • they do all the html video / flash fallback for you
  • they can serve proper encoding / bandwith depending on device / network
  • they have specialized CDN that ensure good delivery (? depends on carrier but you cannot know)

Everybody in the industry delegates the pain of video management.

And the only code you have to add is something like this :

<iframe width="420" height="315" src="//www.youtube.com/embed/KgLfpnPdqZw" frameborder="0" allowfullscreen></iframe>
David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • all very good points, but this is not a performance or scalability question. I will try your tag to see if the generator doesn't skip it, thank you. – bitoiu Jul 28 '14 at 21:22
  • iframe doesn't render either. the nearest way seems to be to put a thumbnail and link to the original video on YT or your own host. – dcsan Dec 21 '20 at 16:52