Browse Source

Add tagOnPause.

HEAD
Yang Luo 3 years ago
parent
commit
a249e940ff
5 changed files with 28 additions and 4 deletions
  1. +4
    -3
      object/video.go
  2. +1
    -0
      web/src/Video.js
  3. +21
    -1
      web/src/VideoEditPage.js
  4. +1
    -0
      web/src/locales/en/data.json
  5. +1
    -0
      web/src/locales/zh/data.json

+ 4
- 3
object/video.go View File

@@ -20,9 +20,10 @@ type Video struct {
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
DisplayName string `xorm:"varchar(500)" json:"displayName"`

VideoId string `xorm:"varchar(100)" json:"videoId"`
CoverUrl string `xorm:"varchar(200)" json:"coverUrl"`
Labels []*Label `xorm:"mediumtext" json:"labels"`
VideoId string `xorm:"varchar(100)" json:"videoId"`
CoverUrl string `xorm:"varchar(200)" json:"coverUrl"`
Labels []*Label `xorm:"mediumtext" json:"labels"`
TagOnPause bool `json:"tagOnPause"`

PlayAuth string `xorm:"-" json:"playAuth"`
}


+ 1
- 0
web/src/Video.js View File

@@ -134,6 +134,7 @@ class Video extends React.Component {
onPause() {
this.state.screen.pause();
this.props.onPause();
}
initPlayer(player) {


+ 21
- 1
web/src/VideoEditPage.js View File

@@ -1,5 +1,5 @@
import React from "react";
import {Affix, Button, Card, Col, Input, Row} from 'antd';
import {Affix, Button, Card, Col, Input, Row, Switch} from 'antd';
import * as VideoBackend from "./backend/VideoBackend";
import * as Setting from "./Setting";
import i18next from "i18next";
@@ -18,6 +18,8 @@ class VideoEditPage extends React.Component {
screen: null,
videoObj: null,
};
this.labelTable = React.createRef();
}
componentWillMount() {
@@ -51,6 +53,12 @@ class VideoEditPage extends React.Component {
});
}
onPause() {
if (this.state.video.tagOnPause) {
this.labelTable.current.addRow(this.state.video.labels);
}
}
renderVideoContent() {
let task = {};
task.video = {
@@ -78,6 +86,7 @@ class VideoEditPage extends React.Component {
onCreatePlayer={(player) => {this.setState({player: player})}}
onCreateScreen={(screen) => {this.setState({screen: screen})}}
onCreateVideo={(videoObj) => {this.setState({videoObj: videoObj})}}
onPause={() => {this.onPause()}}
/>
<div style={{fontSize: 20, marginTop: "10px"}}>
{i18next.t("video:Current time (second)")}: {" "}
@@ -155,6 +164,16 @@ class VideoEditPage extends React.Component {
</Row>
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{i18next.t("video:Tag on pause")}:
</Col>
<Col span={22} >
<Switch checked={this.state.video.tagOnPause} onChange={checked => {
this.updateVideoField('tagOnPause', checked);
}} />
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 22 : 2}>
{i18next.t("video:Video")}:
@@ -168,6 +187,7 @@ class VideoEditPage extends React.Component {
</Col>
<Col span={10} >
<LabelTable
ref={this.labelTable}
title={i18next.t("video:Labels")}
table={this.state.video.labels}
currentTime={this.state.currentTime}


+ 1
- 0
web/src/locales/en/data.json View File

@@ -41,6 +41,7 @@
"Label count": "Label count",
"Labels": "Labels",
"Start time (s)": "Start time (s)",
"Tag on pause": "Tag on pause",
"Text": "Text",
"Video": "Video",
"Video ID": "Video ID"


+ 1
- 0
web/src/locales/zh/data.json View File

@@ -41,6 +41,7 @@
"Label count": "标签数量",
"Labels": "标签",
"Start time (s)": "开始时间(秒)",
"Tag on pause": "暂停时自动标记",
"Text": "文本",
"Video": "视频",
"Video ID": "视频ID"


Loading…
Cancel
Save