GitHub页面生成器删除< video>标签 [英] GitHub pages generator removing <video> tag

查看:78
本文介绍了GitHub页面生成器删除< video>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文

我通常会设置快速的GitHub页面来记录我所做的一些开发.它们通常是非常简单的页面,我可以使用页面生成器从回购设置中生成页面.我想继续使用这种方法,因为使用jekyll移至正确的gh页对于如此简单的操作来说会产生过多的开销.

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.

最近,我遇到了一个用例,在该用例的第一部分中添加一个简单的2分钟视频非常有意义.不知道HTML视频的任何本地降价,我决定像在许多其他情况下一样直接添加HTML代码:

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>

问题

生成页面时,标签不存在,通常在不支持 video 标签的情况下发生.如果按预期方式打开chrome控制台并直接编辑HTML,则视频可以正常显示,并且可以播放,等等.

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.

我只能假定GitHub markdown引擎正在删除 video 标记,因为正在运行的上下文不支持视频(无头,不兼容的代理等).

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).

由于GitHub表示它支持将本机HTML渲染到页面中,因此没有特别的降价说明不要全力以赴",

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.

问题

有人遇到过这个问题吗?您知道是否可以在不转到Jekyll的情况下在生成的页面中包含视频标签吗?

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?

推荐答案

您可以将所有繁重的工作委派给视频托管服务.

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

优点是:

  • 他们为您完成所有html视频/flash后备
  • 它们可以根据设备/网络提供适当的编码/带宽
  • 他们有专门的CDN,可以确保良好的交货期(?取决于承运人,但你不知道)
  • 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>

这篇关于GitHub页面生成器删除&lt; video&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆