問題描述
我正在嘗試在網頁上加載視頻,并且它適用于 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 驅動器嵌入到網頁?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!