PHP code example of owen-oj / laravel-getid3

1. Go to this page and download the library: Download owen-oj/laravel-getid3 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

owen-oj / laravel-getid3 example snippets


//calling this method will return artwork in base64 string
$track->getArtwork();
//Optionally you can pass can pass `true` to the method to get a jpeg version. This will return an UploadedFile instance
$track->getArtwork(true);
 php
use Owenoj\LaravelGetId3\GetId3;

//instantiate class with file
$track = new GetId3(request()->file('file'));

// Use static methods:
$track = GetId3::fromUploadedFile(request()->file('file'));
$track = GetId3::fromDiskAndPath('local', '/some/file.mp3');
$track = GetId3::fromDiskAndPath('s3', '/some/file.mp3'); // even works with S3

//get all info
$track->extractInfo();

//get title
$track->getTitle();

//get playtime
$track->getPlaytime();