【问题标题】:Embed soundcloud player with url使用 url 嵌入 soundcloud 播放器
【发布时间】:2020-05-03 21:22:34
【问题描述】:

我实际上是在一个网站上工作,用户将在该网站上放置他们曲目的 soundcloud 链接,并且网站上会直接有一个播放器。问题是我还没有找到任何关于如何仅通过链接嵌入 soundcloud 播放器的解决方案。我不能要求我的用户给我 iframe 链接,我想这不会是严重的。

提前感谢大家!

【问题讨论】:

标签: php html embed


【解决方案1】:

I can't ask my users to give me the iframe link。您可以使用 javascript 更改 iframe src。只需给iframe 一个ID。然后用js编写链接,将用户的部分插入到字符串中,赋值给src

【讨论】:

  • 不知道为什么这会被否决,如果我要提出一个解决方案,它或多或少会是@GetSet 刚刚输入的内容,所以为了不冗余,我不会进一步贡献跨度>
  • 感谢您的回答!是的,我实际上将链接存储在数据库中,并使用 php 将其放入 src,但对于 soundcloud 播放器,src 链接不是曲目的链接。这是一个修改后的特定链接,如下所示:src="w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/…" 我不知道如何获得这样的链接
  • @TomSabatier soundcloud api 的 php 包装器可能只是解决您为播放器转换链接的其他问题。查看这些链接。不过也要做更多的研究。 github.com/mptre/php-soundcloud , developers.soundcloud.com/docs#resolving
猜你喜欢
  • 1970-01-01
  • 2015-09-07
  • 2021-12-22
  • 2022-12-28
  • 2013-01-19
  • 2017-01-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多