修复bug 视频回放 ios端

This commit is contained in:
yanran200730
2022-04-22 10:45:41 +08:00
parent 8d5cb694a1
commit 9d402cb729
2 changed files with 8 additions and 9 deletions

View File

@@ -119,10 +119,7 @@
}, },
onDateChange (e) { onDateChange (e) {
console.log(e)
this.date = `${e.result}` this.date = `${e.result}`
// this.date = `${e.year}-${e.month}-${e.day}`
this.getSlwPlaybackTime() this.getSlwPlaybackTime()
}, },
@@ -176,8 +173,8 @@
const times = res.data[0].times const times = res.data[0].times
this.times = times.map(item => { this.times = times.map(item => {
const startTime = (item.startTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 const startTime = (item.startTime - new Date(this.date.replaceAll('-', '/') + ' 00:00:00').getTime()) / 1000
const endTime = (item.endTime - new Date(this.date + ' 00:00:00').getTime()) / 1000 const endTime = (item.endTime - new Date(this.date.replaceAll('-', '/') + ' 00:00:00').getTime()) / 1000
return { return {
startTime: Number(startTime.toFixed(0)), startTime: Number(startTime.toFixed(0)),

View File

@@ -78,7 +78,7 @@
this.isHide = false this.isHide = false
if (!this.isChoose) return if (!this.isChoose) return
this.x = e.clientX - canvasInfo.left - 4 this.x = e.clientX - canvasInfo.left
this.ratioW = this.x / this.canvasWidth this.ratioW = this.x / this.canvasWidth
} else { } else {
this.isHide = true this.isHide = true
@@ -176,12 +176,13 @@
drawLine(ctx, options) { drawLine(ctx, options) {
const { beginX, beginY, endX, endY, lineColor, lineWidth } = options const { beginX, beginY, endX, endY, lineColor, lineWidth } = options
ctx.beginPath()
ctx.lineWidth = lineWidth ctx.lineWidth = lineWidth
ctx.strokeStyle = lineColor
ctx.beginPath()
ctx.moveTo(beginX, beginY) ctx.moveTo(beginX, beginY)
ctx.lineTo(endX, endY) ctx.lineTo(endX, endY)
ctx.strokeStyle = lineColor
ctx.stroke() ctx.stroke()
ctx.closePath()
}, },
renderPlayback () { renderPlayback () {
@@ -197,7 +198,7 @@
lineWidth: item.endTime * unit - item.startTime * unit lineWidth: item.endTime * unit - item.startTime * unit
}) })
}) })
ctx.draw() ctx.draw(true)
}, },
renderTimeLine () { renderTimeLine () {
@@ -250,6 +251,7 @@
user-select: none; user-select: none;
cursor: e-resize; cursor: e-resize;
-webkit-user-drag: none; -webkit-user-drag: none;
transform: translateX(-50%);
} }
.time-scale { .time-scale {