Skip to content

Commit

Permalink
Merge pull request #45 from gridsane/master
Browse files Browse the repository at this point in the history
Add FilePlayer support for urls with query string
  • Loading branch information
cookpete committed Apr 8, 2016
2 parents 93e84a4 + fe0b452 commit f0d2ffb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/players/FilePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'

import Base from './Base'

const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm)$/
const AUDIO_EXTENSIONS = /\.(mp3|wav)$/
const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm)($|\?)/
const AUDIO_EXTENSIONS = /\.(mp3|wav)($|\?)/

export default class FilePlayer extends Base {
static displayName = 'FilePlayer';
Expand Down
6 changes: 6 additions & 0 deletions test/mocha/canPlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ describe('FilePlayer', () => {
expect(FilePlayer.canPlay('http://example.com/file.webm')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.mp3')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.wav')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.mp4?foo=1&bar=2')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.ogg?foo=1&bar=2')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.ogv?foo=1&bar=2')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.webm?foo=1&bar=2')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.mp3?foo=1&bar=2')).to.be.true
expect(FilePlayer.canPlay('http://example.com/file.wav?foo=1&bar=2')).to.be.true
})

it('knows what it can\'t play', () => {
Expand Down

0 comments on commit f0d2ffb

Please sign in to comment.