Is there a true cross browser solution for shoutcast streams?

微笑、不失礼 提交于 2019-12-22 00:25:21

问题


Shoutcast stream is giving me a serious headache.

I tried:

  1. JWplayer
  2. Jplayer
  3. Html5 Audio

None of these are true cross-platform-browser solutions. THey can't even play all shoutcast streams!

Is there any other solution to this problem?

Maybe I can pass stream through some php library?

Any solutions for this?


回答1:


Since nobody is answering, I ransacked web today and found soundmanager2 - which at least in my tests works fine both on desktop and mobile browsers.

I tested on Android, IOS, on desktop side chrome,firefox,safari and all shoutcast channels seem to work fine.

So here you go :)

http://www.schillmania.com/projects/soundmanager2/

soundManager.setup({
                url: 'soundManager2/swf',
                debugMode: false,
                // optional: use 100% HTML5 mode where available
                // preferFlash: false,
                onready: function() {
                  var mySound = soundManager.createSound({
                    id: 'shoutCast',
                    url: valueSelected+';',
                    type: 'audio/mp3'
                  });
                  mySound.play();
                },
                ontimeout: function() {
                  // Hrmm, SM2 could not start. Missing SWF? Flash blocked? Show an error, etc.?
                }
              });

valueSelected = http://198.27.79.224:9770/



来源:https://stackoverflow.com/questions/18592400/is-there-a-true-cross-browser-solution-for-shoutcast-streams

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!