小编Ben*_*Ben的帖子

在fancybox 3中自动播放YouTube视频(隐私增强模式)

通过将附加?autoplay=1到视频网址,可以在花式框中自动播放常规YouTube视频:

<a class="lightbox" href="https://www.youtube.com/embed/zRwBVYjUBOc?autoplay=1">video</a>
Run Code Online (Sandbox Code Playgroud)

……和……

$(document).ready(function(){
    $("a.lightbox").fancybox();
});
Run Code Online (Sandbox Code Playgroud)

不幸的是,在某些浏览器(Chrome,Safari)中,如果启用了“隐私增强模式”(youtube-nocookie.com),则无法使用:

<a class="lightbox" href="https://www.youtube-nocookie.com/embed/zRwBVYjUBOc?autoplay=1">privacy-enhanced mode video</a>
Run Code Online (Sandbox Code Playgroud)

autoplay=1youtube-nocookie.com上不完全支持该选项。

如何在具有隐私增强模式的灯箱中自动播放视频?

编辑(3月23日): Firefox,Chrome和Safari立即在https://www.youtube.com/embed/zRwBVYjUBOc?autoplay=1上开始播放视频(也没有fancybox,只需打开url)。我发现Firefox仍可以在https://www.youtube-nocookie.com/embed/zRwBVYjUBOc?autoplay=1上开始播放视频,只有Safari和Chrome无法播放。

youtube jquery fancybox fancybox-3

5
推荐指数
1
解决办法
574
查看次数

关于如何为 ext:news 的列表和详细视图设置路由增强器的良好实践?

前提

ext:news 列表视图插件位于 www.domain.com/news [ID 9] 页面上,详细视图位于 www.domain.com/article [ID 39] 上。

按照官方示例(docs.typo3.org)

我尝试了功能描述的“Extbase插件增强器”示例,但这引起了一些问题:

  • 页面浏览器链接到第 2 页有一个 cHash:news/list/2?cHash=123456789
  • 从第 2 页到第 1 页的 pagebrowser 链接有很多获取参数: news?tx_news_pi1%5Baction%5D=list&tx_news_pi1%5Bcontroller%5D=News&cHash=123456789 。如果没有routeEnhancer,它就只是没有任何获取参数的“新闻”。
  • 详细视图的链接有一个 cHash:article/blog/9?cHash=52e8a4b7c6318cfe0273e7eab374e9ae
  • 网址包含不需要的段(“列表”+“博客”)
  • acticle url 不包含新闻标题

造成某些问题的原因之一可能是分页器未在其链接中指定控制器:news?tx_news_pi1[@widget_0][currentPage]=2&cHash=123456789

我的方法,已经解决了提到的问题

我将其拆分为两个单独的路由增强器(Extbase + 插件),删除了“defaultController”、“defaults”、“requirements”段并添加了“aspects”:

routeEnhancers:
  NewsDetail:
    type: Extbase
    limitToPages: [39]
    extension: News
    plugin: Pi1
    routes:
      - { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
    aspects:
      news_title:
        type: PersistedAliasMapper
        tableName: 'tx_news_domain_model_news'
        routeFieldName: 'path_segment'
  NewsList:
    type: Plugin
    limitToPages: [9]
    routePath: '/{@widget_0/currentPage}'
    namespace: 'tx_news_pi1'
    aspects:
      '@widget_0/currentPage':
        type: …
Run Code Online (Sandbox Code Playgroud)

typo3 extbase typo3-extensions tx-news typo3-9.x

4
推荐指数
1
解决办法
3363
查看次数