Просмотр исходного кода

Merge branch 'master' of https://github.com/unaio/una

AntonLV 4 лет назад
Родитель
Сommit
0e930dd601

+ 1 - 1
modules/boonex/nexus/classes/BxNexusModule.php

@@ -35,7 +35,7 @@ class BxNexusModule extends BxDolModule
      */
     public function serviceInjectionHead()
     {
-        if (false === strpos($_SERVER['HTTP_USER_AGENT'], 'UNAMobileApp')) 
+        if (!isset($_SERVER['HTTP_USER_AGENT']) || false === strpos($_SERVER['HTTP_USER_AGENT'], 'UNAMobileApp')) 
             return '';
 
         $this->redirects();

+ 21 - 3
modules/boonex/stream/classes/BxStrmTemplate.php

@@ -127,7 +127,7 @@ class BxStrmTemplate extends BxBaseModTextTemplate
         ));
     }
  
-    public function entryStreamPlayer ($aContentInfo)
+    public function entryStreamPlayer ($aContentInfo, $aOptions = [])
     {
         $CNF = &$this->getModule()->_oConfig->CNF;
 
@@ -150,10 +150,21 @@ class BxStrmTemplate extends BxBaseModTextTemplate
             $this->addJs('ovenplayer/hls.min.js');
         $this->addJsTranslation('_bx_stream_txt_wait_for_stream');
 
+        $sImage = '';
+        $mixedImage = $this->_getHeaderImage($aContentInfo);
+        if($mixedImage !== false) {
+            if($o = BxDolTranscoder::getObjectInstance($mixedImage['transcoder']))
+                $sImage = $o->getFileUrlById($mixedImage['id']);                
+        }
+
+        if (!isset($aOptions['mute']))
+            $aOptions['mute'] = getParam('bx_stream_mute') ? 1 : 0;
+
         return $this->parseHtmlByName('stream_player.html', array(
             'suffix' => md5($aContentInfo[$CNF['FIELD_KEY']]),
             'sources' => $sSources,
-            'mute' => getParam('bx_stream_mute') ? 1 : 0,
+            'mute' => $aOptions['mute'],
+            'image' => $sImage,
         ));
     }
 
@@ -164,7 +175,7 @@ class BxStrmTemplate extends BxBaseModTextTemplate
         // TODO: visibility and other checks
 
         $sCode = $this->parseHtmlByName('stream_embed.html', array(
-            'player' => $this->entryStreamPlayer ($aContentInfo),
+            'player' => $this->entryStreamPlayer ($aContentInfo, ['mute' => (getParam('bx_stream_mute_embed') ? 1 : 0)]),
             'viewers' => $this->entryStreamViewers ($aContentInfo),
         ));
 
@@ -188,6 +199,13 @@ class BxStrmTemplate extends BxBaseModTextTemplate
 
         return array($sPhotoGallery, $sPhotoGallery);
     }
+
+    public function getTmplVarsText($aData)
+    {
+        $a = parent::getTmplVarsText($aData);
+        $a['bx_if:show_image']['condition'] = false;
+        return $a;
+    }
 }
 
 /** @} */

+ 4 - 3
modules/boonex/stream/install/langs/en.xml

@@ -35,6 +35,7 @@
     <string name="_bx_stream_option_auto_activation_for_categories"><![CDATA[Auto-Activation For Categories]]></string>
     <string name="_bx_stream_option_always_accessible"><![CDATA[Make Stream page accessible when not streaming]]></string>
     <string name="_bx_stream_option_mute"><![CDATA[Mute sound in player by default]]></string>
+    <string name="_bx_stream_option_mute_embed"><![CDATA[Mute sound in embed by default]]></string>
 
     <string name="_bx_stream_form_entry"><![CDATA[Streams]]></string>
     <string name="_bx_stream_form_entry_display_add"><![CDATA[Add Stream]]></string>
@@ -62,8 +63,8 @@
     <string name="_bx_stream_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this stream]]></string>
     <string name="_bx_stream_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
     <string name="_bx_stream_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the stream]]></string>
-    <string name="_bx_stream_form_entry_input_sys_covers"><![CDATA[Header Image]]></string>
-    <string name="_bx_stream_form_entry_input_covers"><![CDATA[Header Image]]></string>
+    <string name="_bx_stream_form_entry_input_sys_covers"><![CDATA[Poster Image]]></string>
+    <string name="_bx_stream_form_entry_input_covers"><![CDATA[Poster Image]]></string>
     <string name="_bx_stream_form_entry_input_covers_uploader_simple_title"><![CDATA[Upload]]></string>
     <string name="_bx_stream_form_entry_input_covers_uploader_html5_title"><![CDATA[Upload]]></string>
     <string name="_bx_stream_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
@@ -92,7 +93,7 @@
   <string name="_bx_stream_acl_action_create_entry"><![CDATA[Create Stream]]></string>
     <string name="_bx_stream_acl_action_delete_entry"><![CDATA[Delete Stream]]></string>
     <string name="_bx_stream_acl_action_view_entry"><![CDATA[View Stream]]></string>
-    <string name="_bx_stream_acl_action_set_thumb"><![CDATA[Set Stream Header Image]]></string>
+    <string name="_bx_stream_acl_action_set_thumb"><![CDATA[Set Stream Poster Image]]></string>
     <string name="_bx_stream_acl_action_edit_any_entry"><![CDATA[Edit Any Stream]]></string>
     <string name="_bx_stream_acl_action_delete_any_entry"><![CDATA[Delete Any Account]]></string>
     <string name="_bx_stream_acl_action_record"><![CDATA[Record Stream]]></string>

+ 2 - 1
modules/boonex/stream/install/sql/enable.sql

@@ -56,7 +56,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_stream_rss_num', '10', @iCategId, '_bx_stream_option_rss_num', 'digit', '', '', '', 20),
 ('bx_stream_auto_activation_for_categories', 'on', @iCategId, '_bx_stream_option_auto_activation_for_categories', 'checkbox', '', '', '', 160),
 ('bx_stream_always_accessible', '', @iCategId, '_bx_stream_option_always_accessible', 'checkbox', '', '', '', 170),
-('bx_stream_mute', '', @iCategId, '_bx_stream_option_mute', 'checkbox', '', '', '', 180);
+('bx_stream_mute', '', @iCategId, '_bx_stream_option_mute', 'checkbox', '', '', '', 180),
+('bx_stream_mute_embed', '', @iCategId, '_bx_stream_option_mute_embed', 'checkbox', '', '', '', 182);
 
 -- PAGE: create entry
 

+ 1 - 0
modules/boonex/stream/template/css/main.css

@@ -38,4 +38,5 @@
     right:0;
     background-color:rgba(255,255,255,0.3);
     color:#fff;
+    z-index:9;
 }

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

@@ -15,6 +15,7 @@
             sources: aSources,
             autoStart: true,
             autoFallback: true,
+            image: '__image__',
             mute: __mute__ // muted player always autoplays
         });