jPlayer and Shoutcast Configuration

2024/2/27 8:56:22

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 setMediato the stream URL. For example, SHOUTcast server:http://mp3-vr-128.as34763.net/ MP3 stream URL:http://mp3-vr-128.as34763.net/;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.

Answer

sweet 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>
http://en.ppmy.cn/q/41234.html

Related Q&A

JavaScript pseudo-random sequence generator

I need to generate a deterministic (i.e. repeatable) sequence of pseudo-random numbers given an initial seed and select the nth item from that sequence.If JavaScripts random function was seedable, I co…

Google Maps Marker title no longer appears as tooltip on hover

The Google Maps documentation indicates that adding a title property to a Marker object will result in its value appearing as a tooltip when the user hovers over that Marker. This used to work perfect…

How to find where browser breaks a paragraph of text

I need to add line breaks in the positions that the browser naturally adds a newline in a paragraph of text.For example:<p>This is some very long text \n that spans a number of lines in the parag…

Extract frame of gif with graphicsmagick in node.js

I am trying to convert a gif into a png using graphicsmagick on node.js. In their documentation they have the following code:// pull out the first frame of an animated gif and save as png gm(/path/to/a…

Regex for number between 0 to 100?

It should not allow leading zeroes, like 099. Allowed values should be like these: 35, 99, 1, 2, 3, 100.This is What I tried: $(#createCoupon_discountAmount).bind(input propertychange, function () {$(t…

Set text in textarea, including newlines

I want to set the text in a <textarea> from a js-function; Im simply setting the innerText-attribute to a new value. The text is multiline and should be displayed as such. However, newlines are d…

CSS column-count elements jumping across columns

Im trying to get a dynamic amount of elements to show across 5 elements using CSS3 column-count, but when I expand the list item heights on hover, it occasionally causes jumping (an element going to th…

I have no idea Object(this) means

In https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/fillthere is a line like// Steps 1-2. if (this == null) {throw new TypeError(this is null or not defined); }var O …

How to combine two parts of single form in angular?

I am making angular application with angular dynamic form where i am loading data for dynamic form through JSON..JSON has two parts such as part 1 and part 2,jsonDataPart1: any = [{"elementType&qu…

jquery hide a div that contains flash without resetting it

Greetings, I have written a modal using jquery UI and it appears at the front of a flash movie thus the html inside the modal becomes corrupt, I tried to hide the movie right before modal gets triggere…