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:
Florian BLOUET
2016-07-05 13:29:30 +02:00
parent bb2d2084a9
commit 6774f5cd9e
4 changed files with 79 additions and 7 deletions

View File

@@ -20,6 +20,7 @@ use Alchemy\Phrasea\Model\Entities\Preset;
use Alchemy\Phrasea\Model\Entities\User;
use Alchemy\Phrasea\Model\Manipulator\PresetManipulator;
use Alchemy\Phrasea\Model\Repositories\PresetRepository;
use Alchemy\Phrasea\Twig\PhraseanetExtension;
use Alchemy\Phrasea\Vocabulary\ControlProvider\ControlProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -206,18 +207,21 @@ class EditController extends Controller
'h' => $thumbnail->get_height(),
];
$elements[$indice]['preview'] = $this->render(
$elements[$indice]['template'] = $this->render(
'common/preview.html.twig',
['record' => $record]
['record' => $record, 'not_wrapped' => true]
);
$elements[$indice]['data'] = $this->getRecordElementData($record);
$elements[$indice]['type'] = $record->getType();
}
}
$conf = $this->getConf();
$params = [
'multipleDataboxes' => $multipleDataboxes,
'recordsRequest' => $records,
'videoEditorConfig' => $conf->get(['video-editor']),
'databox' => $databox,
'JSonStatus' => json_encode($status),
'JSonRecords' => json_encode($elements),
@@ -524,4 +528,35 @@ class EditController extends Controller
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;
}
}

View File

@@ -123,8 +123,8 @@ class LanguageController
'One frame backward' => $translator->trans('One frame backward'),
'Add an entry point' => $translator->trans('Add an entry point'),
'Add an end point' => $translator->trans('Add an end point'),
'Previous cuepoint' => $translator->trans('Previous cuepoint'),
'Next cuepoint' => $translator->trans('Next cuepoint'),
'Navigate to entry point' => $translator->trans('Navigate to entry point'),
'Navigate to end point' => $translator->trans('Navigate to end point'),
'Delete current' => $translator->trans('Delete current'),
'Toggle loop' => $translator->trans('Toggle loop'),
'Shift' => $translator->trans('Shift'),

View File

@@ -35,6 +35,6 @@
},
"dependencies": {
"alchemy-embed-medias": "^0.4.3",
"phraseanet-production-client": "~0.19.14"
"phraseanet-production-client": "~0.19.15"
}
}

View File

@@ -424,6 +424,43 @@
T_id: {{ JSonIds|raw }},
T_pos: {{ JSonIds|raw }},
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>