Skip to content

Commit

Permalink
Use file player for soundcloud hosted audio files
Browse files Browse the repository at this point in the history
  • Loading branch information
webmiraclepro committed Apr 24, 2020
1 parent 1c45781 commit 1192d0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/patterns.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/
export const MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/
export const MATCH_URL_VIMEO = /vimeo\.com\/.+/
export const MATCH_URL_VIMEO_FILE = /vimeo\.com\/external\/[0-9]+\..+/
export const MATCH_URL_FACEBOOK = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/
export const MATCH_URL_STREAMABLE = /streamable\.com\/([a-z0-9]+)$/
export const MATCH_URL_WISTIA = /(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/
Expand Down
10 changes: 2 additions & 8 deletions src/players/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
MATCH_URL_YOUTUBE,
MATCH_URL_SOUNDCLOUD,
MATCH_URL_VIMEO,
MATCH_URL_VIMEO_FILE,
MATCH_URL_FACEBOOK,
MATCH_URL_STREAMABLE,
MATCH_URL_WISTIA,
Expand Down Expand Up @@ -51,17 +50,12 @@ export default [
},
{
key: 'soundcloud',
canPlay: url => MATCH_URL_SOUNDCLOUD.test(url),
canPlay: url => MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url),
lazyPlayer: lazy(() => import('./SoundCloud'))
},
{
key: 'vimeo',
canPlay: url => {
if (MATCH_URL_VIMEO_FILE.test(url)) {
return false
}
return MATCH_URL_VIMEO.test(url)
},
canPlay: url => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
lazyPlayer: lazy(() => import('./Vimeo'))
},
{
Expand Down

0 comments on commit 1192d0f

Please sign in to comment.