The second parameter in the constructor for the video player is an object that specifies player options. Within that object, the playerVars property identifies player parameters. The HTML and JavaScript code below shows a simple example that inserts a YouTube player into the page element that has an id value of ytplayer. The onYouTubePlayerAPIReady() function specified here is called automatically when the IFrame Player API code has loaded. This code does not define any player parameters and also does not define other event handlers. Replace the 'ytplayer' element with an and Var firstScriptTag = document.getElementsByTagName('script') į(tag, firstScriptTag) Var tag = document.createElement('script') Load the IFrame Player API code asynchronously. YouTube player after the API code downloads. You can configure your embedded player to load a video, a playlist, or a user's uploaded videos. The following list explains these options:įor an IFrame embed, the YouTube video ID for the video that you want to load is specified in the IFrame's src URL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |