mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Bump Phraseanet Production Client
update video tools features, fix misc issues - fix pym.js integration issues - fix record editor's preview tab - add video Editor in record Editor - export VTT content to VideoTextTrack field
This commit is contained in:
@@ -20,6 +20,7 @@ use Alchemy\Phrasea\Model\Entities\Preset;
|
|||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Alchemy\Phrasea\Model\Manipulator\PresetManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\PresetManipulator;
|
||||||
use Alchemy\Phrasea\Model\Repositories\PresetRepository;
|
use Alchemy\Phrasea\Model\Repositories\PresetRepository;
|
||||||
|
use Alchemy\Phrasea\Twig\PhraseanetExtension;
|
||||||
use Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface;
|
use Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -206,18 +207,21 @@ class EditController extends Controller
|
|||||||
'h' => $thumbnail->get_height(),
|
'h' => $thumbnail->get_height(),
|
||||||
];
|
];
|
||||||
|
|
||||||
$elements[$indice]['preview'] = $this->render(
|
$elements[$indice]['template'] = $this->render(
|
||||||
'common/preview.html.twig',
|
'common/preview.html.twig',
|
||||||
['record' => $record]
|
['record' => $record, 'not_wrapped' => true]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$elements[$indice]['data'] = $this->getRecordElementData($record);
|
||||||
|
|
||||||
$elements[$indice]['type'] = $record->getType();
|
$elements[$indice]['type'] = $record->getType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$conf = $this->getConf();
|
||||||
$params = [
|
$params = [
|
||||||
'multipleDataboxes' => $multipleDataboxes,
|
'multipleDataboxes' => $multipleDataboxes,
|
||||||
'recordsRequest' => $records,
|
'recordsRequest' => $records,
|
||||||
|
'videoEditorConfig' => $conf->get(['video-editor']),
|
||||||
'databox' => $databox,
|
'databox' => $databox,
|
||||||
'JSonStatus' => json_encode($status),
|
'JSonStatus' => json_encode($status),
|
||||||
'JSonRecords' => json_encode($elements),
|
'JSonRecords' => json_encode($elements),
|
||||||
@@ -524,4 +528,35 @@ class EditController extends Controller
|
|||||||
return $this->app['manipulator.preset'];
|
return $this->app['manipulator.preset'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \record_adapter $record
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function getRecordElementData($record) {
|
||||||
|
$helpers = new PhraseanetExtension($this->app);
|
||||||
|
$recordData = [
|
||||||
|
'databoxId' => $record->getBaseId(),
|
||||||
|
'id' => $record->getId(),
|
||||||
|
'isGroup' => $record->isStory(),
|
||||||
|
'url' => (string)$helpers->getThumbnailUrl($record),
|
||||||
|
];
|
||||||
|
$userHaveAccess = $this->app->getAclForUser($this->getAuthenticatedUser())->has_access_to_subdef($record, 'preview');
|
||||||
|
if ($userHaveAccess) {
|
||||||
|
$recordPreview = $record->get_preview();
|
||||||
|
} else {
|
||||||
|
$recordPreview = $record->get_thumbnail();
|
||||||
|
}
|
||||||
|
|
||||||
|
$recordData['preview'] = [
|
||||||
|
'width' => $recordPreview->get_width(),
|
||||||
|
'height' => $recordPreview->get_height(),
|
||||||
|
'url' => $this->app->url('alchemy_embed_view', [
|
||||||
|
'url' => (string)($this->getAuthenticatedUser() ? $recordPreview->get_url() : $recordPreview->get_permalink()->get_url()),
|
||||||
|
'autoplay' => false
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
return $recordData;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -123,8 +123,8 @@ class LanguageController
|
|||||||
'One frame backward' => $translator->trans('One frame backward'),
|
'One frame backward' => $translator->trans('One frame backward'),
|
||||||
'Add an entry point' => $translator->trans('Add an entry point'),
|
'Add an entry point' => $translator->trans('Add an entry point'),
|
||||||
'Add an end point' => $translator->trans('Add an end point'),
|
'Add an end point' => $translator->trans('Add an end point'),
|
||||||
'Previous cuepoint' => $translator->trans('Previous cuepoint'),
|
'Navigate to entry point' => $translator->trans('Navigate to entry point'),
|
||||||
'Next cuepoint' => $translator->trans('Next cuepoint'),
|
'Navigate to end point' => $translator->trans('Navigate to end point'),
|
||||||
'Delete current' => $translator->trans('Delete current'),
|
'Delete current' => $translator->trans('Delete current'),
|
||||||
'Toggle loop' => $translator->trans('Toggle loop'),
|
'Toggle loop' => $translator->trans('Toggle loop'),
|
||||||
'Shift' => $translator->trans('Shift'),
|
'Shift' => $translator->trans('Shift'),
|
||||||
|
@@ -35,6 +35,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"alchemy-embed-medias": "^0.4.3",
|
"alchemy-embed-medias": "^0.4.3",
|
||||||
"phraseanet-production-client": "~0.19.14"
|
"phraseanet-production-client": "~0.19.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -424,6 +424,43 @@
|
|||||||
T_id: {{ JSonIds|raw }},
|
T_id: {{ JSonIds|raw }},
|
||||||
T_pos: {{ JSonIds|raw }},
|
T_pos: {{ JSonIds|raw }},
|
||||||
T_mval: []
|
T_mval: []
|
||||||
}
|
},
|
||||||
|
videoEditorConfig: {% if videoEditorConfig is not null %}{{ videoEditorConfig|json_encode()|raw }}{% else %}{}{% endif %},
|
||||||
|
records: [
|
||||||
|
|
||||||
|
{% for record in recordsRequest %}
|
||||||
|
{
|
||||||
|
id: {{ record.get_record_id }},
|
||||||
|
type: "{{ record.get_type() }}",
|
||||||
|
{% if record.get_type() == 'video' %}
|
||||||
|
{% set outputFormats = record.getSubdfefByDeviceAndMime(null, ['image/jpeg', 'image/png']) %}
|
||||||
|
{% set previewHtml5 = record.getSubdfefByDeviceAndMime(constant('\\databox_subdef::DEVICE_SCREEN'), ['video/ogg', 'video/mp4', 'video/webm']) %}
|
||||||
|
{% set dataW = constant('media_subdef::TC_DATA_WIDTH') %}
|
||||||
|
{% set dataH = constant('media_subdef::TC_DATA_HEIGHT') %}
|
||||||
|
|
||||||
|
{% set technical_info = record.get_technical_infos %}
|
||||||
|
{% set width = technical_info[dataW].value %}
|
||||||
|
{% set height = technical_info[dataH].value %}
|
||||||
|
|
||||||
|
{% if width and height %}
|
||||||
|
{% set ratio = (width / height)|number_format(2, '.') %}
|
||||||
|
{% else %}
|
||||||
|
{% set ratio = '' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
sources: [
|
||||||
|
{% for subdef in previewHtml5 %}
|
||||||
|
{
|
||||||
|
ratio: '{{ ratio }}',
|
||||||
|
framerate: {{ record.exif[constant('media_subdef::TC_DATA_FRAMERATE')] | round(2) }},
|
||||||
|
type: "{{ subdef.get_mime() }}",
|
||||||
|
src: "{{ subdef.get_url() }}"
|
||||||
|
}{% if not loop.last %},{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
]
|
||||||
|
{% endif %}
|
||||||
|
}{% if not loop.last %},{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user