Embed Youtube subscribe counter?

落爺英雄遲暮 提交于 2020-01-07 08:50:09

问题


How can i have the subscribe counter button like this site (http://atomsforpeace.info/) on the right on the top?


回答1:


This is not the right embed code. It should be

<div class="g-ytsubscribe" data-channel="CHANNELNAME"></div>
<script src="https://apis.google.com/js/plusone.js"></script>

Read more here iframe www.youtube.com/subscribe_embed? google plus




回答2:


Viewing the source of their page gives you the code they've used:

<iframe frameborder="0" hspace="0" marginheight="0" marginwidth="0" scrolling="no" style="position: static; top: 0px; width: 147px; margin: 0px; left: 0px; visibility: visible; height: 24px;" tabindex="0" vspace="0" width="100%" src="https://www.youtube.com/subscribe_embed?bsv&amp;usegapi=1&amp;channel=[YOUR CHANNEL NAME HERE]&amp;theme=dark&amp;hl=en-US&amp;origin=http%3A%2F%2F[YOUR HOSTNAME HERE]&amp;ic=1&amp;jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.Hm9QrP5wPuw.O%2Fm%3D__features__%2Fam%3DEQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTOJmMfO7AjAhJbN5yM-BshnzKg53Q#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Conload&amp;id=I0_1371683853533&amp;parent=http%3A%2F%2F[YOUR HOSTNAME HERE]&amp;rpctoken=33681162" data-gapiattached="true"></iframe>

(make sure you substitute for the [YOUR CHANNEL NAME HERE] and [YOUR HOST NAME HERE] blocks)



来源:https://stackoverflow.com/questions/17200605/embed-youtube-subscribe-counter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!