PHP Class Devise\Pages\Fields\Handlers\AudioFieldUpdated

Show file Open project: devisephp/cms Class Usage Examples

Protected Properties

Property Type Description
$formats array Formats that are valid to be encoded

Public Methods

Method Description
__construct ( MediaPaths $MediaPaths, null $Encoder = null, Framework $Framework ) Construct a new VideoFieldUpdated instance
handle ( Field $field, array $input ) : array This is called anytime after we update a video field in devise

Protected Methods

Method Description
buildSettings ( Field $field, array $input ) : array Build out the array of settings for the audio encoding
createTempHoldingFiles ( $unprocessed ) : void This just creates a blank file in the media-versions directory because if the user saves again (shortly after), we don't want to be sending multiple jobs to Zencoder.
filename ( FieldValues $values, string $format ) : string Creates the filename for this video path and format
findUnprocessedFiles ( Field $field, array $settings ) : array($unprocessed, Find the videos that have yet to be processed by Zencoder and then we filter those out
findUrlForFormat ( array $formats, string $find ) : string Find the url for the given formats
noAudioPathDefined ( Field $field, array $input ) : boolean Handle the case where the user removes the video or just doesn't specify a url path to a video
updateVersionUrls ( Field $field, $unprocessed, $duplicated ) : void Update the verion's urls for every format

Method Details

__construct() public method

Construct a new VideoFieldUpdated instance
public __construct ( MediaPaths $MediaPaths, null $Encoder = null, Framework $Framework )
$MediaPaths Devise\Media\MediaPaths
$Encoder null
$Framework Devise\Support\Framework

buildSettings() protected method

Build out the array of settings for the audio encoding
protected buildSettings ( Field $field, array $input ) : array
$field Field
$input array
return array

createTempHoldingFiles() protected method

We only send versions of the video to Zencoder that don't exist locally as a file.
protected createTempHoldingFiles ( $unprocessed ) : void
$unprocessed
return void

filename() protected method

Creates the filename for this video path and format
protected filename ( FieldValues $values, string $format ) : string
$values FieldValues
$format string
return string

findUnprocessedFiles() protected method

Find the videos that have yet to be processed by Zencoder and then we filter those out
protected findUnprocessedFiles ( Field $field, array $settings ) : array($unprocessed,
$field Field
$settings array
return array($unprocessed,

findUrlForFormat() protected method

Find the url for the given formats
protected findUrlForFormat ( array $formats, string $find ) : string
$formats array
$find string
return string

handle() public method

This is called anytime after we update a video field in devise
public handle ( Field $field, array $input ) : array
$field Field
$input array
return array

noAudioPathDefined() protected method

Handle the case where the user removes the video or just doesn't specify a url path to a video
protected noAudioPathDefined ( Field $field, array $input ) : boolean
$field Field
$input array
return boolean

updateVersionUrls() protected method

Update the verion's urls for every format
protected updateVersionUrls ( Field $field, $unprocessed, $duplicated ) : void
$field Field
$unprocessed
$duplicated
return void

Property Details

$formats protected property

Formats that are valid to be encoded
protected array $formats
return array