|
Stefan Drugda - 2015-12-20 08:30:24
Parse error: syntax error, unexpected '[' in .... testy\radio\offlineradio.class.php on line 7
Rahman Haghparast - 2015-12-20 08:58:06 - In reply to message 1 from Stefan Drugda
This is because of your version of php being less than 5.4.
You can either update your php version or replace line 7 and line 48 with the ones below:
Line 7:
public $playListFiles = array();
Line 48:
$playData = array();
Stefan Drugda - 2015-12-20 14:14:58 - In reply to message 2 from Rahman Haghparast
if (in_array($file,['.','..'])) ?? .... Parse error: syntax error, unexpected '['
Rahman Haghparast - 2015-12-20 15:08:13 - In reply to message 3 from Stefan Drugda
The same issue here. Replace that with the following.
if (in_array($file,array('.','..')))
Stuart Robertson - 2015-12-20 20:41:04 - In reply to message 4 from Rahman Haghparast
The same error in line 65
Stefan Drugda - 2015-12-21 17:16:50 - In reply to message 5 from Stuart Robertson
My guide - Installation:
1. create folder files
2. copy to files *.mp3 songs (...two songs)
3. create list.txt
.....\radio\files\peter.mp3,00:00:00
.... \radio\files\dazd.mp3,00:03:57
4. set in offlineradio.class.php to:
public $playListName = '';
public $playListFiles = array();
public $mp3Folder = '';
public $startTime = '00:00:00';
public $timeZone = 'Europe/Prague';
5. set in generatelist.php to:
$init->playListName = 'list.txt';
$init->startTime = '00:00:00';
6. run generatelist.php
7. run index.html
results:
Playing: (null)
Next: (null)
what should I do?
Rahman Haghparast - 2015-12-22 08:08:43 - In reply to message 6 from Stefan Drugda
Could you give me ftp access to check the issue?
Stefan Drugda - 2015-12-22 14:52:11 - In reply to message 7 from Rahman Haghparast
ok, send you with e-mail..
free tv - 2019-04-15 12:33:05 - In reply to message 7 from Rahman Haghparast
Hi!
you can insert an html player instead of "Content-type: audio/mpeg", I would like to insert a html player <source src = "horse.mp3" type = "audio / mpeg"> is it possible?
this is the class code
public function play ($ file, $ start = 0)
{
if (file_exists ($ file)) {
$ info = $ this-> get_mp3 ($ file, true, true);
$ end = floor ($ info ['data'] ['length']);
$ startIndex = ceil ($ start * (1 / 0.026));
$ endIndex = $ end> ​​0? ceil ($ end * (1 / 0.026)): -1;
$ startPos = $ info ['frames'] [$ startIndex] [0];
$ endPos = $ info ['frames'] [$ endIndex] [0] + $ info ['frames'] [$ endIndex] [2];
$ headerBytes = $ info ['frames'] [0] [0];
header ("Content-type: audio / mpeg");
// header ("Content-length:". filesize ($ file));
header ("Cache-Control: no-cache");
header ("Content-Transfer-Encoding: binary");
$ fp = fopen ($ file, 'r');
$ header = fread ($ fp, $ headerBytes);
fseek ($ fp, $ startPos);
$ data = fread ($ fp, $ endPos - $ startPos);
echo $ header. $ data;
}
else {
header ("HTTP / 1.0 404 Not Found");
}
}
|