Skip to content

Player doesn't work in Chrome #39

Closed

Description

@sammorrisdesign-zz

I've been having issues with getting Soundcloud to play correctly in Chrome. It used to work perfectly but has recently broke, but only in Chrome. It works fine in any other browser.

I'm using v1 of the SDK, so it still has the SoundManager player. However, quick tests with the latest version of the SDK give me the same results. So while I'm planning to upgrade to the latest SDK as soon as possible that doesn't fix the issue.

I seem to be able to get around the issue by moving #sm2-container within view, and pressing play on the now visible flash player...

screen shot 2016-01-31 at 16 41 54

Then everything works as it previously did. Any ideas?

Edit – I've just put the following into a standalone document to the same results. Works in Safari, Firefox, etc... but doesn't in Chrome.

<script src="https://connect.soundcloud.com/sdk/sdk-3.0.0.js"></script>
<script>
  SC.initialize({
    client_id: '5dcb5ea7cb935713b230330006d1765e'
  });
  SC.stream('/tracks/293').then(function(player){
  player.play();
});
</script>

Activity

  1. Martin1982 commented on Feb 2, 2016

    @Martin1982

    I'm using the 1.1.x SDK as well, and I experience the same issues. When opening a page where the SDK is initialized I try the following;

    load SDK 3.0 -> Start a basic stream via the Javascript console:
    SC.stream('/tracks/293').then(function(player){ player.play(); });
    -> All ok, audio is playing

    load SDK 1.1.5 -> Start a basic stream via the Javascript console:
    SC.stream('/tracks/293', function(sound) { sound.start(); });
    -> No sound

    Could you confirm this?

  2. samjosephmark commented on Feb 5, 2016

    @samjosephmark

    Yes I'm seeing this as well for any track that attempts to play using RTMP. The SDK checks that flash is available and uses the RTMP stream, it begins to buffer and then won't play.

  3. tbachir commented on Feb 7, 2016

    @tbachir

    Any news about this bug? Any solutions? Got the same on my website, didn't found any fix... http://www.dealerdemusique.com/, works fine on any other browser.

  4. OleksiySitka commented on Feb 9, 2016

    @OleksiySitka

    Same here. No errors in console, network tab shows that track is downloaded, but no sound. My script used to work in chrome v 47, and stopped working in 48.
    Any news how to fix it?

  5. mustvlad commented on Feb 9, 2016

    @mustvlad

    Same problem here. We're using the old version of the SDK and the player doesn't make any sound, even if it's loading and all seems to work fine...

  6. mustvlad commented on Feb 15, 2016

    @mustvlad

    Any news guys? Our websites are broken still. 👎

  7. jstallworth commented on Feb 21, 2016

    @jstallworth

    Hi guys, I don't think soundcloud's ever going to fix this issue since they no longer support sdk versions prior to 3.0. I fixed it by including the latest soundmanager2 library in my application, and loading it using $.getScript in my main js file, giving me a global, already initialized HTML5-only version of the soundManager, so my songs play on chrome now.

  8. davidmoret commented on Feb 24, 2016

    @davidmoret

    Hi,
    Someone was able to force Chrome to render the player in HTML5 ? (I tried the solution jstallworth without success). Anyone know why the player widget hasn't this problem ?
    It's shame, chrome is so popular..

  9. ArthurRougier commented on Feb 27, 2016

    @ArthurRougier

    Same here... @jstallworth, could you detail your solution ? You seem to be the only one having found a workaround

  10. jstallworth commented on Feb 27, 2016

    @jstallworth

    Ok here's how I solved it. From testing in the console I found that within SC.stream() a new soundManager object was created. Typing soundManager.version into the console, I could see that it was an older version that defaults to flash, thus the problem in Chrome. From there, I figured I would have to download the newer soundManager since it would certainly default to html5 (iOS doesn't have flash). Here are the steps I took:

    1. Downloaded an up to date soundManager2 from http://www.schillmania.com/projects/soundmanager2/doc/download/
    2. Uploaded the folder to my static web directory
    3. I'm using jQuery, so I just loaded the soundManager js into my javascript document using $.getScript(url), but I'm sure these instructions will be helpful if you're not using jQuery: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/
    4. The soundManager object from that script works in Chrome, and while I'm not sure exactly why the soundManager created in SC.stream() doesn't override it, it's easy to imagine implementations of SC.stream() that would work that way.

    Let me know if this doesn't work for you/isn't clear

  11. smarchal commented on Feb 27, 2016

    @smarchal

    @jstallworth this fixed it for me too, no other changes needed in my code (e.g. http://soundgram.co).

    Thanks a million.

  12. OleksiySitka commented on Feb 29, 2016

    @OleksiySitka

    I've tried this. Doesn't work for me :( I've tried adding script as $.getScript("js/sm2/script/soundmanager2.js"); but this doesn't help, seems like SC overrides this in my case.
    I think it's time to start rewriting my script using SDK v3

  13. davidmoret commented on Mar 1, 2016

    @davidmoret

    It doesn't fixed it for me.. the soundManager object is replaced when I call SC.stream..
    @smarchal your soundgram app works fine on my firefox but not on my chrome. I'm on OSX Yossemite..

  14. Mannaio commented on Mar 1, 2016

    @Mannaio

    @jstallworth Thanks for finding out the issue, my application is using the same api from this ember application https://github.com/lrdiv/ember-soundcloud and i am having exactly the same problem in chrome, deactivating the flash it works fine, now i have to figure it out how to refactor it with soundManager2. Any help is appreciate

  15. 10 remaining items

  16. aydamacink commented on Aug 8, 2016

    @aydamacink

    @tttt-conan: Do you have a code example where you added the protocols option? Thx in advance

  17. erictran308 commented on Aug 8, 2016

    @erictran308

    @aydamacink I just remove the protocols like this

    SC.stream(song.streamURL).then(function(scPlayer) {
        if (scPlayer.options.protocols[0] === 'rtmp') {
            scPlayer.options.protocols.splice(0, 1);
        }
        scPlayer.play();
    }
    

    https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol
    You can see in the link above, this protocol tells the browser (Chrome only) to use flash player to stream, which caused the problem, you can see the guys explain above, so by removing this protocol, 'http' is what left in the array, so the browser will now use HTML5 instead

  18. adi-works commented on Sep 4, 2016

    @adi-works

    Salvation. After hours of frustration and inconsistent documentation.

    Used @tttt-conan solution. Don't seem to need Soundmanager 2. :)

  19. rycharlind commented on Sep 14, 2016

    @rycharlind

    I just used @tttt-conan solution as well. Worked for me!

  20. jamiegalbreath commented on Dec 19, 2016

    @jamiegalbreath

    @tttt-conan WORKS!

  21. alimony commented on Dec 22, 2016

    @alimony

    I chose to reverse the protocols array instead, i.e. scPlayer.options.protocols = ['http', 'rtmp'] which works fine as well, and should provide Flash fallback for browsers that do not support HTML5 audio.

  22. adi-works commented on Dec 23, 2016

    @adi-works

    @alimony actually, that is the correct solution. Everyone just forgot about Flash. Although, I didn't add old browser support in my project, so it didn't occur to me.

  23. chemic commented on Mar 24, 2017

    @chemic

    @tttt-conan thx for your hint.. awesome! Ended up not removing the rtmp protocol.. but reversed the order if it was 1st element of the array.

    if (player.options.protocols[0] === 'rtmp') {
        player.options.protocols = player.options.protocols.reverse();
    }
    
  24. tjenkinson commented on Dec 5, 2018

    @tjenkinson
    Contributor

    Hey @VasudevAkhil the player should choose the best protocol automatically that is supported internally. Why do you need to change it?

  25. erictran308 commented on Dec 10, 2018

    @erictran308

    Hi @VasudevAkhil , I haven't checked it yet but even with SDK version 3.3.1 and Chrome 71 this issue is still persist?

  26. tjenkinson commented on Dec 10, 2018

    @tjenkinson
    Contributor

    I am going to close this issue, because I believe the initial problem mentioned here was fixed a while ago. Please open a new issue if something is still not working properly, and we can discuss it there.

    Thanks!

  27. prospot99 commented on Jul 12, 2022

    @prospot99

    The player is working at https://www.producerspot.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions