Permalink
Browse files

support vimeo embed too

  • Loading branch information...
1 parent 0fa84f6 commit d131fea0384e97fef4ad78061f0b265df56f35eb Visnu Pitiyanuvath committed Nov 13, 2012
Showing with 5 additions and 3 deletions.
  1. +3 −1 helpers/index.coffee
  2. +1 −1 views/people/show.jade
  3. +1 −1 views/teams/entry.jade
View
@@ -64,11 +64,13 @@ module.exports = (app) ->
favicon: (sponsor) -> favicons[sponsor]
- youtubeEmbed: (url) ->
+ embedVideo: (url) ->
if match = url.match(/youtube.com\/.*v=([^&]+).*/)
"//www.youtube.com/embed/#{match[1]}"
else if match = url.match(/youtu.be\/(.*)/)
"//www.youtube.com/embed/#{match[1]}"
+ else if match = url.match(/vimeo.com\/(\d+)/)
+ "//player.vimeo.com/video/#{match[1]}"
app.dynamicHelpers
View
@@ -50,7 +50,7 @@ h1.name= title(person.name)
.clear
!= markdown(nextVote.team.entry.description)
- if (nextVote.team.entry.videoURL)
- - if (embed = youtubeEmbed(nextVote.team.entry.videoURL))
+ - if (embed = embedVideo(nextVote.team.entry.videoURL))
p: iframe( width="560", height="315", src=embed, frameborder="0", allowfullscreen=true )
- else
h4 Screencast
View
@@ -21,7 +21,7 @@
.clear
!= markdown(team.entry.description)
- if (team.entry.videoURL)
- - if (embed = youtubeEmbed(team.entry.videoURL))
+ - if (embed = embedVideo(team.entry.videoURL))
p: iframe( width="540", height="304", src=embed, frameborder="0", allowfullscreen=true )
- else
h4 Screencast

0 comments on commit d131fea

Please sign in to comment.