【发布时间】:2019-09-22 10:26:56
【问题描述】:
我正在开发一个使用 ReactJs 的网站,我使用的是 html5
<video 属性要能够观看视频,我必须确保我可以更改视频的时间戳。
我该怎么做,有什么建议吗?
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SubTitle</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min2.css" />
<style>
a {
cursor: pointer;
}
.help-block {
font-size: 12px;
}
* {
margin: 0;
padding: 0;
}
body {
background-color: #222222;
color: #fff;
}
textarea {
resize: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
outline: none !important;
}
textarea::-webkit-input-placeholder {
color: black !important;
}
textarea:-moz-placeholder { /* Firefox 18- */
color: black !important;
}
textarea::-moz-placeholder { /* Firefox 19+ */
color: black !important;
}
textarea:-ms-input-placeholder {
color: black !important;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
</html>
SubPage.js
import React from 'react';
import styles from '../Css/Styles.module.css';
class SubPage extends React.Component {
constructor(props) {
super(props);
this.state = {
value: '',
};
}
render() {
return (
<div className={styles.video}>
<video controls autoPlay="true">
<source src="https://www89.uptostream.com/9kanocdc72/360/0/video.mp4" type="video/mp4" />
<track label="English" kind="subtitles" srcLang="en" src="life.vtt" default />
</video>
</div>
)
}
}
【问题讨论】:
标签: javascript html reactjs video html5-video