0

I need to be able to expose the video transcoding preset options within Node Edit pages. Currently, the Video module allows me to choose/change the Presets site-wide in Video modules settings page under admin/config/media/video/presets.

I have multiple presets with different video duration options. I am trying to let users to choose a preset option within node edit page and apply the video duration preset upon saving the node. I have it set to auto convert the video file upon saving the node. (example below)enter image description here

I've copied below(video.field.inc) to display the options within the node edit page but it doesn't get applied. -- The video transcoding process is broken.

$selectedpresets = array_filter(variable_get('video_preset', array())); $presets = Preset::getAllPresets(); $presetnames = array(); foreach ($presets as $preset) { $presetnames[$preset['name']] = $preset['name']; if (in_array($preset['name'], $selectedpresets)) { $presetnames[$preset['name']] .= ' (' . t('default') . ')'; } } $form['presets'] = array( '#title' => t('Presets'), '#type' => 'checkboxes', '#options' => $presetnames, '#default_value' => !empty($settings['presets']) ? $settings['presets'] : array(), '#description' => t('If any presets are selected, these presets will be used for this field instead of the default presets.'), '#access' => $hastranscoder, );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.