如何将视频从 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 驱动器嵌入到网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

相关文档推荐

opening html from google drive(从谷歌驱动器打开 html)
Google apps script get range of bytes from binary file(谷歌应用程序脚本从二进制文件中获取字节范围)
Sending Multiple attachments with Google Script from Google Drive(使用 Google 脚本从 Google Drive 发送多个附件)
Distributing Google Apps Scripts for Sheets in your company network(在您的公司网络中分发适用于表格的 Google Apps 脚本)
Upload file to my google drive from anyone using javascript(使用 javascript 将文件从任何人上传到我的谷歌驱动器)
quot;Shared Drivequot; support in Google Apps Script(“共享驱动器Google Apps 脚本中的支持)