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

#2195 Posts: videos aren't sized properly when Plyr isn't enabled

Alex Trofimov 7 лет назад
Родитель
Сommit
16099d2c7a

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -36,7 +36,7 @@ define('BX_DOL_PAGE_WIDTH', '1024px');
  */
 define('BX_PAGE_DEFAULT', 0); ///< default, regular page
 define('BX_PAGE_CLEAR', 2); ///< clear page, without any headers and footers
-define('BX_PAGE_EMBED', 2); ///< page used for embeds
+define('BX_PAGE_EMBED', 22); ///< page used for embeds
 define('BX_PAGE_POPUP', 44); ///< popup page, without any headers and footers
 define('BX_PAGE_TRANSITION', 150); ///< transition page with redirect to display some msg, like 'please wait', without headers footers
 

+ 12 - 4
modules/boonex/plyr/classes/BxPlyrPlayer.php

@@ -19,7 +19,7 @@ class BxPlyrPlayer extends BxDolPlayer
      * Standard view initialization params
      */
     protected static $CONF_STANDARD = '
-    <div class="bx_player_plyr" {attrs_wrapper}>
+    <div {attrs_wrapper}>
         <video {attrs}>
             {webm}
             {mp4}
@@ -62,14 +62,21 @@ class BxPlyrPlayer extends BxDolPlayer
     
     public function getCodeVideo ($iViewMode, $aParams, $bDynamicMode = false)
     {
+        $sInit = self::$CONF_STANDARD;
+        $sClass = 'bx-player-plyr';
+        
         // set visual mode
-
         switch ($iViewMode) {
-        case BX_PLAYER_STANDARD:
         case BX_PLAYER_MINI:
+            $sClass .= ' bx-player-plyr-mini';
+            break;
         case BX_PLAYER_EMBED:
+            $sClass .= ' bx-player-plyr-embed';
+            break;
+        case BX_PLAYER_STANDARD:
         default:
-                $sInit = self::$CONF_STANDARD;
+            $sClass .= ' bx-player-plyr-standard';
+            break;
         }
 
         // attrs
@@ -82,6 +89,7 @@ class BxPlyrPlayer extends BxDolPlayer
             'controlsList' => 'nodownload',
             'preload' => 'none',
             'autobuffer' => '', 
+            'class' => $sClass,
         );
         $aAttrs = isset($aParams['attrs']) && is_array($aParams['attrs']) ? $aParams['attrs'] : array();
         $aAttrs = array_merge($aAttrsDefault, $aAttrs);

+ 8 - 5
modules/boonex/plyr/template/css/main.css

@@ -1,7 +1,10 @@
-.bx_player_plyr video {
-    width:100% !important;
-    height:100% !important;
-}
-.bx_player_plyr {
+.bx-player-plyr {
     width:100%;
 }
+
+.bx-page-iframe .plyr,
+.bx-page-iframe .plyr__video-wrapper,
+.bx-page-iframe .plyr video {
+    width:100vw;
+    height:100vh;
+}

+ 7 - 0
template/css/general.css

@@ -476,3 +476,10 @@ div.bx-account-unit-online {
 .sys-author-profile .bx-menu-custom.bx-menu-hor > li:first-child .bx-base-general-unit-meta-div {
     display: none;
 }
+
+/* --------------- Author Info */
+
+video.bx-player-embed {
+    width:100vw;
+    height:100vh;
+}

+ 48 - 0
template/page_22.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="__lang__">
+<head>
+    <bx_injection:injection_head_begin />
+
+    <meta http-equiv="Content-Type" content="text/html; charset=__page_charset__" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
+    <title>__page_header__</title>
+    <base href="<bx_url_root />" />
+
+    __meta_info__
+    __page_robots__
+
+    <meta http-equiv="Content-Style-Type" content="text/css" />
+
+    <bx_include_css_styles />
+    <bx_include_css_system />
+    <bx_include_css />
+    <style>
+        body.bx-def-color-bg-page {
+            overflow:hidden;
+            background-color:#000;
+        }
+    </style>
+
+    __dol_images__
+    __dol_lang__
+    __dol_options__
+
+    <bx_include_js_system />
+    <bx_include_js />
+
+    <bx_include_auto:_header_js.html />
+    <bx_include_auto:_header_js_spinner.html />
+    <bx_include_auto:_header_js_custom.html />
+
+    __extra_js__
+
+    __system_injection_head__
+    <bx_injection:injection_head />
+    <bx_include_auto:_header_meta.html />
+</head>
+<body class="bx-def-font bx-def-color-bg-page bx-def-image-bg-page bx-page-iframe" dir="__lang_direction__" <bx_injection:injection_body /> >
+    __system_injection_header__
+    <bx_injection:injection_header />
+    __page_main_code__
+</body>
+</html>

+ 10 - 2
template/scripts/BxBasePlayerHTML5.php

@@ -58,13 +58,20 @@ class BxBasePlayerHTML5 extends BxDolPlayer
 
     public function getCodeVideo ($iViewMode, $aParams, $bDynamicMode = false)
     {
+        $sInit = self::$CONF_STANDARD;
+        $sClass = 'bx-player';
+
         // set visual mode
         switch ($iViewMode) {
-        case BX_PLAYER_STANDARD:
         case BX_PLAYER_MINI:
+            $sClass .= ' bx-player-mini';
+            break;
         case BX_PLAYER_EMBED:
+            $sClass .= ' bx-player-embed';
+            break;
+        case BX_PLAYER_STANDARD:
         default:
-                $sInit = self::$CONF_STANDARD;
+            $sClass .= ' bx-player-standard';
         }
 
         // attrs
@@ -73,6 +80,7 @@ class BxBasePlayerHTML5 extends BxDolPlayer
             'controlsList' => 'nodownload',
             'preload' => 'none',
             'autobuffer' => '', 
+            'class' => $sClass,
         );
         $aAttrs = isset($aParams['attrs']) && is_array($aParams['attrs']) ? $aParams['attrs'] : array();
         $aAttrs = array_merge($aAttrsDefault, $aAttrs);