2016-07-23 08:12:31 +08:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
import styles from './styles.scss';
|
|
|
|
|
|
|
|
export default class ClosedCaptions extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
|
2016-07-27 07:05:22 +08:00
|
|
|
renderCaptions(caption) {
|
2016-08-20 12:23:46 +08:00
|
|
|
let text = caption.captions;
|
2016-07-27 07:05:22 +08:00
|
|
|
return (
|
2016-08-20 12:23:46 +08:00
|
|
|
<span
|
|
|
|
style={{ whiteSpace: 'pre-wrap' }}
|
|
|
|
dangerouslySetInnerHTML={{ __html: text }}
|
|
|
|
key={caption.index}
|
|
|
|
/>
|
2016-07-27 07:05:22 +08:00
|
|
|
);
|
|
|
|
}
|
2016-07-23 08:12:31 +08:00
|
|
|
|
2016-07-27 07:05:22 +08:00
|
|
|
render() {
|
2016-07-23 08:12:31 +08:00
|
|
|
return (
|
2016-07-27 07:05:22 +08:00
|
|
|
<div disabled className={styles.ccbox}>
|
2016-08-20 12:23:46 +08:00
|
|
|
{this.props.captions.English ? this.props.captions.English.captions.map((caption) => (
|
2016-07-27 07:05:22 +08:00
|
|
|
this.renderCaptions(caption)
|
2016-08-20 12:23:46 +08:00
|
|
|
)) : null }
|
2016-07-27 07:05:22 +08:00
|
|
|
</div>
|
2016-07-23 08:12:31 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|