SoundCloud API v3 Stream 在 Chrome 中不起作用 [英] SoundCloud API v3 Stream not working in Chrome

查看:28
本文介绍了SoundCloud API v3 Stream 在 Chrome 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月来我一直试图让它发挥作用,但它仍然无法正常工作.它在除 Google Chrome 之外的所有浏览器中都能正常工作.问题是音频无法在 Chrome 中流式传输.

I have been trying to get this to work for months but it's still not working. It works fine in all browsers except Google Chrome. The problem is audio doesn't stream in Chrome.

这是最基本示例的 JS 小提琴.https://jsfiddle.net/sq23uxqs/

Here's a JS fiddle of the most basic example. https://jsfiddle.net/sq23uxqs/

首先我包含新的 javascript SDK

First I include the new javascript SDK

 <script src="https://connect.soundcloud.com/sdk/sdk-3.0.0.js"></script>

然后在我的 Javascript 中

Then in my Javascript

 SC.initialize({
            client_id: "78c2f0ffbef212328769a921e5663879"
          });


 SC.stream('/tracks/293').then(function(player){
         player.play();
 });

有谁知道这是为什么或者是 API 的问题吗?

Does anyone know why this is or is it a problem with the API?

推荐答案

经调查,似乎与 flash 播放器的问题有关.证明是,如果您访问 chrome://plugins/并禁用 Flash 播放器,它将在 Chrome 中再次运行.但很明显,在开发网站时,您不希望该网站只为您服务.

After investigation it seems to be related to issues with the flash player. Proof is that if you go here chrome://plugins/ and disactivate the flash player it will work again in Chrome. But obviously when developing a site you don't want the site to work just for you.

Soundcloud Api 似乎使用 soundmanager2 作为基础来处理本身具有 2 种模式 flash 和 html5 的音频流.问题是,如果 Flash 播放器可用,它将尝试使用它并失败,而如果它不可用,它将只使用 html5 并立即工作.

Soundcloud Api seems to use soundmanager2 as a base to handle audio stream that itself have 2 modes flash and html5. The issue is that if the flash player is avaible it will try to use it and fail while if it's not available it will just use html5 and work right away.

https://github.com/soundcloud/soundcloud-javascript/issues/39

这篇关于SoundCloud API v3 Stream 在 Chrome 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆