【问题标题】:Spotify Play Button width and height locked to arbitrary aspect ratioSpotify 播放按钮的宽度和高度锁定为任意纵横比
【发布时间】:2012-04-12 05:44:48
【问题描述】:

我注意到我无法为 Spotify 播放按钮选择任何我想要的宽度和高度组合。如果我使用生成器工具并增加宽度,它会自动增加高度字段以匹配任意纵横比。因此,我永远无法真正获得所需的确切宽度和高度(即使在开发人员页面上指定的最小值和最大值内)。

我需要的是 440 像素的宽度和 720 像素的高度。当我将 iframe 中的宽度和高度设置为 440 x 720 时,它实际上以 440 x 520 呈现。

有修复的计划吗?

【问题讨论】:

  • 这里有 Spotify 开发者吗?关于这个错误的说法是什么?

标签: spotify


【解决方案1】:

我在自定义 spotify 播放按钮时遇到了同样的问题。 我通过将自定义样式传递给 iframe 对象解决了这个问题:

style="width:480px; height:480px; margin-top:5px; margin-left:15px; margin-bottom:21px;"

例如:

<iframe src="https://embed.spotify.com/?uri=spotify:user:sharemyplaylists.com:playlist:0QoIyI6lLs5IfZMjOf5aNK&amp;theme=white" frameborder="0" allowtransparency="true" style="width:600px; height:680px; margin-top:5px; margin-left:15px; margin-bottom:21px;"></iframe>

我知道它没有这样记录,但它对我有用。

【讨论】:

    【解决方案2】:

    我不相信这实际上是一个错误;您可以 - 正如 jackj4ck 所说 - 将样式属性添加到嵌入代码中,或者只是更改嵌入代码为您提供的高度和宽度属性。

    EG:

    <iframe src="https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>
    

    会变成:

    <iframe src="https://embed.spotify.com/?uri=spotify:track:4bz7uB4edifWKJXSDxwHcs" width="440" height="720" frameborder="0" allowtransparency="true"></iframe>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-01
      • 1970-01-01
      • 2013-08-26
      • 1970-01-01
      • 2016-05-18
      • 2021-06-23
      • 2014-02-19
      • 2016-04-01
      相关资源
      最近更新 更多