|
|
@@ -157,6 +157,22 @@ function mount() {
|
|
|
|
|
|
return item.url || "";
|
|
|
}
|
|
|
+
|
|
|
+ // 专门处理视频文件的函数:优先取hls,若未取到取原本的url
|
|
|
+ Vue.prototype.getVideoUrl = (item) => {
|
|
|
+ if (!item) return "";
|
|
|
+
|
|
|
+ // 优先查找hls格式
|
|
|
+ if (item.subfiles && item.subfiles.length > 0) {
|
|
|
+ const hlsFile = item.subfiles.find(v => v.type == 'hls');
|
|
|
+ if (hlsFile && hlsFile.url) {
|
|
|
+ return hlsFile.url;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 未找到hls格式,返回原始url
|
|
|
+ return item.url || "";
|
|
|
+ }
|
|
|
Vue.prototype.formatTime = (date = new Date(), j1 = '-', j2 = ':') => {
|
|
|
const year = date.getFullYear()
|
|
|
const month = date.getMonth() + 1
|