Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vimeo On Demand URL Support #289

Merged
merged 1 commit into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/players/Vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { callPlayer, getSDK } from '../utils'

const SDK_URL = 'https://player.vimeo.com/api/player.js'
const SDK_GLOBAL = 'Vimeo'
const MATCH_URL = /https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/
const MATCH_URL = /https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:(?:channels|ondemand)\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/

export default class Vimeo extends Component {
static displayName = 'Vimeo'
Expand Down
6 changes: 6 additions & 0 deletions test/specs/canPlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ describe('canPlay', () => {
it('knows what it can play', () => {
expect(Vimeo.canPlay('http://vimeo.com/1234')).to.be.true
expect(Vimeo.canPlay('https://vimeo.com/1234')).to.be.true
expect(Vimeo.canPlay('https://www.vimeo.com/1234')).to.be.true
expect(Vimeo.canPlay('https://vimeo.com/ondemand/tinact/84954874')).to.be.true
expect(Vimeo.canPlay('https://vimeo.com/channels/staffpicks/40004005')).to.be.true
expect(Vimeo.canPlay('https://vimeo.com/groups/motion/videos/73234721')).to.be.true
expect(Vimeo.canPlay('https://vimeo.com/album/3953264/video/166790294')).to.be.true
expect(Vimeo.canPlay('https://player.vimeo.com/video/40004005')).to.be.true
})

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