嵌入YouTube视频会显示UMG内容消息

时间:2014-09-11 23:21:39

标签: html5

我正在尝试从YouTube嵌入视频。当我预览页面时,我会看到一个黑屏,其中包含“此视频包含来自UMG的内容。某些网站上的播放受限制。在YouTube上观看(链接)”。该视频确实有复制书面材料,但已被删除,视频再次上传到YouTube。我仍然得到同样的错误。其他人已经能够在现场网站上传视频。我没有运行测试服务器 - 不确定这是否是问题的一部分?

<'iframe width="640" height="360" src="http://www.youtube.com/embed/3uIkI49uk8I?rel=0" 
frameborder="0" allowfullscreen></iframe>

1 个答案:

答案 0 :(得分:0)

下面的示例代码有一个视频,解释了如何删除版权限制 当我放入你的YouTube时,它想出了UMG,所以尝试视频中的步骤,代码片段也应该工作。

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>play youtube</title>
</head>
<'iframe width="640" height="360" src="http://www.youtube.com/embed/lUq0lYmJ89c?rel=0" frameborder="0" allowfullscreen>
<body>
  <!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
    <div id="player"></div>

    <script>
      // 2. This code loads the IFrame Player API code asynchronously.
      var tag = document.createElement('script');

      tag.src = "https://www.youtube.com/iframe_api";
      var firstScriptTag = document.getElementsByTagName('script')[0];
      firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

      // 3. This function creates an <iframe> (and YouTube player)
      //    after the API code downloads.`enter code here`
      var player;
      function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
          height: '390',
          width: '640',
          videoId: 'lUq0lYmJ89c',
          events: {
            'onReady': onPlayerReady,
            'onStateChange': onPlayerStateChange
          }
        });
      }

      // 4. The API will call this function when the video player is ready.
      function onPlayerReady(event) {
        event.target.playVideo();
      }

      // 5. The API calls this function when the player's state changes.
      //    The function indicates that when playing a video (state=1),
      //    the player should play for six seconds and then stop.
      var done = false;
      function onPlayerStateChange(event) {
        if (event.data == YT.PlayerState.PLAYING && !done) {
          setTimeout(stopVideo, 6000);
          done = true;
        }
      }
      function stopVideo() {
        player.stopVideo();
      }
    </script>
</body>
</html>