如何将视频从 Google 驱动器嵌入到网页?

How to embed videos from Google drive to webpage?(如何将视频从 Google 驱动器嵌入到网页?)
本文介绍了如何将视频从 Google 驱动器嵌入到网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在网页上加载视频,并且它适用于 YouTube 嵌入代码.但是,当我将代码中的 src 替换为视频的 Google Drive 链接(打开共享)时,什么也没有出现.我的意思是,没有错误,但它是空白的.为什么这里什么都没有出现?我怎样才能让这个谷歌驱动器视频也加载到我的网页上?我不想在 chrome 中手动粘贴 url.

I'm trying to load a video on a web page and for YouTube embed code it works. However, when I replace the src in the code with a Google Drive Link of a video (with sharing turned on), nothing comes up. I mean, there is no error but its blank. Why does nothing come up here? How can I get this Google drive video to also to load on my webpage? I dont want to have to paste the url manually in chrome.

这没有任何作用:

<html>
<head>
</head>
<body>
<iframe width="100%" height="100%" src="https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/view?usp=sharing"></iframe>
</body>
</html>

YouTube 版本完美运行:

The YouTube version works perfectly:

<html>
<head>
</head>
<body>
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/UTt33udwRw0" frameborder="0" allowfullscreen></iframe>
</body>
</html>

如何让 Google Drive 中的视频像 YouTube 视频一样在我的网页上播放?如果不能直接嵌入 - 可以使用哪些替代方案让视频出现 - iframe 显然不起作用,必须有一些替代方案.

How do I get the video from Google drive to play on my web page like how the YouTube video plays? If it cant be directly embedded - what alternatives can be used to get the video to appear - iframe is clearly not working, there must be some alternatives.

还有,有人知道如何让它自动播放吗?

Also, anyone know how to make it autoplay?

谢谢

推荐答案

您需要使用 Google Drive Embed 选项.这是您要查找的网址:https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview

You need to use the Google Drive Embed option. This is the URL you are looking for: https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview

<html>
<head>
</head>
<body>
<iframe width="100%" height="100%" src="https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview"></iframe>
</body>
</html>

您可以通过将 ?autoplay=1 附加到 URL 来使其自动播放,因此它现在是 https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview?autoplay=1.

You can make it autoplay by appending ?autoplay=1 to the URL so it is now https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview?autoplay=1.

这篇关于如何将视频从 Google 驱动器嵌入到网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Update another component when Formik form changes(当Formik表单更改时更新另一个组件)
Formik validation isSubmitting / isValidating not getting set to true(Formik验证正在提交/isValiating未设置为True)
React Validation Max Range Using Formik(使用Formik的Reaction验证最大范围)
Validation using Yup to check string or number length(使用YUP检查字符串或数字长度的验证)
Updating initialValues prop on Formik Form does not update input value(更新Formik表单上的初始值属性不会更新输入值)
password validation with yup and formik(使用YUP和Formick进行密码验证)