HTML5 (6)
MP3 Radio Stream URL?
Note: Make sure you have valid MP3 Radio Stream
Shoutcast V1 (http://shoutcast-server-ip:port/)
Shoutcast V2 (http://shoutcast-server-ip:port/streamname)
Icecast (http://icecast-server-ip:port/streamname)
Find valid Radio Stream URL from Icecast or Shoutcast (pls m3u xspf)
Radio Forge Player support all Radio Streaming URLs, find valid Radio Streaming URL from Icecast / Shoutcast servers
Note: Make sure you have valid MP3 Radio Stream
Shoutcast V1 (http://shoutcast-server-ip:port/)
Shoutcast V2 (http://shoutcast-server-ip:port/streamname)
Icecast (http://icecast-server-ip:port/streamname)
Shoutcast V1
Go to URL http://shoutcast-server-ip:port/ then click on “Listen“, download .pls file http://shoutcast-server-ip:port/listen.pls, open it in any text editor to get Shoutcast V1 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/
Shoutcast V2
Go to URL http://shoutcast-server-ip:port/ then click on “Listen” from Available Streams, say you clicked “Stream #1” download .pls file http://shoutcast-server-ip:port/listen.pls?sid=1, open it in any text editor to get Shoutcast V2 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/stream/1/
Title1=Radio Title :: www.domain.com :: 24 Live
Length1=-1
Version=2
Icecast
Go to URL http://shoutcast-server-ip:port/ then click on “M3U or XSPF“, download .m3u or .xspf file http://shoutcast-server-ip:port/stream.m3u or http://shoutcast-server-ip:port/stream.xspf, open it in any text editor to get Icecast Streaming URL for RadioForge Players
stream.m3u
http://shoutcast-server-ip:port/stream
stream.xspf
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<title/>
<creator/>
<trackList>
<track>
<location>http://shoutcast-server-ip:port/stream</location>
<title></title>
<annotation>Stream Title: Radio Station
Stream Description: Radio Programs
Content Type:audio/mpeg
Bitrate: 128
Current Listeners: 1
Peak Listeners: 6
Stream Genre: Radio Community Station</annotation>
<info>www.domain.com</info>
</track>
</trackList>
</playlist>
Shoutcast.com
Go to URL https://www.shoutcast.com/, download any file .pls .m3u .xspf, open in text editor then find Radio Streaming URL
Centova Cast
Set title and meta-tags dynamic with jQuery??
The Facebook scraper doesn’t execute JavaScript. So using Javascript to set the metatags content won’t work.
You have to set OG meta data into the HTML code delivered when the URL is requested. You can simply say “VIEW PAGE SOURCE” … That’s how it works.
THIS CODE Won’t Work for Social Share
function changeMetaInfo()
{
jQuery(‘meta[property=”og:title”]’).remove();
jQuery(“head”).append(‘<meta property=”og:title” content=”RadioForge – [RANDOM-TITLE]”>’);
document.title = “RadioForge – [RANDOM-TITLE]”;
}
Other solution
Say you have a player page (player.php) showing current playing radio title / artist (metadata) on page… here you can’t set meta tags & title using JavaScript for social share on Twitter, Facebook or Google.
>> metadata.php write JSON file json/metadata.json for current playing radio titles
{“title”:”RadioForge – [RANDOM-TITLE]”}
You can make a new page (share.php) where you can set those meta tags & title using JSON file json/metadata.json (written by current playing metadata process on player.php) and redirect it to domain player page.
When you share page URL …. it actually shares share.php with just title / tags
Social Share
https://plus.google.com/share?url=http://domain.com/share.php
https://www.facebook.com/sharer/sharer.php?u=http://domain.com/share.php
share.php
<?php $sjson = file_get_contents("json/metadata.json"); $mjson = json_decode($sjson, true); if(isset($mjson['title']) && $mjson['title']!="") $ptitle = $mjson['title']; ?><!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?php echo $ptitle; ?></title> <meta property="og:title" content="<?php echo $ptitle; ?>" /> <script language=javascript> function redirect(){ window.location = "http://www.domain.com"; } </script> </head> <body onload="redirect();"> Redirecting.... </body> </html>
Icecast (11)
AutoPlay Player in Chrome
If you want to allow Google Chrome to autoplay media / audio / radio stream Automatic
Uncaught (in promise) DOMException on autoPlay: true
Google Chrome is up to date version
Version 75.0.3770.100 (Official Build) (64-bit)
Steps
1. Open chrome://flags/#autoplay-policy
2. Setting No user gesture is required
3. Relaunch Chrome
OR
Type chrome://flags in the Chrome address-bar
Search: Autoplay
Autoplay Policy
Policy used when deciding if audio or video is allowed to autoplay.
It will work in Mac, Windows, Linux, Chrome OS, Android.
Set from dropdown to “No user gesture is required”
Relaunch Chrome and AutoPlay will start Work!!
AutoPlay Player in Mozilla Firefox
HTML5 Radio Player Automatic Play #AutoPlay in browsers #ThursdayThoughts https://t.co/HPJbSeFHpa pic.twitter.com/xbIARyed1F
— HTML5 Player ♫ ♪ (@HTML5MP3Player) July 4, 2019
Remove buffering
You can set preload in PAID Plugin files
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5shoutcast.php
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5icecast.php
By default it set to preload: “auto”,
To Remove buffering set to preload: “none”,
preload
String : (Default: “metadata”) : Valid values are “none”, “metadata” and “auto”, which matches the HTML5 draft standard. Use “auto” to preload the file.
how I can center player on a page?
Please use iframe based code
i.e. <iframe src=”http://html5radios.svnlabs.com/v1/shoutcast.html?id=1380996176” height=”227” width=”367” frameborder=”0” marginwidth=”0” marginheight=”0” scrolling=”no“></iframe>
<DIV align=”center” style=”margin:0 auto”> ….. PLAYER CODE …… </DIV>
Android very slow buffering for Shoutcast / Icecast
If you are using HTML5 Radio Player i.e. jplayer or HTML5 audio tag to player Radio Icecast / Shoutcast Live Stream on Android Mobiles and it takes much time (20-25 seconds) to load in player.
OMG if most users think Radio Player is not working at all on mobile browser.
You can try Radio Stream with low bitrate like 64kbps or 56kbps
Also you need to play with your Radio Shoutcast / Icecast configuration settings…
<burst-on-connect>1</burst-on-connect>
<queue-size>1048576</queue-size>
<burst-size>943718</burst-size>
<mp3-metadata-interval>4096</mp3-metadata-interval>
Normally Radio Stream with bitrate 128kbps takes 4-5s on WiFi and 7-8s on 3G Internet.
Config File: http://icecast.org/docs/icecast-2.4.0/config-file.html
Find valid Radio Stream URL from Icecast or Shoutcast (pls m3u xspf)
Radio Forge Player support all Radio Streaming URLs, find valid Radio Streaming URL from Icecast / Shoutcast servers
Note: Make sure you have valid MP3 Radio Stream
Shoutcast V1 (http://shoutcast-server-ip:port/)
Shoutcast V2 (http://shoutcast-server-ip:port/streamname)
Icecast (http://icecast-server-ip:port/streamname)
Shoutcast V1
Go to URL http://shoutcast-server-ip:port/ then click on “Listen“, download .pls file http://shoutcast-server-ip:port/listen.pls, open it in any text editor to get Shoutcast V1 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/
Shoutcast V2
Go to URL http://shoutcast-server-ip:port/ then click on “Listen” from Available Streams, say you clicked “Stream #1” download .pls file http://shoutcast-server-ip:port/listen.pls?sid=1, open it in any text editor to get Shoutcast V2 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/stream/1/
Title1=Radio Title :: www.domain.com :: 24 Live
Length1=-1
Version=2
Icecast
Go to URL http://shoutcast-server-ip:port/ then click on “M3U or XSPF“, download .m3u or .xspf file http://shoutcast-server-ip:port/stream.m3u or http://shoutcast-server-ip:port/stream.xspf, open it in any text editor to get Icecast Streaming URL for RadioForge Players
stream.m3u
http://shoutcast-server-ip:port/stream
stream.xspf
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<title/>
<creator/>
<trackList>
<track>
<location>http://shoutcast-server-ip:port/stream</location>
<title></title>
<annotation>Stream Title: Radio Station
Stream Description: Radio Programs
Content Type:audio/mpeg
Bitrate: 128
Current Listeners: 1
Peak Listeners: 6
Stream Genre: Radio Community Station</annotation>
<info>www.domain.com</info>
</track>
</trackList>
</playlist>
Shoutcast.com
Go to URL https://www.shoutcast.com/, download any file .pls .m3u .xspf, open in text editor then find Radio Streaming URL
Centova Cast
SHOUTcast vs Icecast?
Features | Shoutcast v1 | Shoutcast v2 | Icecast v2 |
Auto Switch AutoDJ or Live Stream | No | Yes | Yes |
AutoDJ Audio Codecs | MP3 | MP3, AAC+ | MP3, OGG, AAC+, AAC+v2 |
Live Streaming Audio Codecs | MP3, AAC+, AAC+v2 | MP3, AAC+, AAC+v2 | MP3, OGG, AAC+, AAC+v2 |
Multiple Steaming Channels (Mount Points) on one Server |
No | Yes | Yes |
Advanced Server Admin Control Panel | No | Yes | Yes |
Song Played History | Yes | Yes | No |
Radio Stream URL | http://shoutcast-server-ip:port/ | http://shoutcast-server-ip:port/streamname | http://icecast-server-ip:port/streamname |
isRadioLive??
Icecast Radio Stream URL http://192.240.132.198:7903/stream
Is Radio Stream Online?
This script will work with Shoutcast1, Shoutcast2 and Icecast
# curl -I –stderr /dev/null –connect-timeout 5 ‘http://192.240.132.198:7903/stream’ | head -1 | cut -d’ ‘ -f2
isRadioLive(“[Full-Radio-Stream-URL]”, “icecast”);
Is Radio Stream Online or Offline?
How we can check .. Is Radio Stream Online or Offline?
You can simply use our online tool to check whether Radio Stream URL is Online or Offline?
Just Input your Radio Icecast / Shoutcast / Others Stream Link in textbox provided then hit “Go”
RadioForge also provide server for “Radio Monitoring & Silence Detection”.
RadioForge monitoring and alerts helps you before your listener contacts you like “Your radio stream is not working.”
Shoutcast (14)
AutoPlay Player in Chrome
If you want to allow Google Chrome to autoplay media / audio / radio stream Automatic
Uncaught (in promise) DOMException on autoPlay: true
Google Chrome is up to date version
Version 75.0.3770.100 (Official Build) (64-bit)
Steps
1. Open chrome://flags/#autoplay-policy
2. Setting No user gesture is required
3. Relaunch Chrome
OR
Type chrome://flags in the Chrome address-bar
Search: Autoplay
Autoplay Policy
Policy used when deciding if audio or video is allowed to autoplay.
It will work in Mac, Windows, Linux, Chrome OS, Android.
Set from dropdown to “No user gesture is required”
Relaunch Chrome and AutoPlay will start Work!!
AutoPlay Player in Mozilla Firefox
HTML5 Radio Player Automatic Play #AutoPlay in browsers #ThursdayThoughts https://t.co/HPJbSeFHpa pic.twitter.com/xbIARyed1F
— HTML5 Player ♫ ♪ (@HTML5MP3Player) July 4, 2019
Remove buffering
You can set preload in PAID Plugin files
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5shoutcast.php
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5icecast.php
By default it set to preload: “auto”,
To Remove buffering set to preload: “none”,
preload
String : (Default: “metadata”) : Valid values are “none”, “metadata” and “auto”, which matches the HTML5 draft standard. Use “auto” to preload the file.
how I can center player on a page?
Please use iframe based code
i.e. <iframe src=”http://html5radios.svnlabs.com/v1/shoutcast.html?id=1380996176” height=”227” width=”367” frameborder=”0” marginwidth=”0” marginheight=”0” scrolling=”no“></iframe>
<DIV align=”center” style=”margin:0 auto”> ….. PLAYER CODE …… </DIV>
Find valid Radio Stream URL from Icecast or Shoutcast (pls m3u xspf)
Radio Forge Player support all Radio Streaming URLs, find valid Radio Streaming URL from Icecast / Shoutcast servers
Note: Make sure you have valid MP3 Radio Stream
Shoutcast V1 (http://shoutcast-server-ip:port/)
Shoutcast V2 (http://shoutcast-server-ip:port/streamname)
Icecast (http://icecast-server-ip:port/streamname)
Shoutcast V1
Go to URL http://shoutcast-server-ip:port/ then click on “Listen“, download .pls file http://shoutcast-server-ip:port/listen.pls, open it in any text editor to get Shoutcast V1 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/
Shoutcast V2
Go to URL http://shoutcast-server-ip:port/ then click on “Listen” from Available Streams, say you clicked “Stream #1” download .pls file http://shoutcast-server-ip:port/listen.pls?sid=1, open it in any text editor to get Shoutcast V2 Streaming URL
listen.pls
NumberOfEntries=1
File1=http://shoutcast-server-ip:port/stream/1/
Title1=Radio Title :: www.domain.com :: 24 Live
Length1=-1
Version=2
Icecast
Go to URL http://shoutcast-server-ip:port/ then click on “M3U or XSPF“, download .m3u or .xspf file http://shoutcast-server-ip:port/stream.m3u or http://shoutcast-server-ip:port/stream.xspf, open it in any text editor to get Icecast Streaming URL for RadioForge Players
stream.m3u
http://shoutcast-server-ip:port/stream
stream.xspf
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<title/>
<creator/>
<trackList>
<track>
<location>http://shoutcast-server-ip:port/stream</location>
<title></title>
<annotation>Stream Title: Radio Station
Stream Description: Radio Programs
Content Type:audio/mpeg
Bitrate: 128
Current Listeners: 1
Peak Listeners: 6
Stream Genre: Radio Community Station</annotation>
<info>www.domain.com</info>
</track>
</trackList>
</playlist>
Shoutcast.com
Go to URL https://www.shoutcast.com/, download any file .pls .m3u .xspf, open in text editor then find Radio Streaming URL
Centova Cast
Shoutcast streams on non-standard port would no longer play
SHOUTcast Server Version 1.9.8/Linux “audio/mpeg” is not playing in Google Chrome?
Hope you know / aware of latest update of chrome that remove support for ICY data for Shoutcast V1
Shoutcast streams on non-standard port would no longer play
https://bugs.chromium.org/p/chromium/issues/detail?id=669800#c6
http://forums.winamp.com/showthread.php?p=3074439
SO Try to use Shoutcast version #2 Or Icecast version #2
Shoutcast Relay: It may be temp solution for Shoutcast V1. Most of SC V1 server use ICY 200 header … where we need HTTP
https://www.radioforge.com/
Use Shoutcast Radio proxy or Shoutcast Re-streaming for Shoutcast old version
http://www.steamcast.com/?req=dir
SHOUTcast vs Icecast?
Features | Shoutcast v1 | Shoutcast v2 | Icecast v2 |
Auto Switch AutoDJ or Live Stream | No | Yes | Yes |
AutoDJ Audio Codecs | MP3 | MP3, AAC+ | MP3, OGG, AAC+, AAC+v2 |
Live Streaming Audio Codecs | MP3, AAC+, AAC+v2 | MP3, AAC+, AAC+v2 | MP3, OGG, AAC+, AAC+v2 |
Multiple Steaming Channels (Mount Points) on one Server |
No | Yes | Yes |
Advanced Server Admin Control Panel | No | Yes | Yes |
Song Played History | Yes | Yes | No |
Radio Stream URL | http://shoutcast-server-ip:port/ | http://shoutcast-server-ip:port/streamname | http://icecast-server-ip:port/streamname |
isRadioLive??
Icecast Radio Stream URL http://192.240.132.198:7903/stream
Is Radio Stream Online?
This script will work with Shoutcast1, Shoutcast2 and Icecast
# curl -I –stderr /dev/null –connect-timeout 5 ‘http://192.240.132.198:7903/stream’ | head -1 | cut -d’ ‘ -f2
isRadioLive(“[Full-Radio-Stream-URL]”, “icecast”);
Problem with Chrome 55+ and Safari 10+
SHOUTcast V1 and early SHOUTcast V2 will no longer play in chrome and safari browser??
Hint: Update old version of SHOUTcast and get current v2 build then it will works!
Google Chrome 55+ and Safari 10+ have a issue with much Stream links.
HTTP header HTTP/0.9 is the problem. net::ERR_INVALID_HTTP_RESPONSE
More Details here => https://bugs.chromium.org/p/chromium/issues/detail?id=669800
Stunnel SSL to SHOUTcast
SHOUTcast won’t support SSL so use Stunnel with free certificate from Let’s Encrypt certbot. https://certbot.eff.org/
# apt install stunnel certbot
# certbot certonly --standalone
Configure stunnel
# nano /etc/stunnel/stunnel.conf
8000 is SHOUTcast HTTP port
[shoutcast]
accept=443
connect=8000
cert = /etc/letsencrypt/live/radio.domain.com/fullchain.pem
key = /etc/letsencrypt/live/radio.domain.com/privkey.pem
Run stunnel
# stunnel
Set Auto-Renew certbot SSL
# crontab -e
15 3 * * * certbot renew --pre-hook "killall stunnel" --post-hook "stunnel" -q
Shoutcast V1 will not work Chrome??
We are using Shoutcast V1 Radio streams to play in web player like
Shoutcast V1
– SHOUTcast Server Version 1.9.8/win32
– SHOUTcast Server Version 1.9.8/Linux
Add semicolon after shoutcast link ?
http://yourdomain:port/;
But as Google Chrome need all Links as HTTPS so above semi-colon trick will not work
Chromium Blog – No More Mixed Messages About HTTPS
Shoutcast V1 streams will not work with SSL proxy … becoz shoutcast v1 don’t have any mount point like shoutcast v2 or icecast
Solution
Google chrome is updating regularly … so it will not support old version of Shoutcast V1
If You are using very old Shoutcast version, switch to latest radio SHOUTCAST version 2 from your hosting to better play in all browsers
Some Shoutcast Icecast mp3’s won’t play in html5 audio player
Is Radio Stream Online or Offline?
How we can check .. Is Radio Stream Online or Offline?
You can simply use our online tool to check whether Radio Stream URL is Online or Offline?
Just Input your Radio Icecast / Shoutcast / Others Stream Link in textbox provided then hit “Go”
RadioForge also provide server for “Radio Monitoring & Silence Detection”.
RadioForge monitoring and alerts helps you before your listener contacts you like “Your radio stream is not working.”
JavaScript (6)
AutoPlay Player in Chrome
If you want to allow Google Chrome to autoplay media / audio / radio stream Automatic
Uncaught (in promise) DOMException on autoPlay: true
Google Chrome is up to date version
Version 75.0.3770.100 (Official Build) (64-bit)
Steps
1. Open chrome://flags/#autoplay-policy
2. Setting No user gesture is required
3. Relaunch Chrome
OR
Type chrome://flags in the Chrome address-bar
Search: Autoplay
Autoplay Policy
Policy used when deciding if audio or video is allowed to autoplay.
It will work in Mac, Windows, Linux, Chrome OS, Android.
Set from dropdown to “No user gesture is required”
Relaunch Chrome and AutoPlay will start Work!!
AutoPlay Player in Mozilla Firefox
HTML5 Radio Player Automatic Play #AutoPlay in browsers #ThursdayThoughts https://t.co/HPJbSeFHpa pic.twitter.com/xbIARyed1F
— HTML5 Player ♫ ♪ (@HTML5MP3Player) July 4, 2019
Auto Reconnect HTML5 Radio Player
<script type="text/javascript"> function autoReconnect() { console.log( jQuery('#jquery_jplayer_1').data().jPlayer.status.paused ); //// jquery_jplayer_1 jPlayer element if(jQuery('#jquery_jplayer_1').data().jPlayer.status.paused ) //&& butclick==false { jQuery("#current-track").html("FM Radio Station RadioForge.com."); jQuery(".jp-play").click(); //jQuery(this).jPlayer("setMedia", stream).jPlayer("play"); } } setInterval(function(){autoReconnect();}, 25000); // every 25 secs </script>
Remove buffering
You can set preload in PAID Plugin files
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5shoutcast.php
– wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5icecast.php
By default it set to preload: “auto”,
To Remove buffering set to preload: “none”,
preload
String : (Default: “metadata”) : Valid values are “none”, “metadata” and “auto”, which matches the HTML5 draft standard. Use “auto” to preload the file.
Set title and meta-tags dynamic with jQuery??
The Facebook scraper doesn’t execute JavaScript. So using Javascript to set the metatags content won’t work.
You have to set OG meta data into the HTML code delivered when the URL is requested. You can simply say “VIEW PAGE SOURCE” … That’s how it works.
THIS CODE Won’t Work for Social Share
function changeMetaInfo()
{
jQuery(‘meta[property=”og:title”]’).remove();
jQuery(“head”).append(‘<meta property=”og:title” content=”RadioForge – [RANDOM-TITLE]”>’);
document.title = “RadioForge – [RANDOM-TITLE]”;
}
Other solution
Say you have a player page (player.php) showing current playing radio title / artist (metadata) on page… here you can’t set meta tags & title using JavaScript for social share on Twitter, Facebook or Google.
>> metadata.php write JSON file json/metadata.json for current playing radio titles
{“title”:”RadioForge – [RANDOM-TITLE]”}
You can make a new page (share.php) where you can set those meta tags & title using JSON file json/metadata.json (written by current playing metadata process on player.php) and redirect it to domain player page.
When you share page URL …. it actually shares share.php with just title / tags
Social Share
https://plus.google.com/share?url=http://domain.com/share.php
https://www.facebook.com/sharer/sharer.php?u=http://domain.com/share.php
share.php
<?php $sjson = file_get_contents("json/metadata.json"); $mjson = json_decode($sjson, true); if(isset($mjson['title']) && $mjson['title']!="") $ptitle = $mjson['title']; ?><!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?php echo $ptitle; ?></title> <meta property="og:title" content="<?php echo $ptitle; ?>" /> <script language=javascript> function redirect(){ window.location = "http://www.domain.com"; } </script> </head> <body onload="redirect();"> Redirecting.... </body> </html>
jPlayer Tricks
jPlayer Current Volume (0-1)
$(“#jquery_jplayer_1”).jPlayer(“option”,”volume”);
> 0.61
Mute / Unmute
$(“#jquery_jplayer_1”).jPlayer(“mute”, true);
$(“#jquery_jplayer_1”).jPlayer(“unmute”, true);
Begins playing 42 seconds into the media
$(“#jquery_jplayer_1”).jPlayer(“play”, 42);
Repeat the media
ended: function() { // The $.jPlayer.event.ended event
$(this).jPlayer(“play”);
}
Auto-Reconnect Media if any connection problem
function autoReconnect()
{
console.log( jQuery(‘#jquery_jplayer_1’).data().jPlayer.status.paused );
if(jQuery(‘#jquery_jplayer_1’).data().jPlayer.status.paused )
{
jQuery(“#current-track”).html(“loading….”);
jQuery(“.jp-play”).click();
}
}
setInterval(function(){autoReconnect();}, 25000);
Duration %
timeupdate: function(event)
{
console.log(event.jPlayer.status.currentPercentAbsolute);
}
current time
$(‘#jquery_jplayer_1’).data(“jPlayer”).status.currentTime;
Playback Rate
$(“#jquery_jplayer_1”).jPlayer(“option”,”playbackRate”, “1.5”);
$(“#jquery_jplayer_1”).jPlayer(“options”,{defaultPlaybackRate : 1.5});
jPlayer show Time Duration H:m:s (00:00:00)
$.jPlayer.timeFormat = {
showHour: true,
showMin: true,
showSec: true,
padHour: true,
padMin: true,
padSec: true,
sepHour: “:”,
sepMin: “:”,
sepSec: “”
};
Winamp (2)
SAMCast (1)
Stunnel (1)
Stunnel SSL to SHOUTcast
SHOUTcast won’t support SSL so use Stunnel with free certificate from Let’s Encrypt certbot. https://certbot.eff.org/
# apt install stunnel certbot
# certbot certonly --standalone
Configure stunnel
# nano /etc/stunnel/stunnel.conf
8000 is SHOUTcast HTTP port
[shoutcast]
accept=443
connect=8000
cert = /etc/letsencrypt/live/radio.domain.com/fullchain.pem
key = /etc/letsencrypt/live/radio.domain.com/privkey.pem
Run stunnel
# stunnel
Set Auto-Renew certbot SSL
# crontab -e
15 3 * * * certbot renew --pre-hook "killall stunnel" --post-hook "stunnel" -q
SSL (1)
Stunnel SSL to SHOUTcast
SHOUTcast won’t support SSL so use Stunnel with free certificate from Let’s Encrypt certbot. https://certbot.eff.org/
# apt install stunnel certbot
# certbot certonly --standalone
Configure stunnel
# nano /etc/stunnel/stunnel.conf
8000 is SHOUTcast HTTP port
[shoutcast]
accept=443
connect=8000
cert = /etc/letsencrypt/live/radio.domain.com/fullchain.pem
key = /etc/letsencrypt/live/radio.domain.com/privkey.pem
Run stunnel
# stunnel
Set Auto-Renew certbot SSL
# crontab -e
15 3 * * * certbot renew --pre-hook "killall stunnel" --post-hook "stunnel" -q
Chrome (1)
Shoutcast V1 will not work Chrome??
We are using Shoutcast V1 Radio streams to play in web player like
Shoutcast V1
– SHOUTcast Server Version 1.9.8/win32
– SHOUTcast Server Version 1.9.8/Linux
Add semicolon after shoutcast link ?
http://yourdomain:port/;
But as Google Chrome need all Links as HTTPS so above semi-colon trick will not work
Chromium Blog – No More Mixed Messages About HTTPS
Shoutcast V1 streams will not work with SSL proxy … becoz shoutcast v1 don’t have any mount point like shoutcast v2 or icecast
Solution
Google chrome is updating regularly … so it will not support old version of Shoutcast V1
If You are using very old Shoutcast version, switch to latest radio SHOUTCAST version 2 from your hosting to better play in all browsers
Some Shoutcast Icecast mp3’s won’t play in html5 audio player
jPlayer (1)
jPlayer Tricks
jPlayer Current Volume (0-1)
$(“#jquery_jplayer_1”).jPlayer(“option”,”volume”);
> 0.61
Mute / Unmute
$(“#jquery_jplayer_1”).jPlayer(“mute”, true);
$(“#jquery_jplayer_1”).jPlayer(“unmute”, true);
Begins playing 42 seconds into the media
$(“#jquery_jplayer_1”).jPlayer(“play”, 42);
Repeat the media
ended: function() { // The $.jPlayer.event.ended event
$(this).jPlayer(“play”);
}
Auto-Reconnect Media if any connection problem
function autoReconnect()
{
console.log( jQuery(‘#jquery_jplayer_1’).data().jPlayer.status.paused );
if(jQuery(‘#jquery_jplayer_1’).data().jPlayer.status.paused )
{
jQuery(“#current-track”).html(“loading….”);
jQuery(“.jp-play”).click();
}
}
setInterval(function(){autoReconnect();}, 25000);
Duration %
timeupdate: function(event)
{
console.log(event.jPlayer.status.currentPercentAbsolute);
}
current time
$(‘#jquery_jplayer_1’).data(“jPlayer”).status.currentTime;
Playback Rate
$(“#jquery_jplayer_1”).jPlayer(“option”,”playbackRate”, “1.5”);
$(“#jquery_jplayer_1”).jPlayer(“options”,{defaultPlaybackRate : 1.5});
jPlayer show Time Duration H:m:s (00:00:00)
$.jPlayer.timeFormat = {
showHour: true,
showMin: true,
showSec: true,
padHour: true,
padMin: true,
padSec: true,
sepHour: “:”,
sepMin: “:”,
sepSec: “”
};