|
@@ -103,9 +103,10 @@
|
|
|
|
|
|
<div>
|
|
<div>
|
|
<input type='file' id='v1' accept="video/*" />
|
|
<input type='file' id='v1' accept="video/*" />
|
|
|
|
+ <br/>
|
|
<button id='btn'>确定选择</button>
|
|
<button id='btn'>确定选择</button>
|
|
|
|
+ <img id="iv"/>
|
|
<video width="500" height="500" controls="controls" id='video'>
|
|
<video width="500" height="500" controls="controls" id='video'>
|
|
- <source id='data' src="" type="video/mp4">
|
|
|
|
</video>
|
|
</video>
|
|
</div>
|
|
</div>
|
|
</el-main>
|
|
</el-main>
|
|
@@ -1706,24 +1707,28 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+setTimeout(()=>{
|
|
|
|
+ const btn = document.getElementById('btn');
|
|
|
|
+ console.log(btn);
|
|
|
|
+ btn.addEventListener('click',()=>{
|
|
|
|
+ const fileObj = document.getElementById('v1').files[0];
|
|
|
|
+
|
|
|
|
+ let url;
|
|
|
|
+ if (window.createObjcectURL != undefined) {
|
|
|
|
+ console.log("1")
|
|
|
|
+ url = window.createOjcectURL(fileObj);
|
|
|
|
+ } else if (window.URL != undefined) {
|
|
|
|
+ url = window.URL.createObjectURL(fileObj);
|
|
|
|
+ console.log("2")
|
|
|
|
+ } else if (window.webkitURL != undefined) {
|
|
|
|
+ console.log("3")
|
|
|
|
+ url = window.webkitURL.createObjectURL(fileObj);
|
|
|
|
+ }
|
|
|
|
+ console.log("视频url",url)
|
|
|
|
+ document.getElementById('video').src = url;
|
|
|
|
+ })
|
|
|
|
+},2000)
|
|
|
|
|
|
-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>
|
|
</script>
|
|
<style rel="stylesheet/scss" lang="scss">
|
|
<style rel="stylesheet/scss" lang="scss">
|
|
.el-input-number {
|
|
.el-input-number {
|