Quantcast
Channel: criten.org » Icecast
Viewing all articles
Browse latest Browse all 10

Browser detection with PHP’s get_browser()

$
0
0

I had to make a small web page to play the Internet stream for the radio station this week.

We’ve had alot of issues in the past with users of Internet Explorer having poor quality playback. This is because the web browser handles all HTTP requests for Adobe Flash and IE doesn’t handle live MP3 streams too well.

So the idea is to detect when Internet Explorer is being used and instead of using Adobe Flash, embed Windows Media Player which plays the stream fine.

get_browser() does this task great. However it requires the php_browscap.ini file.

So this file is kept up to date I created the cronjob:

1 1 */7 * *     root    /usr/bin/wget "http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI" -O /etc/php5/browscap.ini >/dev/null 2>&1

I then edited the php.ini file so that under [browscap] it contains:

browscap = /etc/php5/browscap.ini


Viewing all articles
Browse latest Browse all 10

Trending Articles