Permalink
Browse files

Add support for Vimeo videos

  • Loading branch information...
1 parent 4801cac commit e566eb3e21206c7ba47551708f59f242c0bd5a25 @danielcnorman danielcnorman committed Oct 12, 2012
@@ -11,6 +11,17 @@ def tweet_button
raw "<a href='https://twitter.com/share?url=/' id='tweet_button' class='twitter-share-button twitter-button' data-url=#{request.scheme}//#{request.host}' data-via='#{Settings.product_name}' data-lang='en' data-count='vertical' data-text=\"#{tweet_text}\">Tweet</a>"
end
+ def video_url
+ "#{Settings.video_embed_url}?" + case Settings.video_embed_url
+ when /vimeo/
+ 'title=0&byline=0&portrait=0&autoplay=0'
+ when /youtube/
+ 'autohide=1&showinfo=0&rel=0&autoplay=0'
+ else
+ ''
+ end
+ end
+
def encoded_root_url
raw URI.encode "#{request.scheme}://#{request.host}/preorder"
end
@@ -26,7 +26,7 @@
<li>
<details class=''>
<summary>How do I change around the images, product name, etc?</summary>
- <p>The best way is in <code>config/settings.yml</code>. It has variables for several different parts, the YouTube video, the product name, the call to action button ("Fork Now"), and several more.
+ <p>The best way is in <code>config/settings.yml</code>. It has variables for several different parts, the video, the product name, the call to action button ("Fork Now"), and several more.
</p>
</details>
</li>
@@ -1,6 +1,6 @@
<div class="wrapper clearfix">
<div id="video">
- <iframe width='512' height='385' src="<%= Settings.youtube_embed_url %>?autohide=1&showinfo=0&rel=0&autoplay=0"></iframe>
+ <iframe width='512' height='385' src="<%= video_url %>"></iframe>
</div>
<div id="backing">
View
@@ -19,9 +19,8 @@ product_image_path: "my-product-image.png"
# The message on the preorder page, Lockitron's
value_proposition: "Roll your own crowdfunding"
-# YouTube Video URL (The embed URL, without the query string options)
-# There's no Vimeo support at the moment, but feel free to implement it and send a pull request!
-youtube_embed_url: "https://www.youtube.com/v/D1L3o88GKew"
+# YouTube or Vimeo Video URL (The embed URL, without the query string options)
+video_embed_url: "https://www.youtube.com/v/D1L3o88GKew"
# Amazon settings -- you'll need an Amazon Payments account, sign up here --> http://bit.ly/SGksTv

0 comments on commit e566eb3

Please sign in to comment.