javascript - How to make a YouTube chromeless player? - Stack Overflow

This may sound stupid but I looked online for some time and I could not find how to make a YouTube play

This may sound stupid but I looked online for some time and I could not find how to make a YouTube player chromeless. I am making a web app and I am using the YouTube JavaScript API. Wherever I look online for some information on how to actually make the player chromeless, it just gives me information on how to operate with a chromeless player. Nobody addresses this question (it seems to be obvious), but I just can't figure out how to do it. Could someone please explain to me how to do it (do I need to pass a certain parameter somewhere?) Thanks.

This may sound stupid but I looked online for some time and I could not find how to make a YouTube player chromeless. I am making a web app and I am using the YouTube JavaScript API. Wherever I look online for some information on how to actually make the player chromeless, it just gives me information on how to operate with a chromeless player. Nobody addresses this question (it seems to be obvious), but I just can't figure out how to do it. Could someone please explain to me how to do it (do I need to pass a certain parameter somewhere?) Thanks.

Share Improve this question asked Nov 24, 2012 at 21:56 Gershon BallasGershon Ballas 911 silver badge4 bronze badges 3
  • Is this what you're looking for? developers.google./youtube/flash_api_reference – MacMac Commented Nov 24, 2012 at 22:00
  • This is a post about this topic that you may find useful: stackoverflow./questions/2626966/… – Matias Molinas Commented Nov 24, 2012 at 23:32
  • Possible duplicate of How do I go about embedding a youtube chromeless player without adding controls? – rogerdpack Commented Sep 10, 2017 at 6:12
Add a ment  | 

2 Answers 2

Reset to default 5

Alright, so I figured it out. So, if you are using JavaScript as I did (I believe it also works for AS3), simply, instead of writig the video ID in the URL (the one that you give to the embedswf() function), write "apiplayer". Then, after the video player has loaded, simply call the function cueVideo() on it (passing it the video ID of the video you want to show). This will make the video player chromeless.

Well first you would the HTML Code

<embed src=""/>

Now this takes the url: http://www.youtube./apiplayer?enablejsapi=1&version=3

This one doesn't take a ID due to the fact you give it one in JS on the function

onYouTubePlayerReady() 

Here is a little example

<script>
onYouTubePlayerReady = initializePlayer;
function initializePlayer(){
var video = document.getElementById('video');
video.loadVideoById(String id , int starttime , string quality);
var playbutton = document.getElementById('playbtn');
playbutton.addEventListener('click' , playVideo());
var pausebutton = document.getElementById('psbtn');
pausebutton.addEventListener('click' , pauseVideo());
}
</script>

That is the basic script, hope this works!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745177323a4615255.html

相关推荐

  • javascript - How to make a YouTube chromeless player? - Stack Overflow

    This may sound stupid but I looked online for some time and I could not find how to make a YouTube play

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信