Skip to content

Commit d73b284

Browse files
Showing bitrate is optional as it involves an extra request to the server and the installation of 'exiftool'.
Added a version string. Updated README.md.
1 parent d5de2d5 commit d73b284

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# html5_audioplayer
22

3-
html5_audioplayer provides an easy way to stream the music from your lamp server.
3+
html5_audioplayer provides an easy way to stream the music from your lamp server.
44
<br>It is intended as a replacement for the Apache plugin `mod_musicindex` which was a pain to install and is not maintained anymore.
55
<br><br>html5_audioplayer is a simple one-file drop-in musicplayer.
66
<br>Just symlink `htdocs` to the root of your music collection and copy `index.php` to that folder and it works.
@@ -12,6 +12,14 @@ html5_audioplayer on a Samsung Galaxy S5 NEO Android phone.
1212
- A working Apache webserver with PHP enabled.<br>
1313
Actual versions should not matter that much but the player is developed against Apache 2.4 and PHP 7.
1414
- A folder with MP3s, OGGs and/or WAV files.
15+
- (Optionally) `exiftool` to show the bitrate. Default setting is to not show the bitrate.
16+
17+
To show the bitrate of the currently playing song `$showBitrate` in `index.php` has to be set to `true` and `exiftool` has to be installed.
18+
<br>To install `exiftool` enter the following in a terminal:
19+
<br>
20+
````
21+
sudo apt-get install exiftool
22+
````
1523

1624
### Easy setup:
1725
With Apache 2.4, easiest setup is to symlink `htdocs` to the folder where you keep your music files.

index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22
//error_reporting(E_ALL);
3+
$showBitrate=true; //set to true to show bitrate, and install 'exiftool', check the README.md
4+
$versionString="v0.99b";
35
if(isset($_GET["folder"]))
46
{
57
$path=rawurldecode($_GET["folder"]);
@@ -248,7 +250,7 @@
248250
<div id="navList" class="noselect"></div>
249251
<div id="playList" class="noselect"></div>
250252
<div id="playerControls" class="noselect">
251-
<div id="currentPlaying"><a href="https://github.com/CelliesProjects/html5_audioplayer" target="_blank">html5_audioplayer v0.9</a></div>
253+
<div id="currentPlaying"><a href="https://github.com/CelliesProjects/html5_audioplayer" target="_blank">html5_audioplayer <?php echo $versionString ?></a></div>
252254
<div id="controlArea"><img id="previousButton" class="actionIcon" src="?icon=previous"><img id="playButton" class="actionIcon" src="?icon=play"><img id="nextButton" class="actionIcon" src="?icon=next"><input type="range" min="0" max="0" value="0" class="" id="slider"><p id="currentTime"></p><img id="clearList" class="actionIcon" src="?icon=clearlist"></div>
253255
<audio controls autoplay id="player">Your browser does not support the audio element.</audio>
254256
<script>
@@ -461,6 +463,7 @@ function resetPlayer()
461463
var nowPlaying=player.src;
462464
if($('.playListLink').eq(currentSong).data('path')!=undefined)thisSong=encodeURIComponent($('.playListLink').eq(currentSong).data('path'))+'/';
463465
thisSong+=encodeURIComponent($('.playListLink').eq(currentSong).text());
466+
<?php if($showBitrate):?>
464467
$.get('?bitrate='+thisSong,function(){
465468
})
466469
.done(function(data){
@@ -469,6 +472,7 @@ function resetPlayer()
469472
.fail(function(){
470473
console.log('error getting bitrate');
471474
});
475+
<?php endif;?>
472476
});
473477

474478
player.addEventListener('playing',function()

0 commit comments

Comments
 (0)