classes/Input/EncodingProviders/Zencoder.php
public function encode($source, $preset)
    {
        // Tell the Zencoder SDK to create a job
        try {
            $outputs = $this->outputsConfig($preset);
            $job = $this->sdk()->jobs->create([
                'input' => $source,
                'output' => $outputs,
            ]);

            // Store the response from the SDK
            $this->model->storeJob($job->id, $this->outputsToHash($job->outputs));

        // Report an error with the encode
        } catch (Services_Zencoder_Exception $e) {
            $this->model->status('error', implode(' ', $this->zencoderArray($e->getErrors())));
        } catch (Exception $e) {
            $this->model->status('error', $e->getMessage());
        }
    }
public function encode($source, $preset)
    {
        // Tell the Zencoder SDK to create a job
        try {
            $outputs = $this->outputsConfig($preset);
            $job = $this->sdk()->jobs->create([
                'input' => $source,
                'output' => $outputs,
            ]);

            // Store the response from the SDK
            $this->model->storeJob($job->id, $this->outputsToHash($job->outputs));

        // Report an error with the encode
        } catch (Services_Zencoder_Exception $e) {
            $this->model->status('error', implode(' ', $this->zencoderArray($e->getErrors())));
        } catch (Exception $e) {
            $this->model->status('error', $e->getMessage());
        }
    }
public function encode ( $ source , $ preset ) { // Tell the Zencoder SDK to create a job try { $ outputs = $ this -> outputsConfig ( $ preset ) ; $ job = $ this -> sdk ( ) -> jobs -> create ( [ 'input' => $ source , 'output' => $ outputs , ] ) ; // Store the response from the SDK $ this -> model -> storeJob ( $ job -> id , $ this -> outputsToHash ( $ job -> outputs ) ) ; // Report an error with the encode } catch ( Services_Zencoder_Exception $ e ) { $ this -> model -> status ( 'error' , implode ( ' ' , $ this -> zencoderArray ( $ e -> getErrors ( ) ) ) ) ; } catch ( Exception $ e ) { $ this -> model -> status ( 'error' , $ e -> getMessage ( ) ) ; } }
Tell the service to encode an asset it's source

@param  string $source A full URL for the source asset
@param  string $preset The key to the preset function
@return void
Tell the service to encode an asset it s source