|
|
@@ -25,6 +25,10 @@
|
|
|
type: String,
|
|
|
default: ''
|
|
|
},
|
|
|
+ startTime: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
isLoading: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
@@ -125,6 +129,25 @@
|
|
|
console.error('播放器错误:', error);
|
|
|
// 在此处添加错误处理逻辑,如重连[reference:12]
|
|
|
});
|
|
|
+ this.player.on('timeupdate', (e) => {
|
|
|
+ if (!this.startTime) return;
|
|
|
+ const start = new Date(this.startTime.replace(/-/g, '/')).getTime();
|
|
|
+ const current = new Date(start + e.currentTime * 1000);
|
|
|
+ const pad = (n) => (n < 10 ? '0' + n : n);
|
|
|
+ const timeStr =
|
|
|
+ current.getFullYear() +
|
|
|
+ '-' +
|
|
|
+ pad(current.getMonth() + 1) +
|
|
|
+ '-' +
|
|
|
+ pad(current.getDate()) +
|
|
|
+ ' ' +
|
|
|
+ pad(current.getHours()) +
|
|
|
+ ':' +
|
|
|
+ pad(current.getMinutes()) +
|
|
|
+ ':' +
|
|
|
+ pad(current.getSeconds());
|
|
|
+ this.$bus.$emit('tapeTimeUpdate', timeStr);
|
|
|
+ });
|
|
|
// this.player.on('timeupdate', (e) => {
|
|
|
// this.$bus.$emit(
|
|
|
// 'tapeTimeUpdate',
|