SoundCloud API v3 Stream 在 Chrome 中不起作用

编程入门 行业动态 更新时间:2024-10-28 16:17:27
本文介绍了SoundCloud API v3 Stream 在 Chrome 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

几个月来我一直试图让它发挥作用,但它仍然无法正常工作.它在除 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/sq23uxqs/

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

首先我包含新的 javascript SDK

First I include the new javascript SDK

 <script src="https://connect.soundcloud/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/soundcloud/soundcloud-javascript/issues/39

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

更多推荐

[db:关键词]

本文发布于:2023-04-18 10:02:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/935649.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不   API   SoundCloud   Chrome   Stream

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!