嵌入的YouTube视频在iframe HTML中不可用 [英] Embeded YouTube video not available in iframe HTML

查看:70
本文介绍了嵌入的YouTube视频在iframe HTML中不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个嵌入式YouTube视频列表.我的问题是,我显示的四个视频中有一个返回错误:视频不可用.

I have a list of embedded youtube videos. My problem is that out of the four videos I display one returns the error: Video not available.

我尝试过更改浏览器,但是它也不起作用.我还检查了视频是否允许嵌入到外部.如果我查看浏览器的控制台,则不会抛出异常.

I have tried changing the browser, but it doesn't work either. I have also checked if the video allows being embedded on external sides. If I look at the console of my browser no exception is thrown.

    <li class="col-sm-3 col-xs-6 single_item vid">
    <iframe width="100%" height="315" src="https://www.youtube.com/embed/KdbDDVcw7qc?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
    <figcaption class="overlay">
    </figcaption>
    </li>

有任何想法吗,为什么这个视频不起作用,而其他所有人都可以呢?

Has anyone an idea, why this video doesn't work, but all others do?

推荐答案

YouTube禁止在没有公共域的情况下将某些视频嵌入到 localhost环境中,但是通过公共域/子域使用网络托管应用或在线html工具尝试相同的操作.

YouTube forbids embedding some videos in a localhost environment without a public domain, but your video can be embedded with no issue through a public domain/ sub-domain try the same using webhosting apps or online html tools.

这篇关于嵌入的YouTube视频在iframe HTML中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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