Skip to Content
It is currently September 22nd, 2018, 2:38 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Need a new HTML5 player
PostPosted: January 5th, 2017, 12:34 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
Can anyone help please..

The HTML5 players I've been using no longer work in Chrome and Opera, so I need something to replace them.

I have players embedded in my Joomla site, plus a popup player from TuneIn and neither are working now.

_________________
Its all about the music..
http://www.1mix.co.uk


Last edited by Busby on January 5th, 2017, 7:09 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: January 5th, 2017, 1:02 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7611
Location: Aachen (Germany)
What exactly is an XTML player supposed to be?

Opera is nothing more than Chrome with a different Design and Branding. Chrome has disabled the included Flash Player by default in recent releases and Mozilla already announced they'll follow soon (Microsoft hasn't yet announced their policy on Flash).
Chrome users can decide to allow flash again for the time being, so a quick and dirty solution would be to provide instructions on your website.

Long term solution is probably just putting an <audio> tag into your website. The HTML5 Audio element should be fine with Shoutcast and Icecast.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: January 5th, 2017, 2:21 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
Thanks for the reply Mastacheata..

Sorry, it's actually an HTML5 player I meant.

I was always against embedding players in my site, but have been convinced by listeners who told me they wanted something simple and easy to find.

For the past week, listeners have been reporting they are unable to listen and are getting errors from the players, and the popup HTML5 TuneIn players which are accessible via the menu system.

I simply want to replace them with something that works.

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 5th, 2017, 2:55 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
I just created a page with just an html5 player in it and it still doest work in Chrome

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 5th, 2017, 5:41 pm 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4703
Location: Los Angeles - A Little West Of Nashville
Actually the issue, I believe, is that you are using SHOUTcast version 1, which no longer works with CHROME. You need to switch over to the latest version 2 of SHOUTcast.

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: January 5th, 2017, 7:01 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
That's a real pain and not something I want to do if I can avoid it. I have custom scripts which don't work with version 2 and would need re-writing. Also, I'm running SAM 4.7.1 which doesn't collect stats for SHOUTcast 2 either.

Another station I know is using JPlayer which is on SHOUTcast version 1 and works with Chrome, but I can't get it to work at all as the setup is too complex for me.

I changed the stream to version 2, and yes, it works..

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 6th, 2017, 2:39 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7611
Location: Aachen (Germany)
Busby wrote:
Also, I'm running SAM 4.7.1 which doesn't collect stats for SHOUTcast 2 either.

Not that this would fix the Stats collection stuff, but you know that you're entitled to use SAM 4.9.8 as well if you have a valid SAM 4 license?

Busby wrote:
That's a real pain and not something I want to do if I can avoid it. I have custom scripts which don't work with version 2 and would need re-writing.

Google is now disallowing HTTP 0.9 in non-standard ports and sooner or later the other browser vendors will follow suit.
Shoutcast v1 series won't receive any updates from Radionomy, even if all it'd take to fix this situation was changing one or 2 lines in their code.

You can make an Icecast2 server behave just like Shoutcast v1 to the outside, but I'd guess the effort it takes to do that is more than updating your scripts for Shoutcast 2.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: January 6th, 2017, 3:27 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
Thanks for the reply Mastacheata..

Yes, I have a valid SAM license, for 12 years, but I had so many issues after updates kept crashing, I stopped updating - prefering to stay with the stable version I'm using.

I've set up a couple of SHOUTcast 2 streams as a short term fix, but the station is registered with so many sites which would all need updating, then there's the 'now playing' banner on the site, TwitterCast, and stats from SAM to report to PPL.

I just can't see how it's feasable without a lot of work, and probably loosing some listeners.

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 7th, 2017, 7:40 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10382
Location: Denver, CO
As long as you have the correct class file that returns V2 data converting is not as bad as it sounds. Save it as shoutcast2.class.phps. Pretty sure this still works:
Code:
<?php

/*******************************************************************
* shoutcast.class.php
* Version: 0.1
* Author: Henrik Malmberg
* Copyright (C) 2002, Henrik Malmberg
* henrik@ih.nut
* http://yoda.ih.nu/
*
*******************************************************************
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*******************************************************************/

class ShoutCast {
    // Public
    var $host;
    var $port;
    var $passwd;
    var $mount;
    
    
//Private
    var $_xml;
    var $_error;
    
    function openstats
() {
        $fp = fsockopen($this->host, $this->port, $errno, $errstr, 5);
        If (!$fp) {
            $this->_error = "$errstr ($errno)";
            return(0);
        } else {
            fputs($fp, "GET /admin.cgi?sid=".$this->mount."&mode=viewxml&pass=".$this->passwd." HTTP/1.0\r\n");
            // fputs($fp, "User-Agent: Lynx/SC-status from $_SERVER[REMOTE_ADDR]\r\n\r\n");
            fputs($fp, "User-Agent: Lynx/SC-status\r\n\r\n");
            while (!feof($fp)) {
                    $this->_xml .= fgets($fp);
            }
            fclose($fp);

        $this->_xml=iconv("UTF-8","UTF-8//IGNORE",$this->_xml);
          
            if 
(stristr($this->_xml, "HTTP/1.0 200 OK") == true) {
                // <-H> Thanks to Blaster for this fix.. trim();
                $this->_xml = trim(substr($this->_xml, 42));
            } else {
                $this->_error = "Bad Login XML";

                return(0);
            }

            $xmlparser = xml_parser_create();
            if (!xml_parse_into_struct($xmlparser, $this->_xml, $this->_values, $this->_indexes)) {
                $this->_error = "Unparsable XML";
                return(0);
            }
    
            xml_parser_free
($xmlparser);

            return(1);
        }
    }
    
    function GetCurrentListenersCount
() {
        return($this->_values[$this->_indexes["CURRENTLISTENERS"][0]]["value"]);
    }

    function GetPeakListenersCount() {
        return($this->_values[$this->_indexes["PEAKLISTENERS"][0]]["value"]);
    }

    function GetMaxListenersCount() {
        return($this->_values[$this->_indexes["MAXLISTENERS"][0]]["value"]);
    }
    
    function GetReportedListenersCount
() {
        return($this->_values[$this->_indexes["UNIQUELISTENERS"][0]]["value"]);
    }
    
    function GetAverageListenTime
() {
        return($this->_values[$this->_indexes["AVERAGETIME"][0]]["value"]);
    }
    
    function GetServerGenre
() {
        return($this->_values[$this->_indexes["SERVERGENRE"][0]]["value"]);
    }
    
    function GetServerURL
() {
        return($this->_values[$this->_indexes["SERVERURL"][0]]["value"]);
    }
    
    function GetServerTitle
() {
        return($this->_values[$this->_indexes["SERVERTITLE"][0]]["value"]);
    }
    
    function GetCurrentSongTitle
() {
        return($this->_values[$this->_indexes["SONGTITLE"][0]]["value"]);
    }
    
    function GetStreamHitsCount
() {
        return($this->_values[$this->_indexes["STREAMHITS"][0]]["value"]);
    }

    function GetStreamPath() {
        return($this->_values[$this->_indexes["STREAMPATH"][0]]["value"]);
    }
    
    function GetStreamStatus
() {
        return($this->_values[$this->_indexes["STREAMSTATUS"][0]]["value"]);
    }
    
    function GetBitRate
() {
        return($this->_values[$this->_indexes["BITRATE"][0]]["value"]);
    }
    
    function GetSongHistory
() {
        for($i=1;$i<sizeof($this->_indexes['TITLE']);$i++) {
            $arrhistory[$i-1] = array(
                                    "playedat"=>$this->_values[$this->_indexes['PLAYEDAT'][$i]]['value'],
                                    "title"=>$this->_values[$this->_indexes['TITLE'][$i]]['value']
                                );
        }

        return($arrhistory);
    }

    function GetListeners() {
        for($i=0;$i<sizeof($this->_indexes['USERAGENT']);$i++) {
            $arrlisteners[$i] = array(
                                    "hostname"=>$this->_values[$this->_indexes['HOSTNAME'][$i]]['value'],
                                    "useragent"=>$this->_values[$this->_indexes['USERAGENT'][$i]]['value'],
                                    "connecttime"=>$this->_values[$this->_indexes['CONNECTTIME'][$i]]['value'],
                                    "uid"=>$this->_values[$this->_indexes['UID'][$i]]['value'],
                                );
        }

        return($arrlisteners);
    }
    
    function geterror
() { return($this->_error); }
}

?>

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: January 7th, 2017, 9:31 am 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
Many thanks for that..

My technical skills are very limited I'm afraid, but I have setup a SHOUTcast 2 stream on my Windows server, which works with my existing players.

I have tried the script above, but can't work out what my Mount Point is, nor can I work out how to add more for additional streams.

However, I uploaded the script above leaving the mount point blank on the basis that it should display, with an error, but all I get is a blank page.

For my PPL return I need the info in the form of a date specific report along the same lines as the one you get from SAM, so I'm still stuck unfortunatly.

Maybe I should remove the web players and just get listeners to use listen links instead, but I'm having issues with them too...

When you click a link in Firefox, Opera or Chrome to listen in WMP [ASX] for example it opens a 'save as' window instead of the player. Strangely, it works fine in Edge/Explorer.

Any suggestions please?

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 7th, 2017, 10:01 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10382
Location: Denver, CO
This page is not a script. You use it as an php include in other scripts that uses the data. This page creates callable functions that other php pages can use to get data from the shoutcastV2 streaming server. The variables from $host, $port, $passwrd, $mount would also come from a config file which is also an include. If you have more than one server you need to loop through each server with an indexed loop. Again, that processing would be handled in a main script not this one.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: January 7th, 2017, 10:34 am 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
Ah, looks like I need to get a coder as that's way over my head I'm afraid.. Thanks for your help though.

Any suggestions regading the listen links wanting to download please?

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 8th, 2017, 5:08 pm 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10382
Location: Denver, CO
Busby wrote:
Any suggestions regading the listen links wanting to download please?
Typically that means the mime types on the server are not supported or need updating.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: January 8th, 2017, 8:45 pm 
Offline
Senior User
Senior User

Joined: January 26th, 2006, 7:33 pm
Posts: 165
Location: Douglas, Isle of Man, UK
These are the mime types I have in my .htaccess, can you tell me what I need to change:

AddType audio/mpeg .mp1 .mp2 .mp3 .mpg .mpeg
AddType audio/x-ms-wma wma wax
AddType audio/x-pn-realaudio ram rm
AddType audio/x-scpls pls
AddType video/x-ms-asf asf asx wvx
AddType video/quicktime mov
AddType application/x-quicktimeplayer qtl

_________________
Its all about the music..
http://www.1mix.co.uk


Top
 Profile  
Reply with quote  
PostPosted: January 10th, 2017, 8:37 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7611
Location: Aachen (Germany)
I guess you can consider the Mimetype problem "unfixable".
ASF is a proprietary format by Microsoft and apparently not widespread enough for Mozilla and Google to include it in their default lists for special handling content-types. A user can manipulate that list by hand and tell Firefox and Chrome to handle ASF files as media files playable using WMP, but that's quite an effort for someone who just visits your site and wants to listen to your stream.

You might try using M3U instead as that is mentioned in the HTML5 Audio specification if I remember that correctly.

Apparently installing some third party media player also messes with the Content Type to Application mapping at least in Firefox. (Ex.: VLC makes many even exotic file formats play automatically in Firefox that were merely downloaded before, without the user having to change anything)
As Windows Media Player is usually there BEFORE Firefox is installed, it can't make any such changes (And I doubt Microsoft would implement such a feature anyways)

When it comes to Chrome, I have no experience about the media type stuff there. I only use that browser at work and barely do any media stuff with it at all.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group