]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
фэнсибокс для видео
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 3 Apr 2025 14:42:46 +0000 (17:42 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 3 Apr 2025 14:42:46 +0000 (17:42 +0300)
erp24/views/bouquet/index.php

index feda1d26dd3bd68d7409c62044ed3a95dc1a6a5b..134fe0f8eda9416297330df178a0018a3dbdea29 100644 (file)
@@ -165,19 +165,17 @@ $this->title = 'Содержание матрицы';
                         <div class='col-md-2 d-flex flex-column gap-2'>
                             <div class='card bg-transparent border-0' style='aspect-ratio: 1/1; width: 100%; flex: 1;'>
                                 " . Html::a(
-                                Html::tag('video', '', [
-                                    'class'       => 'video-preview',
-                                    'src'         => Url::to($model->presentation->url ?? null),
-                                    'style'       => 'width: 100%; height: 100%; object-fit: cover;',
-                                    'autoplay'    => true,
-                                    'muted'       => true,
-                                    'loop'        => true,
-                                    'playsinline' => true,
+                            // Можно использовать превью-изображение или сам тег video в виде превью (хотя лучше заменить на картинку-превью)
+                                Html::img($previewImageUrls[1], [
+                                    'style' => 'width: 100%; height: 100%; object-fit: cover;',
                                 ]),
-                                Url::to($model->presentation->url ?? null),
+                                'javascript:;', // ссылка не должна вести никуда
                                 [
                                     'data-fancybox' => $galleryId,
-                                    'data-type' => 'video'
+                                    'data-src' => '<video controls style="width:100%; height:auto;">
+                           <source src="' . Url::to($model->presentation->url ?? null) . '" type="video/mp4">
+                       </video>',
+                                    'data-type' => 'html'
                                 ]
                             ) . "
                                 <div class='text-center bg-transparent fw-bold p-0 m-0'>Презентация</div>
@@ -199,19 +197,16 @@ $this->title = 'Содержание матрицы';
                         <div class='col-md-2 d-flex flex-column gap-2'>
                             <div class='card bg-transparent border-0' style='aspect-ratio: 1/1; width: 100%; flex: 1;'>
                                 " . Html::a(
-                                Html::tag('video', '', [
-                                    'class'       => 'video-preview',
-                                    'src'         => Url::to($model->buildProcess->url ?? null),
-                                    'style'       => 'width: 100%; height: 100%; object-fit: cover;',
-                                    'autoplay'    => true,
-                                    'muted'       => true,
-                                    'loop'        => true,
-                                    'playsinline' => true,
+                                Html::img($previewImageUrls[2], [
+                                    'style' => 'width: 100%; height: 100%; object-fit: cover;',
                                 ]),
-                                Url::to($model->buildProcess->url ?? null),
+                                'javascript:;',
                                 [
                                     'data-fancybox' => $galleryId,
-                                    'data-type' => 'video'
+                                    'data-src' => '<video controls style="width:100%; height:auto;">
+                           <source src="' . Url::to($model->buildProcess->url ?? null) . '" type="video/mp4">
+                       </video>',
+                                    'data-type' => 'html'
                                 ]
                             ) . "
                                 <div class='text-center bg-transparent fw-bold'>Процесс сборки</div>