Skip to content

Commit

Permalink
Switch react lecture component to youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
ltegman committed May 4, 2016
1 parent b7f2e19 commit d540e9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions common/app/routes/Hikes/components/Lecture.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { Button, Col, Row } from 'react-bootstrap';
import Vimeo from 'react-vimeo';
import Youtube from 'react-youtube';
import { createSelector } from 'reselect';
import debug from 'debug';

Expand Down Expand Up @@ -34,7 +34,7 @@ export class Lecture extends React.Component {
// actions
toggleQuestionView: PropTypes.func,
// ui
id: PropTypes.number,
id: PropTypes.string,
description: PropTypes.array,
dashedName: PropTypes.string,
hardGoTo: PropTypes.func
Expand Down Expand Up @@ -74,10 +74,11 @@ export class Lecture extends React.Component {
return (
<Col xs={ 12 }>
<Row>
<Vimeo
<Youtube
id='player_1'
onEnd={ toggleQuestionView }
onError={ this.handleError }
onFinish= { toggleQuestionView }
videoId={ '' + id } />
videoId={ id } />
</Row>
<Row>
<article>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"react-router-bootstrap": "~0.20.1",
"react-router-redux": "^2.1.0",
"react-toastr": "^2.4.0",
"react-vimeo": "~0.1.0",
"react-youtube": "^6.1.0",
"redux": "^3.0.5",
"redux-actions": "^0.9.1",
"redux-form": "^4.1.4",
Expand Down
4 changes: 3 additions & 1 deletion server/middlewares/csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default function csp() {
'https://*.jsdelivr.com',
'*.jsdelivr.com',
'*.twimg.com',
'https://*.twimg.com'
'https://*.twimg.com',
'*.youtube.com',
'*.ytimg.com'
].concat(trusted),
styleSrc: [
"'unsafe-inline'",
Expand Down

0 comments on commit d540e9e

Please sign in to comment.