【问题标题】:Embed Youtube subscribe counter?嵌入 Youtube 订阅人数?
【发布时间】:2013-06-16 12:58:13
【问题描述】:

我怎样才能在右上角有类似这个网站 (http://atomsforpeace.info/) 的订阅计数器按钮?

【问题讨论】:

  • 我想知道为什么我对此投了反对票(也许有人不喜欢这个乐队?!;P)

标签: youtube-api youtube-javascript-api


【解决方案1】:

这不是正确的嵌入代码。应该是

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

在此处阅读更多信息iframe www.youtube.com/subscribe_embed? google plus

【讨论】:

    【解决方案2】:

    查看他们页面的源代码可以得到他们使用过的代码:

    <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>
    

    (确保替换 [YOUR CHANNEL NAME HERE] 和 [YOUR HOST NAME HERE] 块)

    【讨论】:

    • 完美!!! thnx 很多,顺便说一句,你能告诉我你是如何找到它的(步骤),因为我尝试通过 chrome(检查元素)但我找不到(我只找到了一部分代码)你给我的完整代码.
    猜你喜欢
    • 2012-12-02
    • 1970-01-01
    • 2018-10-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-09
    • 1970-01-01
    相关资源
    最近更新 更多