bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/closed-captions/component.jsx
2016-08-20 18:14:12 -07:00

30 lines
662 B
JavaScript
Executable File

import React, { PropTypes } from 'react';
import styles from './styles.scss';
export default class ClosedCaptions extends React.Component {
constructor(props) {
super(props);
}
renderCaptions(caption) {
let text = caption.captions;
return (
<span
style={{ whiteSpace: 'pre-wrap' }}
dangerouslySetInnerHTML={{ __html: text }}
key={caption.index}
/>
);
}
render() {
return (
<div disabled className={styles.ccbox}>
{this.props.captions.English ? this.props.captions.English.captions.map((caption) => (
this.renderCaptions(caption)
)) : null }
</div>
);
}
}