blob: 80da31fd382051b5dbb52d65427df88013ad4484 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import React, { Component } from 'react'
// import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
import { ZOOM_STEPS } from 'app/constants'
import { timestamp } from 'app/utils'
const PlayCursor = ({ timeline, audio }) => {
const { start_ts, zoom, duration } = timeline
const { play_ts } = audio
const secondsPerPixel = ZOOM_STEPS[zoom] * 0.1
const y = (play_ts - start_ts) / secondsPerPixel
// console.log(play_ts, y)
return (
<div
className='cursor playCursor'
style={{
top: y,
}}
>
<div className='line' />
</div>
)
}
const mapStateToProps = state => ({
timeline: state.align.timeline,
audio: state.audio,
})
export default connect(mapStateToProps)(PlayCursor)
|