首页 > 解决方案 > 使用 git lfs 存储的 MP4 文件无法在 Github Pages 中播放

问题描述

我的存储库中有一个 mp4 文件,存储在 git lfs 中,我希望能够在我的网站上播放该文件。当我打开带有 github 页面的站点时,视频不可见。

任何想法发生了什么?

标签: htmlcssgithub-pages

解决方案


您可以在git-lfs/git-lfs issue 1342中看到建议的解决方法:“GitHub pages serving the reference file instead of the actual binary”

最新的(从 2019 年 2 月开始):

https://media.githubusercontent.com/media/_Username_/_Project_/_Branch_/_Path_to_file_

你应该把所有的_UNDERSCORED_东西都换成你的

此项目中的示例:labcesi-strasbourg/labcesi-strasbourg.github.io提交 c53bd39

vrView.setContent({
    //image: 'V0050069.jpg',
    image: 'https://media.githubusercontent.com/media/labcesi-strasbourg/labcesi-strasbourg.github.io/master/V0050069.jpg',
    //preview:'/url/to/amazing-512.jpg',
    is_stereo: false
});

推荐阅读