How do I go about embedding a youtube chromeless player without adding controls?
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 automatically on page load, does not have controls for participants to play around with, and loads the next page once the video finishes.
Now the autoplay/forward to next page functions are secondary and I'm not too conce开发者_如何学编程rned if I can't get them working. However I am very interested in how to embed a chromeless player. I have gone to the google playground but this code already has the controls attached. I am not very experienced at coding so I do not know what to remove from the code for none of the custom controls on the left to be displayed. Is anyone able to help me?
Thanks, Wil
When you embed the video, you can use the parameter controls=0 which will remove the buttons and make it appear chromeless.
ie the code in your embed section would include http://www.youtube.com/embed/NxLBVAq-4dg?rel=0&controls=0"
You may want to look at http://code.google.com/apis/youtube/youtube_player_demo.html it allows you configure your player so that you can embed it chrome-less on your pages.
It should be a simple copy and paste.
Yes, surprisingly, I did'nt find any Youtube page with sample code for their chromeless plugin. But there is a lot of of jquery plugin which use the chromeless plugin. You'l find a good tutorial here : http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/
You can use SWF objects to embed your chromeless player. You must add this js library in your html:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
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
JW player http://www.longtailvideo.com/players will play youtube videos without the youtube branding, I think.
精彩评论