如何将Google云端硬盘中的视频嵌入网页? [英] How to embed videos from Google drive to webpage?

查看:374
本文介绍了如何将Google云端硬盘中的视频嵌入网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

这个没什么:

 < 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版本完美运作:

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

如何从Google驱动器中获取视频,以便像YouTube视频播放一样在我的网页上播放?如果它不能直接嵌入 - 可以使用什么替代方法来获得视频 - iframe显然不起作用,必须有一些替代品。



另外,任何人都知道如何使它自动播放?



谢谢 你需要使用Google云端硬盘嵌入选项。这是您正在查找的网址:
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 添加到网址中,现在它是 https://drive.google.com/file/d/1pdvh_mEnkXPKA3jivYIpYKTaoukxH5p3Yg/preview?autoplay=1


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.

THIS DOES NOTHING:

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

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>

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?

Thanks

解决方案

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>

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云端硬盘中的视频嵌入网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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