From 170ee55bd1f0858fdbad3147a72c0f185d49a9a6 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 10 三月 2022 11:02:01 +0800
Subject: [PATCH] cameraPlayer 添加h265b播放功能
---
src/components/subComponents/FileUpload/index.vue | 51 +++++++++++++++++++--------------------------------
1 files changed, 19 insertions(+), 32 deletions(-)
diff --git a/src/components/subComponents/FileUpload/index.vue b/src/components/subComponents/FileUpload/index.vue
index 779bebb..796d99f 100644
--- a/src/components/subComponents/FileUpload/index.vue
+++ b/src/components/subComponents/FileUpload/index.vue
@@ -5,7 +5,6 @@
ref="uploader"
:options="options"
:file-status-text="statusText"
- :attrs="attrs"
class="uploader-single"
@file-added="onFileAdded"
@complete="onComplete"
@@ -24,7 +23,6 @@
<uploader
v-else
ref="uploader"
- :attrs="attrs"
:options="options"
:file-status-text="statusText"
class="uploader-example"
@@ -33,7 +31,7 @@
@complete="onComplete"
@close="closeHandle"
>
- <uploader-btn ref="button" :attrs="attrs">
+ <uploader-btn ref="button" :sourceType="sourceType">
<i class="el-icon-upload2" style="font-size:18px; color:#0088ff"></i>
涓婁紶
</uploader-btn>
@@ -55,9 +53,8 @@
UploaderList
},
props: {
- acptTypes: {
- type: String,
- default: ''
+ sourceType: {
+ type: Number,
},
tip: {
type: Boolean,
@@ -81,14 +78,14 @@
},
attrs: {
type: Object,
- // default () {
- // return {
+ default () {
+ return {
- // }
- // }
+ }
+ }
}
},
- data () {
+ data() {
return {
fileName: "",
fileMd5: "",
@@ -105,10 +102,10 @@
}
},
computed: {
- uploader () {
+ uploader() {
return this.$refs.uploader.uploader;
},
- options () {
+ options() {
return {
target: this.url,
testChunks: true,
@@ -119,14 +116,14 @@
}
},
methods: {
- onFileAdded (file) {
+ onFileAdded(file) {
if (this.single) {
this.uploader.fileList = this.uploader.fileList.slice([-1]);
this.$emit("file-added")
}
this.computeMD5(file);
},
- computeMD5 (file) {
+ computeMD5(file) {
let fileReader = new FileReader();
let time = new Date().getTime();
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
@@ -155,22 +152,13 @@
this.error(`鏂囦欢${file.name}璇诲彇鍑洪敊锛岃妫�鏌ヨ鏂囦欢`)
file.cancel();
};
- function loadNext () {
+ function loadNext() {
let start = currentChunk * chunkSize;
let end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
fileReader.readAsArrayBuffer(blobSlice.call(file.file, start, end));
}
},
- computeMD5Success (md5, file) {
- // 灏嗚嚜瀹氫箟鍙傛暟鐩存帴鍔犺浇uploader瀹炰緥鐨刼pts涓�
- // if (this.$route.path.indexOf("VideoManage") >= 0) {
- // Object.assign(this.uploader.opts, {
- // query: {
- // stackId: this.DataStackPool.selectedDir.id
- // // ...this.params,
- // }
- // })
- // }
+ computeMD5Success(md5, file) {
//灏嗚嚜瀹氫箟鍙傛暟鐩存帴鍔犺浇uploader瀹炰緥鐨刼pts涓�
if (location.href.indexOf("dataStack") >= 0) {
Object.assign(this.uploader.opts, {
@@ -184,20 +172,19 @@
file.resume();
this.statusText.paused = "鏆傚仠涓�";
},
- onComplete () {
- debugger
+ onComplete() {
this.$emit("complete", { filename: this.fileName, identifier: this.fileMd5 });
},
- fileComplete () {
+ fileComplete() {
// console.log('file complete', arguments)
},
- closeHandle () {
+ closeHandle() {
this.$emit("close")
}
},
- mounted () {
+ mounted() {
this.$nextTick(() => {
- console.log(this.acptTypes)
+ console.log(this.sourceType)
window.uploader = this.$refs.uploader.uploader
})
}
--
Gitblit v1.8.0