Przeglądaj źródła

video demo添加

haojianlong 4 lat temu
rodzic
commit
7153a7675b
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      docs/.vuepress/components/scene/items/video.vue

+ 7 - 1
docs/.vuepress/components/scene/items/video.vue

@@ -26,14 +26,20 @@
             this.VObject = document.createElement('VIDEO');
             this.VObject.setAttribute('width', '600');
             this.VObject.setAttribute('height', '480');
+            // 设置自动播放
             this.VObject.setAttribute('autoplay', 'autoplay');
+            // 设置视频路径
             this.VObject.setAttribute('src', v);
-
+            // 设置循环播放
+            this.VObject.setAttribute('loop', 'loop');
+            // 添加到对应的容器中
             let VBox = document.getElementById(this.box);
             if (VBox) {
+                // 先清空
                 VBox.innerHTML = '';
                 VBox.appendChild(this.VObject);
             }
+            // 隐藏video标签
             this.VObject.style.display = 'none';
         }
         /** item 宽 */