Преглед изворни кода

#3907 Streams: option to mute player by default

Alex Trofimov пре 4 година
родитељ
комит
0b316b08aa

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

@@ -149,6 +149,7 @@ class BxStrmTemplate extends BxBaseModTextTemplate
         return $this->parseHtmlByName('stream_player.html', array(
             'suffix' => md5($aContentInfo[$CNF['FIELD_KEY']]),
             'sources' => $sSources,
+            'mute' => getParam('bx_stream_mute') ? 1 : 0,
         ));
     }
 

+ 1 - 0
modules/boonex/stream/install/langs/en.xml

@@ -34,6 +34,7 @@
     <string name="_bx_stream_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
     <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_form_entry"><![CDATA[Streams]]></string>
     <string name="_bx_stream_form_entry_display_add"><![CDATA[Add Stream]]></string>

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

@@ -55,7 +55,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_stream_per_page_browse_showcase', '32', @iCategId, '_sys_option_per_page_browse_showcase', 'digit', '', '', '', 150),
 ('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_always_accessible', '', @iCategId, '_bx_stream_option_always_accessible', 'checkbox', '', '', '', 170),
+('bx_stream_mute', '', @iCategId, '_bx_stream_option_mute', 'checkbox', '', '', '', 180);
 
 -- PAGE: create entry
 

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

@@ -14,7 +14,8 @@
         {
             sources: aSources,
             autoStart: true,
-            autoFallback: true
+            autoFallback: true,
+            mute: __mute__ // muted player always autoplays
         });
 
         // display some message when waiting for the stream to start