LabelTable can clear screen.
This commit is contained in:
parent
af7f9971f8
commit
532c6d6bb0
|
@ -72,6 +72,7 @@ class LabelTable extends React.Component {
|
||||||
return (
|
return (
|
||||||
<Button type={"text"} style={{width: "50px"}} onClick={() => {
|
<Button type={"text"} style={{width: "50px"}} onClick={() => {
|
||||||
this.props.player.seek(record.timestamp);
|
this.props.player.seek(record.timestamp);
|
||||||
|
this.props.screen.clear();
|
||||||
}} >
|
}} >
|
||||||
{index + 1}
|
{index + 1}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -27,6 +27,8 @@ class Video extends React.Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
screen: screen,
|
screen: screen,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.props.onCreateScreen(screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateVideoSize(width, height) {
|
updateVideoSize(width, height) {
|
||||||
|
@ -116,6 +118,7 @@ class Video extends React.Component {
|
||||||
player.on('timeupdate', () => {this.onTimeUpdate(player)});
|
player.on('timeupdate', () => {this.onTimeUpdate(player)});
|
||||||
player.on('play', () => {this.onPlay()});
|
player.on('play', () => {this.onPlay()});
|
||||||
player.on('pause', () => {this.onPause()});
|
player.on('pause', () => {this.onPause()});
|
||||||
|
player.on('completeSeek', () => {this.state.screen.clear()});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -15,6 +15,7 @@ class VideoEditPage extends React.Component {
|
||||||
videoName: props.match.params.videoName,
|
videoName: props.match.params.videoName,
|
||||||
video: null,
|
video: null,
|
||||||
player: null,
|
player: null,
|
||||||
|
screen: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +72,11 @@ class VideoEditPage extends React.Component {
|
||||||
<Affix offsetTop={100}>
|
<Affix offsetTop={100}>
|
||||||
<div style={{marginTop: "10px"}}>
|
<div style={{marginTop: "10px"}}>
|
||||||
<div className="screen" style={{position: "absolute", zIndex: 100, pointerEvents: "none", width: '440px', height: '472px', marginLeft: '200px', marginRight: '200px', backgroundColor: "rgba(255,0,0,0)" }}></div>
|
<div className="screen" style={{position: "absolute", zIndex: 100, pointerEvents: "none", width: '440px', height: '472px', marginLeft: '200px', marginRight: '200px', backgroundColor: "rgba(255,0,0,0)" }}></div>
|
||||||
<Video task={task} labels={this.state.video.labels} onUpdateTime={(time) => {this.setState({currentTime: time})}} onCreatePlayer={(player) => {this.setState({player: player})}} />
|
<Video task={task} labels={this.state.video.labels}
|
||||||
|
onUpdateTime={(time) => {this.setState({currentTime: time})}}
|
||||||
|
onCreatePlayer={(player) => {this.setState({player: player})}}
|
||||||
|
onCreateScreen={(screen) => {this.setState({screen: screen})}}
|
||||||
|
/>
|
||||||
<div style={{fontSize: 20, marginTop: "10px"}}>
|
<div style={{fontSize: 20, marginTop: "10px"}}>
|
||||||
{i18next.t("video:Current time (second)")}: {" "}
|
{i18next.t("video:Current time (second)")}: {" "}
|
||||||
{
|
{
|
||||||
|
@ -165,6 +170,7 @@ class VideoEditPage extends React.Component {
|
||||||
table={this.state.video.labels}
|
table={this.state.video.labels}
|
||||||
currentTime={this.state.currentTime}
|
currentTime={this.state.currentTime}
|
||||||
player={this.state.player}
|
player={this.state.player}
|
||||||
|
screen={this.state.screen}
|
||||||
onUpdateTable={(value) => {this.updateVideoField('labels', value)}}
|
onUpdateTable={(value) => {this.updateVideoField('labels', value)}}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
Loading…
Reference in New Issue