Sfoglia il codice sorgente

去除视频提取音频功能

SanHQin 4 mesi fa
parent
commit
472ac06cb7

+ 33 - 12
src/components/pages/classroomObservation/components/baseMessage.vue

@@ -302,10 +302,11 @@
 			</div>
 			
 		</div>
+		<!-- <el-button @click="testFFmpeg">testFFmpeg</el-button> -->
 		<previewVideoDialog ref="previewVideoDialogRef" />
 		<uploadFile v-if="progressData.uploadVideo" ref="uploadFileRef" @progressUpdate="videoProgressUpdate" @delUpload="videoDelUpload" @success="updateVideoSuccess" @startUpload="videoStartUpload"/>
 		<resourceLibraryDialog ref="resourceLibraryDialogRef" @addFile="resourceLibraryDialogAddFile"/>
-		<iframe ref="iframeFFmpegRef"  allow="camera *; microphone *;display-capture;midi;encrypted-media;" src="https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/static/cocoroboffmpeg/index.html" v-show="false"></iframe><!--https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/cocoroboffmpeg  http://localhost:8080/#/cocoroboffmpeg-->
+		<!-- <iframe ref="iframeFFmpegRef"  allow="camera *; microphone *;display-capture;midi;encrypted-media;" src="https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/static/cocoroboffmpeg/index.html" v-show="false"></iframe>https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/cocoroboffmpeg  http://localhost:8080/#/cocoroboffmpeg -->
 	</div>
 </template>
 
@@ -626,12 +627,13 @@ export default {
 					url: data.Location,
 			})
 			this.$message.success("上传成功");
-			this.$confirm("是否提取视频音频并上传?","提示").then(()=>{
-				this.getVideoVoice({file:this.uploadFileObj});
-				this.uploadFileObj = null;
-			}).catch(err=>{
-				this.uploadFileObj = null;
-			})
+			this.uploadFileObj = null;
+			// this.$confirm("是否提取视频音频并上传?","提示").then(()=>{
+			// 	this.getVideoVoice({file:this.uploadFileObj});
+			// 	this.uploadFileObj = null;
+			// }).catch(err=>{
+			// 	this.uploadFileObj = null;
+			// })
 		},
 		videoProgressUpdate(data){
 			if(data.status=="processing"){
@@ -869,9 +871,9 @@ ${this.data.editorBarData?this.data.editorBarData.content:""}
 			})
 			this.$message.success("上传成功")
 
-			this.$confirm("是否提取视频音频并上传?","提示").then(()=>{
-				this.getVideoVoice({url:_file.file});
-			})
+			// this.$confirm("是否提取视频音频并上传?","提示").then(()=>{
+			// 	this.getVideoVoice({url:_file.file});
+			// })
 		},
 		async getVideoVoice(obj){
 			if(this.loading)return this.$message.info("请稍等");
@@ -895,7 +897,8 @@ ${this.data.editorBarData?this.data.editorBarData.content:""}
 			if (!_file) return this.$message.error("文件不存在");
 
 			try {
-				await this.$refs.iframeFFmpegRef.contentWindow.postMessage({type:'extractAudio',file:_file},'*');
+				// await this.$refs.iframeFFmpegRef.contentWindow.postMessage({type:'extractAudio',file:_file},'*');
+
 			// this.$message.success("提取音频成功")
 			// this.loading = false;
 			// console.log(data)
@@ -905,7 +908,25 @@ ${this.data.editorBarData?this.data.editorBarData.content:""}
 				this.loading = false;
 			}
 
-		}
+		},
+		// testFFmpeg(){
+		// 	let input = document.createElement("input");
+		// 	input.type = "file";
+		// 	input.accept = "video/*";
+		// 	input.click();
+		// 	input.onchange = () => {
+		// 		let file = input.files[0];
+		// 		setTimeout(()=>{
+		// 			var testwindow = window.open("http://localhost:8082/");
+
+		// 			setTimeout(()=>{
+		// 				console.log("测试测试")
+		// 				testwindow.postMessage({type:'extractAudio',file:file},'*');
+		// 			},5000)
+		// 		})
+		// 	}
+			
+		// }
 	},
 	mounted() {
 		window.addEventListener('message',(e)=>{