视频-本地资源

This commit is contained in:
zhanglipeng
2021-01-29 15:34:39 +08:00
parent 4fbb01b54e
commit 611695463a
5 changed files with 28 additions and 22 deletions

View File

@ -22,8 +22,8 @@
<span>{{ i + 1 }}.</span>
<i class="el-icon-document icon"></i>{{ ele.name }}
</div>
<a class="right" :href="apiurl + ele.fileurl">下载</a>
<!-- <a class="right" @click="down(ele)">下载</a> -->
<!-- <a class="right" :href="apiurl + ele.fileurl">下载</a> -->
<a class="right" @click="down(ele)">下载</a>
</li>
</ul>
</div>

View File

@ -103,10 +103,11 @@
import {
listVideo,
getVideo,
privateDownloadUrl
privateDownloadUrl,
} from "@/api/benyi_train/video";
import { listAllLecturer } from "@/api/benyi_train/lecturer";
import { listMoedata } from "@/api/system/moedata";
import { downLoadVideoUrl } from "@/utils/zipdownload";
export default {
name: "VideoStudy",
@ -132,17 +133,17 @@ export default {
type: undefined,
status: "0",
pageNum: 1,
pageSize: 8
}
pageSize: 8,
},
};
},
created() {
this.getList();
listAllLecturer().then(response => {
listAllLecturer().then((response) => {
//console.log(response.lecturer);
this.lecturerOptions = response.lecturer;
});
listMoedata(this.queryParams).then(response => {
listMoedata(this.queryParams).then((response) => {
//第一步转换数组
this.optionTypes = this.handleTree(response.data, "id", "pid");
//第二步移除children为0的数组也就是将children为0 设置为undefined
@ -172,9 +173,10 @@ export default {
/** 查询培训列表 */
getList() {
this.loading = true;
listVideo(this.queryParams).then(response => {
listVideo(this.queryParams).then((response) => {
this.videoList = response.rows;
this.playerOptions = response.rows.map(ele => {
this.playerOptions = response.rows.map((ele) => {
console.log(ele.videourl);
return {
autoplay: false,
muted: true,
@ -185,8 +187,9 @@ export default {
{
type: ele.filetype,
// mp4
src: ele.videourl
}
// src: ele.videourl
src: downLoadVideoUrl(ele.videourl),
},
],
notSupportedMessage: "此视频暂无法播放,请稍后再试",
poster: "",
@ -194,8 +197,8 @@ export default {
timeDivider: true,
durationDisplay: false,
remainingTimeDisplay: false,
fullscreenToggle: true //全屏按钮
}
fullscreenToggle: true, //全屏按钮
},
};
});
this.total = response.total;
@ -217,8 +220,8 @@ export default {
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}
}
},
},
};
</script>