Короче проблема в файлах, а точнее в музыке.
Некоторые треки загружаешь и все нормально, открываешь и добавляешь в музыку.
Но большенство загружаешь трек, открываешь и тупо белый экран! (Это даже на чистых версиях социала).
Как исправить это?
var $filesize = -1;
/**
* Byte at which the first mpeg header was found
* @var integer
*/
var $frameoffset = -1;
/**
* length of mp3 format hh:mm:ss
* @var string
*/
var $lengthh = false;
/**
* length of mp3 format mm:ss
* @var string
*/
var $length = false;
/**
* length of mp3 in seconds
* @var string
*/
var $lengths = false;
/**
* if any errors they will be here
* @var string
*/
var $error = false;
/*
* creates a new id3 object
* and loads a tag from a file.
*
* @param string $study study the mpeg frame to get extra info like bitrate and frequency
* You should advoid studing alot of files as it will siginficantly
* slow this down.
* @access public
*/
function MP3_Id($study = false) {
if(defined('ID3_SHOW_DEBUG')) $this->debug = true;
$this->study=($study || defined('ID3_AUTO_STUDY'));
} // id3()
/**
* reads the given file and parse it
*
* @param string $file the name of the file to parse
* @return mixed PEAR_Error on error
* @access public
*/
function read( $file="") {
if ($this->debug) print($this->debugbeg . "id3('$file')<HR>\n");
if(!empty($file))$this->file = $file;
if ($this->debug) print($this->debugend);
return $this->_read_v1();
}
/**
* sets a field
*
* possible names of tags are:
* artists - Name of band or artist
* album - Name of the album
* year - publishing year of the album or song
* comment - song comment
* track - the number of the track
* genre - genre of the song
* genreno - Number of the genre
*
* @param mixed $name Name of the tag to set or hash with the key as fieldname
* @param mixed $value the value to set
*
* @access public
*/
function setTag($name, $value) {
if( is_array($name)) {
foreach( $name as $n => $v) {
$this -> $n = $v ;
}
} else {
$this -> $name = $value ;
}
}
/**
* get the value of a tag
*
* @param string $name the name of the field to get
* @param mixed $default returned if the field not exists
*
* @return mixed The value of the field
* @access public
* @see setTag
*/
function getTag($name, $default = 0) {
if(empty($this -> $name)) {
return $default ;
} else {
return $this -> $name ;
}
}
/**
* update the id3v1 tags on the file.
* Note: If/when ID3v2 is implemented this method will probably get another
* parameters.
*
* @param boolean $v1 if true update/create an id3v1 tag on the file. (defaults to true)
*
* @access public
*/
function write($v1 = true) {
if ($this->debug) print($this->debugbeg . "write()<HR>\n");
if ($v1) {
$this->_write_v1();
}
if ($this->debug) print($this->debugend);
} // write()
/**
* study() - does extra work to get the MPEG frame info.
*
* @access public
*/
function study() {
$this->studied = true;
$this->_readframe();
} // study()
/**
* copy($from) - set's the ID3 fields to the same as the fields in $from
*
* @param string $from fields to copy
* @access public
*/
function copy($from) {
if ($this->debug) print($this->debugbeg . "copy(\$from)<HR>\n");
$this->name = $from->name;
$this->artists = $from->artists;
$this->album = $from->album;
$this->year = $from->year;
$this->comment = $from->comment;
$this->track = $from->track;
$this->genre = $from->genre;
$this->genreno = $from->genreno;
if ($this->debug) print($this->debugend);
} // copy($from)
/**
* remove - removes the id3 tag(s) from a file.
*
* @param boolean $id3v1 true to remove the tag
* @param boolean $id3v2 true to remove the tag (Not yet implemented)
*
* @access public
*/
function remove($id3v1 = true, $id3v2 = true) {
if ($this->debug) print($this->debugbeg . "remove()<HR>\n");
if ($id3v1) {
$this->_remove_v1();
}
if ($id3v2) {
// TODO: write ID3v2 code
}
if ($this->debug) print($this->debugend);
} // remove
/**
* read a ID3 v1 or v1.1 tag from a file
*
* $file should be the path to the mp3 to look for a tag.
* When in doubt use the full path.
*
* @return mixed PEAR_Error if fails
* @access private
*/
function _read_v1() {
if ($this->debug) print($this->debugbeg . "_read_v1()<HR>\n");
if (! ($f = @fopen($this->file, 'rb')) ) {
return PEAR::raiseError( "Unable to open " . $this->file, PEAR_MP3_ID_FNO);
}
if (fseek($f, -128, SEEK_END) == -1) {
return PEAR::raiseError( 'Unable to see to end
________ посл. ред. 19.05.2019 в 00:30; всего 1 раз(а); by DENZEL