mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
get videotexttrack field
This commit is contained in:
@@ -456,6 +456,34 @@ class ToolsController extends Controller
|
||||
return $this->app->json(['success' => true, 'errorMessage' => '']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return \Symfony\Component\HttpFoundation\JsonResponse
|
||||
*/
|
||||
public function getVideoTextTrackField(Request $request)
|
||||
{
|
||||
$records = RecordsRequest::fromRequest($this->app, $request, false);
|
||||
$videoTextTrackField = [];
|
||||
|
||||
if (count($records) == 1) {
|
||||
/** @var \record_adapter $record */
|
||||
$record = $records->first();
|
||||
$databox = $record->getDatabox();
|
||||
|
||||
|
||||
foreach ($databox->get_meta_structure() as $meta) {
|
||||
if (preg_match('/^VideoTextTrack(.*)$/iu', $meta->get_name(), $matches) && !empty($matches[1]) && strlen($matches[1]) == 2 ) {
|
||||
$field['label'] = $matches[1];
|
||||
$field['meta_struct_id'] = $meta->get_id();
|
||||
$videoTextTrackField[] = $field;
|
||||
unset($field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->app->json($videoTextTrackField);
|
||||
}
|
||||
|
||||
public function videoEditorAction(Request $request)
|
||||
{
|
||||
$records = RecordsRequest::fromRequest($this->app, $request, false);
|
||||
|
@@ -73,6 +73,7 @@ class Tools implements ControllerProviderInterface, ServiceProviderInterface
|
||||
->bind('prod_tools_metadata_save');
|
||||
|
||||
$controllers->get('/videoEditor', 'controller.prod.tools:videoEditorAction');
|
||||
$controllers->get('/videoTextTrack/field', 'controller.prod.tools:getVideoTextTrackField');
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
|
Reference in New Issue
Block a user