2017-03-28 04:40:44 +08:00
|
|
|
import React, { Component } from 'react';
|
2017-10-23 20:41:09 +08:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
init: PropTypes.func.isRequired,
|
|
|
|
};
|
2017-03-28 04:40:44 +08:00
|
|
|
|
|
|
|
export default class Audio extends Component {
|
2017-10-23 20:41:09 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.init = props.init.bind(this);
|
|
|
|
}
|
|
|
|
|
2017-10-10 04:48:10 +08:00
|
|
|
componentDidMount() {
|
2017-10-23 20:41:09 +08:00
|
|
|
this.init();
|
2017-04-19 22:59:57 +08:00
|
|
|
}
|
|
|
|
|
2017-03-28 04:40:44 +08:00
|
|
|
render() {
|
2017-10-23 20:41:09 +08:00
|
|
|
return (
|
|
|
|
<audio id="remote-media" autoPlay="autoplay">
|
|
|
|
<track kind="captions" /> {/* These captions are brought to you by eslint */}
|
|
|
|
</audio>
|
|
|
|
);
|
2017-03-28 04:40:44 +08:00
|
|
|
}
|
|
|
|
}
|
2017-10-23 20:41:09 +08:00
|
|
|
|
|
|
|
Audio.propTypes = propTypes;
|