PHP code example of renus / media

1. Go to this page and download the library: Download renus/media 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/ */

    

renus / media example snippets



// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new \Renus\MediaBundle\RenusMediaBundle(),
    );
    // ...
}



$this->container->get('renus.video')->getPicsFromVideo(
    '/path/to/video/vid1.m4v', 55, '/path/to/generate/image/vid1.jpg'
);



$this->container->get('renus.video')->generateAnimatedGifFromVideo(
    '/path/to/video/vid1.m4v', 10, '/path/to/generate/image/vid1.gif'
);



$this->container->get('renus.image')
                ->init('/path/to/image.jpg')
                ->createThumb('/path/to/resize-thumb.jpg', 300);



$this->container->get('renus.image')
                ->init('/path/to/image.jpg')
                ->crop('/path/to/crop-thumb.jpg', 100, 25, 300, 250);