youtube播放器iframe嵌入

时间:2013-09-15 19:20:26

标签: youtube youtube-api

我正在使用youtube embed api将视频添加到我的网站https://developers.google.com/youtube/iframe_api_reference

var player = new YT.Player(playerEl, {
            width: "450",
            height: "250",
            controls : 0,
            showinfo : 0,
            videoId: videoId,
        });

问题是我不想在我的视频上显示视频信息和控件......但我无法让这个工作。有没有办法删除iframe嵌入的信息和控件?

1 个答案:

答案 0 :(得分:2)

试试这个:

  var player = new YT.Player(playerEl, {
        width: "450",
        height: "250",
        videoId: videoId,
        playerVars: {
        controls: "0",
        showinfo: "0"
        }
    });