-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #22 For some reason the players do not work in Firefox on Travis, and I don't know why See https://travis-ci.org/CookPete/react-player/jobs/100382039 for a travis log with SoundCloud debug logs It seems to load the track correctly and run play(), but the stateChange event never happens (and so onPlay is never fired)
- Loading branch information
Showing
7 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ node_js: | |
- "iojs" | ||
script: | ||
- npm run lint | ||
- npm run test | ||
- npm run test:mocha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var webpackConfig = require('../webpack.config.dev') | ||
webpackConfig.devtool = 'inline-source-map' | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
browsers: process.env.CONTINUOUS_INTEGRATION ? [ 'Firefox' ] : [ 'Chrome', 'Firefox' ], | ||
singleRun: true, | ||
frameworks: [ 'mocha', 'chai' ], | ||
files: [ | ||
'karma.webpack.js' | ||
], | ||
preprocessors: { | ||
'karma.webpack.js': [ 'webpack', 'sourcemap' ] | ||
}, | ||
reporters: [ 'mocha' ], | ||
webpack: webpackConfig, | ||
webpackServer: { | ||
noInfo: true | ||
}, | ||
client: { | ||
mocha: { | ||
timeout: 10000 | ||
} | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var context = require.context('./karma', true, /\.js$/) | ||
context.keys().forEach(context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react' | ||
import { render, unmountComponentAtNode } from 'react-dom' | ||
|
||
import ReactPlayer from '../../src/ReactPlayer' | ||
|
||
const { describe, it, beforeEach, afterEach } = window | ||
const TEST_YOUTUBE_URL = 'https://www.youtube.com/watch?v=GlCmAC4MHek' | ||
const TEST_SOUNDCLOUD_URL = 'https://soundcloud.com/miami-nights-1984/accelerated' | ||
const TEST_VIMEO_URL = 'https://vimeo.com/90509568' | ||
const TEST_MP4_URL = 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4' | ||
|
||
describe('ReactPlayer', () => { | ||
let div | ||
|
||
beforeEach(() => { | ||
div = document.createElement('div') | ||
document.body.appendChild(div) | ||
}) | ||
|
||
it('plays a YouTube video', function (done) { | ||
const player = <ReactPlayer url={TEST_YOUTUBE_URL} playing onPlay={() => done()} /> | ||
render(player, div) | ||
}) | ||
|
||
it('plays a SoundCloud track', function (done) { | ||
const player = <ReactPlayer url={TEST_SOUNDCLOUD_URL} playing onPlay={() => done()} /> | ||
render(player, div) | ||
}) | ||
|
||
it('plays a Vimeo video', function (done) { | ||
const player = <ReactPlayer url={TEST_VIMEO_URL} playing onPlay={() => done()} /> | ||
render(player, div) | ||
}) | ||
|
||
it('plays an mp4', function (done) { | ||
const player = <ReactPlayer url={TEST_MP4_URL} playing onPlay={() => done()} /> | ||
render(player, div) | ||
}) | ||
|
||
afterEach(() => { | ||
unmountComponentAtNode(div) | ||
document.body.removeChild(div) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters