Skip to content

Commit

Permalink
update video extenstions to accept media fragments for time (#1213)
Browse files Browse the repository at this point in the history
* update video extenstions to accept time offset in url

* allow ranges
  • Loading branch information
dednal committed Oct 26, 2021
1 parent cef2e75 commit 8400767
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const MATCH_URL_MIXCLOUD = /mixcloud\.com\/([^/]+\/[^/]+)/
export const MATCH_URL_VIDYARD = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-]+)/
export const MATCH_URL_KALTURA = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_]+)$/
export const AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i
export const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i
export const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i
export const HLS_EXTENSIONS = /\.(m3u8)($|\?)/i
export const DASH_EXTENSIONS = /\.(mpd)($|\?)/i
export const FLV_EXTENSIONS = /\.(flv)($|\?)/i
Expand Down
1 change: 1 addition & 0 deletions test/ReactPlayer/staticMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test('canPlay()', t => {
t.true(ReactPlayer.canPlay('https://www.dailymotion.com/video/x5e9eog'))
t.true(ReactPlayer.canPlay('https://www.mixcloud.com/mixcloud/meet-the-curators'))
t.true(ReactPlayer.canPlay('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'))
t.true(ReactPlayer.canPlay('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4#t=1'))
t.false(ReactPlayer.canPlay('http://example.com/random/path'))
})

Expand Down

0 comments on commit 8400767

Please sign in to comment.