使用 git lfs 存储的 MP4 文件无法在 Github Pages 中播放

2024-02-15

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

有什么想法吗?


原始答案(2019):您可以查看中提出的解决方法git-lfs/git-lfs 问题 1342 https://github.com/git-lfs/git-lfs/issues/1342:“GitHub 页面提供参考文件而不是实际的二进制文件”

The 最新的 https://github.com/git-lfs/git-lfs/issues/1342#issuecomment-467321479(自 2019 年 2 月起):

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

你应该更换所有_UNDERSCORED_东西给你的

本项目中的示例:labcesi-strasbourg/labcesi-strasbourg.github.io提交 c53bd39 https://github.com/labcesi-strasbourg/labcesi-strasbourg.github.io/commit/c53bd3990c87f3ee03fb513d9fec4e4d8ad1a529

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
});

2022 年 10 月更新:Marco https://stackoverflow.com/users/376390/marco表明这可能不再有效,并且将使用以下版本:

https://github.com/labcesi-strasbourg/labcesi-strasbourg.github.io/blob/master/V0050069.jpg?raw=true https://github.com/labcesi-strasbourg/labcesi-strasbourg.github.io/blob/master/V0050069.jpg?raw=true

换句话说:
https://github.com/\ https://github.com/%5C//blob//?raw=true

上述格式适用于各种类型的媒体(jpg、webm 等)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 git lfs 存储的 MP4 文件无法在 Github Pages 中播放 的相关文章

随机推荐