sitegeist / assetsource-3qvideo
Neos 资源源码为 3Q 视频
v1.0.2
2024-05-29 14:05 UTC
Requires
- neos/neos: ^7.0 || ^8.0 || dev-master
This package is auto-updated.
Last update: 2024-08-29 14:37:23 UTC
README
A Neos Asset Source for 3QVideo (https://3q.video/). The videos are not actually imported once selected. Instead a metafile is created with just the metadata needed for rendering a player.
作者与赞助商
- Søren Malling - soren@websupply.dk
- Martin Ficzel - ficzel@sitegeist.de
该软件包的开发和公开发布得到了 http://www.sitegeist.de 的慷慨赞助。
设置
安装 composer 包
composer require sitegeist/assetsource-3qvideo
配置资源源码
在您的 Settings.yaml
中配置资源源码,全局或站点包中,以下为属性配置
Neos:
Media:
assetSources:
3qvideo:
assetSource: 'Sitegeist\AssetSource\ThreeQVideo\AssetSource\ThreeQVideoAssetSource'
assetSourceOptions:
label: '3Q Video'
description: ' 3Q Video asset source'
apiKey: <api-key>
projectId: <project-id>
在您的项目中使用资源
该软件包包含用于选择 3Q 视频的 Mixin 和用于渲染视频播放器的呈现组件。要在自己的项目中实际使用这些构建块,您必须定义一个具有配置和渲染的节点类型。
NodeTypes.3QVideo.yaml
'Vendor.Site:Content.3QVideo':
ui:
label: '3Q Video'
icon: video
superTypes:
'Neos.Neos:Content'
'Sitegeist.AssetSource.3QVideo:3QVideo': true
Content.3QVideo.fusion
prototype(Vendor.Site:Content.3QVideo) < prototype(Neos.Neos:ContentComponent) {
asset = ${q(node).property('3qvideo')}
renderer = Sitegeist.AssetSource.3QVideo:VideoPlayer {
playoutId = ${ThreeQVideo.playoutIdForAsset(props.asset)}
playerId = ${'video-' + node.identifier}
muted = ${props.muted ? props.muted : true}
autoplay = ${props.autoplay ? props.autoplay : false}
loop = ${props.loop ? props.loop : false}
controls = ${props.controls ? props.controls : true}
}
}
致谢
受 @bwaidelich 和 Pimcore 资源源码 格式的启发