saschaschieferdecker / youtube_gdprembed
该包已被弃用且不再维护。作者建议使用saschaschieferdecker/youtube-gdprembed包。
创建一个新内容类型,点击后嵌入YouTube视频。首选项可以保存在cookie中。不依赖于JS框架。
2.0.1
2023-05-04 12:44 UTC
Requires
- typo3/cms-core: >=11.5.0,<11.5.99
- typo3/cms-fluid-styled-content: >=11.5.0,<11.5.99
- typo3/cms-frontend: >=11.5.0,<11.5.99
Replaces
- typo3-ter/youtube-gdprembed: 2.0.1
README
通过JavaScript嵌入YouTube视频的扩展,以符合GDPR规则。
现有的扩展要么不支持TYPO3 v11,要么不符合我的使用场景。
功能
-
提供新的内容类型
-
首选项可以存储在cookie中。
-
可选禁用通过YouTube JavaScript API显示相关视频。
-
扩展尝试通过oembed API从YouTube服务器获取预览图片以显示,而无需在用户浏览器中加载。
-
自定义CSS和JS易于实现
-
不依赖于jQuery或其他框架
-
如果需要,可以将数据处理程序替换为自定义处理程序
-
支持Chrome、Firefox、IE11和主要移动浏览器
屏幕截图
安装
composer require saschaschieferdecker/youtube_gdprembed
或通过TER
配置
-
将Typoscript-Setup包含在您的模板中
-
通过常量编辑器编辑设置或直接自定义设置
plugin.tx_youtubegdprembed {
settings {
# ID of page with privacy information
privacyPage = {$plugin.tx_youtubegdprembed.settings.privacyPage}
# Set a cookie that user has accepted information about youtube
persistAcceptance = {$plugin.tx_youtubegdprembed.settings.persistAcceptance}
# Storage and folder for storing the downloaded preview images
storagePreviewImages = {$plugin.tx_youtubegdprembed.settings.storagePreviewImages}
}
}
# Define Output template
tt_content {
youtubegdprembed_youtube =< lib.contentElement
youtubegdprembed_youtube {
templateName = Youtube.html
templateRootPaths {
198 = {$plugin.tx_youtubegdprembed.settings.templateRootPath}
}
dataProcessing {
1 = SaschaSchieferdecker\YoutubeGdprembed\DataProcessing\YoutubeProcessor
}
}
}
page.includeCSSLibs {
youtubegdprembed = {$plugin.tx_youtubegdprembed.settings.cssFile}
}
page.includeJSFooterlibs {
youtubegdprembed = {$plugin.tx_youtubegdprembed.settings.jsFile}
}
注意
截至2018年10月,您可以通过设置嵌入时“rel=0”参数来隐藏相关视频。
这不再像以前那样起作用了。您自己的频道中的相关视频仍然会显示。
因此,此扩展利用了Maximilian Laumeister描述的相当复杂的解决方案,通过创建一些CSS覆盖来隐藏这些相关视频,如果设置了相应的选项。我提到过IE11很糟糕吗?
已知问题和限制
IE11在隐藏相关视频时不会显示覆盖图标,但仍然可以访问常规的YouTube控件。
贡献
非常欢迎贡献,请随意创建拉取请求。

