0

I am trying to create a live stream radio website for various radio stations. Many radio stations use RTMP for their live streaming. So I used jwplayer as my default player. However, it doesn't seem to work. Here is my code:

<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "jwplayer.flash",
file: "rtmp://liveRadio.onlinehorizons.net/shabawreada",
height: 270,
width: 480,
autostart: true
});
</script>

I am confused in what to put in the file parameter and if I should use the streamer parameter. The above code does not work.

Hus
  • 21
  • 6

2 Answers2

0

I've tested this stream with rtmpdump and there are 2 issues:

1) The address of the stream is rtmp://liveRadio.onlinehorizons.net/shabawreada/livestream

2) I've only used JW player once, but I very much doubt this will work. Some RTMP streams are not protected in any way and anyone can connect to them as they please, like you're trying to do here. However, others are (somewhat) protected, and this is one of them.

During the RTMP handshake, this stream, like many others, requires 2 additional parameters. One is the address of the SWF player from which the RTMP handshake was initiated, the other is the address of the html page where the player is being used. Unfortunately for you, JWPlayer doesn't let you set these fields arbitrarily (See "Configuration Options"), which means you cannot use it for your current purpose.

You could look for a player that does support this, but I wouldn't bet on finding one. Of course, this operation can easily be done with a desktop application.

Æðelstan
  • 822
  • 12
  • 23
  • I do have the webpage in which it is streaming and the url to thier player. That are the parameters that you referred to? Is there any parameter to convert the stream to audio only that Androind supports? – Hus Nov 20 '15 at 07:20
  • Are you saying that you are actually passing the webpage and the player's URL to JWplayer? So is the stream playing now? As for audio, this stream is mp3, so it is supported by Android. However, [this page](http://support.jwplayer.com/customer/portal/articles/1403653-browser-device-reference) indicates that JWplayer is only officially supported on Chrome and Android 4.0+. – Æðelstan Nov 20 '15 at 19:47
  • No. I have tried that but did not succeed I do not know why. Here is the webpage that the radio station has: http://www.egradio.eg/radio.php?PubPnt=SootArab&ChnName=4 – Hus Nov 24 '15 at 13:39
  • I am trying to create a radio station app on Android but Android do not support RTMP. Is there any alternative solution? Perhaps converting a link to another that is supported by Android (Mp3 or AAC). – Hus Nov 24 '15 at 13:43
  • Ok you have to understand a few things: 1)RTMP is a TCP/IP protocol. It can be implemented by any standalone application who wants to implement it. Consequently there are many Android applications that *do* implement it, however they are not webbrowsers (unless you you install [Flash 11.1 for Android](https://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html)). 2) You *can't* pass the arguments in question to JWplayer as far as I know because JWPlayer won't take them in. 3)RTMP is a protocol, like HTTP, so you can't convert it to an audio *format* like mp3. – Æðelstan Nov 24 '15 at 16:03
  • [continued] As a matter of fact, this RTMP stream contains mp3. The conclusion: You have to tell me if you really need the stream to play in a browser or if opening it in another application can work too. For example, you can have a web page (html) with a link that will open the stream in a media player (like VLC) that *can* play the RTMP stream. When the user is done, he can easily go back to the last window. If you *have* to use the browser for everything, then it might be difficult to find a player that does this. – Æðelstan Nov 24 '15 at 16:09
  • I am actually using MIT app inventor to develop my app. RTMM doesn't work in the player component that they have. So I a webview that contains a jwplayer might work. Turned out that Androind doesn't support autoplay. I am trying to get this work within my app without using another app. – Hus Nov 26 '15 at 23:33
  • Why not just use their player or their page directly? You can probably use their player if you look at their embed code on their web page OR you can use an iframe in you own html page. in order for these to work you will more than likely need to install Flash 11.1 for Android. – Æðelstan Nov 26 '15 at 23:57
0

Try

flashplayer: "jwplayer.flash.swf",

instead.

You also need to specify type for file's with no file extension.

ie: type: 'flv'

it needs the .swf extension, and that should work.

Elon Zito
  • 2,872
  • 1
  • 24
  • 28