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控件仍然可访问。
贡献
欢迎贡献,请随意创建pull request。