Switch react lecture component to youtube

This commit is contained in:
Logan Tegman
2016-05-04 10:30:47 -07:00
parent b7f2e194fb
commit d540e9e4ca
3 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Button, Col, Row } from 'react-bootstrap'; import { Button, Col, Row } from 'react-bootstrap';
import Vimeo from 'react-vimeo'; import Youtube from 'react-youtube';
import { createSelector } from 'reselect'; import { createSelector } from 'reselect';
import debug from 'debug'; import debug from 'debug';
@ -34,7 +34,7 @@ export class Lecture extends React.Component {
// actions // actions
toggleQuestionView: PropTypes.func, toggleQuestionView: PropTypes.func,
// ui // ui
id: PropTypes.number, id: PropTypes.string,
description: PropTypes.array, description: PropTypes.array,
dashedName: PropTypes.string, dashedName: PropTypes.string,
hardGoTo: PropTypes.func hardGoTo: PropTypes.func
@ -74,10 +74,11 @@ export class Lecture extends React.Component {
return ( return (
<Col xs={ 12 }> <Col xs={ 12 }>
<Row> <Row>
<Vimeo <Youtube
id='player_1'
onEnd={ toggleQuestionView }
onError={ this.handleError } onError={ this.handleError }
onFinish= { toggleQuestionView } videoId={ id } />
videoId={ '' + id } />
</Row> </Row>
<Row> <Row>
<article> <article>

View File

@ -112,7 +112,7 @@
"react-router-bootstrap": "~0.20.1", "react-router-bootstrap": "~0.20.1",
"react-router-redux": "^2.1.0", "react-router-redux": "^2.1.0",
"react-toastr": "^2.4.0", "react-toastr": "^2.4.0",
"react-vimeo": "~0.1.0", "react-youtube": "^6.1.0",
"redux": "^3.0.5", "redux": "^3.0.5",
"redux-actions": "^0.9.1", "redux-actions": "^0.9.1",
"redux-form": "^4.1.4", "redux-form": "^4.1.4",

View File

@ -25,7 +25,9 @@ export default function csp() {
'https://*.jsdelivr.com', 'https://*.jsdelivr.com',
'*.jsdelivr.com', '*.jsdelivr.com',
'*.twimg.com', '*.twimg.com',
'https://*.twimg.com' 'https://*.twimg.com',
'*.youtube.com',
'*.ytimg.com'
].concat(trusted), ].concat(trusted),
styleSrc: [ styleSrc: [
"'unsafe-inline'", "'unsafe-inline'",