【问题标题】:How can I use this jQuery plugin with my custom Spotify Application?如何将此 jQuery 插件与我的自定义 Spotify 应用程序一起使用?
【发布时间】:2013-03-07 17:49:57
【问题描述】:

我目前有一个我正在使用的 jQuery 插件,它被设置为使用这样的歌曲/曲目:

//Using an audio object
var a = new Audio();
a.src = 'somesong.mp3';
customPlayer.load( a );

它还支持以下选项:

//Using an audio element on the page
customPlayer.load( document.getElementsByTagName('audio')[0] );

//Using a config object and you only have one encoding
customPlayer.load({ src: 'somesong.mp3' });

//Using a config object, and you have an ogg and mp3 version
customPlayer.load({ src: 'somesong', codecs: [ 'ogg', 'mp3' ]});

我正在想办法将它与 Spotify 曲目一起使用!...任何想法/建议将不胜感激。

【问题讨论】:

    标签: javascript jquery jquery-plugins spotify html5-audio


    【解决方案1】:

    Spotify 的 API 不以任何方式支持 HTML5 音频,包括播放 mp3 文件或类似文件的外部音频以及使用 HTML5 音频元素来控制播放器。 Spotify 播放器 API 只是指示客户端播放您想要的曲目,而不是将其托管在 HTML5 音频元素中。

    做你想做的唯一方法是创建一个与 jQuery Audio 类具有相同接口的包装类,但调用 Spotify API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多