浏览代码

#3809 Streams: embeds aren't working correctly

Alex Trofimov 4 年之前
父节点
当前提交
4c4f2a7d16

+ 7 - 1
modules/boonex/stream/classes/BxStrmModule.php

@@ -97,9 +97,15 @@ class BxStrmModule extends BxBaseModTextModule
         exit;
     }
 
+    public function actionEmbed($iContentId, $sUnitTemplate = '', $sAddCode = '')
+    {
+        return $this->_serviceTemplateFunc ('embedStream', $iContentId);
+    }
+
     public function actionEmbedStream($iContentId = 0)
     {
-        $this->_serviceTemplateFunc ('embedStream', $iContentId);
+        header("Location:" . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'embed/' . $iContentId . '/', true, 301);
+        exit;
     }
 
     public function actionStreamViewers ($iContentId = 0)

+ 1 - 1
modules/boonex/stream/classes/BxStrmTemplate.php

@@ -54,7 +54,7 @@ class BxStrmTemplate extends BxBaseModTextTemplate
 
         $sUrlViewStream = 'page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . (int)$aContentInfo['id'];
         $sUrlViewStream = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink($sUrlViewStream);
-        $sUrlEmbed = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'embed_stream/' . (int)$aContentInfo['id'];
+        $sUrlEmbed = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'embed/' . (int)$aContentInfo['id'];
 
         $aForm = array(
             'form_attrs' => array(

+ 1 - 0
modules/boonex/stream/template/embed.html

@@ -0,0 +1 @@
+<iframe width="561" height="315" frameborder="0" allow="autoplay; picture-in-picture" allowfullscreen src="__url__"></iframe>