admin管理员组文章数量:1289844
I am trying to set up JPlayer plugin and Shoutcast. According to their website this is possible to do.
How do I get jPlayer to play a SHOUTCast stream? You need to setMedia to the stream URL. For example, SHOUTcast server: / MP3 stream URL: /;stream/1
I have tried to do this
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
m4a:"http://77.68.106.224:8018;stream/1",
oga:"http://77.68.106.224:8018"
}).jPlayer("play");
},
swfPath: "js",
supplied: "m4a, oga, mp3",
wmode: "window"
});
});
//]]>
</script>
I do not get any output with my settings. Is anyone using JPlayer for a shoutcast Stream, or can anyone suggest a player that doesn't need php.
I am trying to set up JPlayer plugin and Shoutcast. According to their website this is possible to do.
How do I get jPlayer to play a SHOUTCast stream? You need to setMedia to the stream URL. For example, SHOUTcast server: http://mp3-vr-128.as34763/ MP3 stream URL: http://mp3-vr-128.as34763/;stream/1
I have tried to do this
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
m4a:"http://77.68.106.224:8018;stream/1",
oga:"http://77.68.106.224:8018"
}).jPlayer("play");
},
swfPath: "js",
supplied: "m4a, oga, mp3",
wmode: "window"
});
});
//]]>
</script>
I do not get any output with my settings. Is anyone using JPlayer for a shoutcast Stream, or can anyone suggest a player that doesn't need php.
Share Improve this question edited Sep 29, 2012 at 10:27 Eli 14.8k5 gold badges61 silver badges77 bronze badges asked Jan 9, 2012 at 9:55 BenjaminBenjamin 2,1183 gold badges26 silver badges46 bronze badges 6- are you sure that swfPath is correct?? – Ahmad Hajjar Commented Jan 9, 2012 at 10:06
- The path is correct. I used the demo files to confirm before i posted my question. The stream is live 77.68.106.224:8018 – Benjamin Commented Jan 9, 2012 at 10:13
- I'm not sure but I have been into similar trouble and that was because of supplied types , try removing 'mp3' from supplied types and let me know what happens :) – Ahmad Hajjar Commented Jan 9, 2012 at 10:18
- This is very strange, nothing happens at all. Do you know any other player that doesn't require php? – Benjamin Commented Jan 9, 2012 at 10:28
- I wish this is useful stackoverflow./questions/5305974/html5-audio-streaming – Ahmad Hajjar Commented Jan 9, 2012 at 10:40
2 Answers
Reset to default 5sweet vibes on this station!
You're almost there, see this fiddle to see your stream working in jPlayer.. Shoutcast outputs audio in MP3 format, not M4a or OGG.. you need constructor code more like that below..
One important thing to know is that the Flash plugin when using IE8 sometimes spends minutes buffering the audio.. You click play, think it isn't working then suddenly find your audio starts playing after three minutes.. The good news is that Chrome, Safari and Firefox play the stream almost immediately.
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#jquery_jplayer_1").jPlayer({
ready: function (event) {
$(this).jPlayer("setMedia", {
mp3:"http://77.68.106.224:8018;stream/1"
}).jPlayer("play");
},
swfPath: "js",
supplied: "mp3",
wmode: "window"
});
});
//]]>
</script>
Don't know if you still need a solution. We used the j player in the past but with Chrome updates and problems with flash and other browsers, Win 10 and flash issues we moved away from it. DO NOT CHANGE ANY PUNCUATIONS. Just paste the code into your website.
We now use a simple media player code. You'll have to put in your IP and Port #.
<div id="wb_MediaPlayer1">
<audio src="http://YOUR IP ADDRESS:YOUR PORT/;" id="MediaPlayer1" autoplay="autoplay" controls="controls">
</audio></div>
This code is included in our Widgets service at My Radio Hosting if you would like to take a look.
Hope this helps!
本文标签: javascriptjPlayer and Shoutcast ConfigurationStack Overflow
版权声明:本文标题:javascript - jPlayer and Shoutcast Configuration - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741435316a2378601.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论