How do I go about embedding a youtube chromeless player without adding controls?

后端 未结 5 396
暗喜
暗喜 2021-01-05 12:26

I am creating an online experiment. It involves participants watching a video then answering a questionnaire. I would like to embed a chromeless youtube video which plays au

5条回答
  •  礼貌的吻别
    2021-01-05 12:49

    You can use SWF objects to embed your chromeless player. You must add this js library in your html:

    
    

    then in your main js file you call the embedSWF method:

    var params = { allowScriptAccess: "always" };
    var atts = { id: "myytplayer" };
    swfobject.embedSWF("http://www.youtube.com/v/FeJkDewhTEw?enablejsapi=1&playerapiid=ytplayer&version=3&controls=0&showinfo=0",
                       "ytapiplayer", "425", "356", "8", null, null, params, atts);
    

    If you don't want any controls or info, just set controls=0 and showinfo=0 in the url

    See: https://developers.google.com/youtube/js_api_reference#GettingStarted

提交回复
热议问题