|
|
@@ -58,10 +58,16 @@
|
|
|
<div class="pec_h_r_btnArea">
|
|
|
<!-- openObserveDialog -->
|
|
|
<!-- toggleRecording -->
|
|
|
+
|
|
|
+ <div class="pec_h_r_btn_uploadVoiceBtn" @click="uploadVoiceBtn" v-if="courseDetail.userid == userid" v-show="false">
|
|
|
+ <span>{{ lang.ssUploadRecordingFile }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="pec_h_r_btn_afterClass" @click="afterClass" v-if="courseDetail.userid == userid">
|
|
|
<img src="../../assets/icon/newIcon/afterClass.svg" alt="" />
|
|
|
<span>{{ lang.ssEndClass }}</span>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="name_box" v-if="tType == 2">
|
|
|
{{ userJson.username }}
|
|
|
</div>
|
|
|
@@ -391,10 +397,9 @@ export default {
|
|
|
sendFileData();
|
|
|
}
|
|
|
}, 100);
|
|
|
- // setTimeout(()=>{
|
|
|
- // window.focus()
|
|
|
- // _pageWindow.focus()
|
|
|
- // },300)
|
|
|
+ setTimeout(()=>{
|
|
|
+ window.focus()
|
|
|
+ },100)
|
|
|
function openPageWindow(){
|
|
|
_pageWindow.focus()
|
|
|
}
|
|
|
@@ -625,6 +630,40 @@ export default {
|
|
|
console.log('同步数据')
|
|
|
}
|
|
|
},
|
|
|
+ // 直接上传录制音频/视频
|
|
|
+ uploadVoiceBtn(){
|
|
|
+ const input = document.createElement('input');
|
|
|
+ input.type = 'file';
|
|
|
+ input.accept = '.m4a,.mp4,.mov,.mp3,.wav';
|
|
|
+ input.click();
|
|
|
+ input.onchange = (e) => {
|
|
|
+ const fileList = e.target.files;
|
|
|
+ const file = fileList[0]
|
|
|
+ this.addPPTClass(file)
|
|
|
+ // 判断文件类型并获取音频或视频时长
|
|
|
+ // if (file && (file.type.startsWith('audio/') || file.type.startsWith('video/'))) {
|
|
|
+ // const url = URL.createObjectURL(file);
|
|
|
+ // let media;
|
|
|
+ // if (file.type.startsWith('audio/')) {
|
|
|
+ // media = new Audio();
|
|
|
+ // } else {
|
|
|
+ // media = document.createElement('video');
|
|
|
+ // }
|
|
|
+ // media.preload = 'metadata';
|
|
|
+ // media.src = url;
|
|
|
+ // media.onloadedmetadata = () => {
|
|
|
+ // const duration = media.duration;
|
|
|
+ // console.log('文件时长(秒):', duration);
|
|
|
+ // // 这里可以赋值或者进一步处理时长 duration
|
|
|
+ // URL.revokeObjectURL(url);
|
|
|
+ // };
|
|
|
+ // media.onerror = () => {
|
|
|
+ // console.error('无法读取文件时长');
|
|
|
+ // URL.revokeObjectURL(url);
|
|
|
+ // };
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
destroyed() {
|
|
|
clearInterval(this.opertimer);
|
|
|
@@ -809,6 +848,12 @@ export default {
|
|
|
color: #F53F3F;
|
|
|
}
|
|
|
|
|
|
+.pec_h_r_btn_uploadVoiceBtn{
|
|
|
+ border-color: #F0E1DD;
|
|
|
+ background-color: #FFF7F5;
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
.backBtn {
|
|
|
width: 15px;
|
|
|
height: 15px;
|