问题
Shoutcast stream is giving me a serious headache.
I tried:
- JWplayer
- Jplayer
- 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