lzm 2 rokov pred
rodič
commit
60e3392949
1 zmenil súbory, kde vykonal 28 pridanie a 0 odobranie
  1. 28 0
      ruoyi-ui/src/views/system/demo/index.vue

+ 28 - 0
ruoyi-ui/src/views/system/demo/index.vue

@@ -100,6 +100,14 @@
             <div  ref="exam3" v-loading="loading3" style="width: 800px; height:600px"></div>
 
           </div>
+
+          <div>
+            <input type='file' id='v1'/>
+            <button id='btn'>确定选择</button>
+            <video width="500" height="500" controls="controls" id='video'>
+              <source id='data' src="" type="video/mp4">
+            </video>
+          </div>
         </el-main>
       </el-col>
     </el-row>
@@ -1696,6 +1704,26 @@ export default {
     console.log(decrypt_CBC(encrypt_CBC("CBC_王立生")));
   },
 }
+
+
+
+const btn = document.getElementById('btn');
+console.log(btn);
+document.addEventListener('click',()=>{
+  var url = null;
+  const fileObj = document.getElementById('v1').files[0];
+  if (window.createObjcectURL != undefined) {
+    url = window.createOjcectURL(fileObj);
+  } else if (window.URL != undefined) {
+    url = window.URL.createObjectURL(fileObj);
+  } else if (window.webkitURL != undefined) {
+    url = window.webkitURL.createObjectURL(fileObj);
+  }
+
+  document.getElementById('data').src = url;
+  document.getElementById("video").load();
+  console.log(url);
+})
 </script>
 <style rel="stylesheet/scss" lang="scss">
 .el-input-number {