Skip to content

Commit

Permalink
Facebook youtube embed fix. Indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jun 25, 2016
1 parent bef77e6 commit f30a8a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions views/facebook_feed.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ end
<%=
if /https?:\/\/www\.facebook\.com\/.*\/videos\/(?<video_id>\d+)/ =~ post["link"]
<<-EOF.esc
<iframe src="https://www.facebook.com/video/embed?video_id=#{video_id}" width="1280" height="720" frameborder="0" scrolling="no" allowfullscreen></iframe>
<p><a href="#{request.root_url}/facebook/download?url=#{video_id}">Download video</a></p>
<iframe src="https://www.facebook.com/video/embed?video_id=#{video_id}" width="1280" height="720" frameborder="0" scrolling="no" allowfullscreen></iframe>
<p><a href="#{request.root_url}/facebook/download?url=#{video_id}">Download video</a></p>
EOF
elsif /(?:youtu\.be\/(?<video_id>[^?&#]+)|youtube\.com\/)(?:.*?[?&#](v=(?<video_id>[^&#]+)|list=(?<list>[^&#]+)|t=(?<t>[^&#]+)))*/ =~ post["link"]
elsif /(?:youtu\.be\/(?<video_id>[^?&#]+)|youtube\.com\/)(?:.*?[?&#](v=(?<video_id>[^&#]+)|list=(?<list>[^&#]+)|t=(?<t>[^&#]+)))+/ =~ post["link"]
# https://www.youtube.com/watch?v=z5OGD5_9cA0&list=PL0QrZvg7QIgpoLdNFnEePRrU-YJfr9Be7&index=3&t=30s
embed_url = "https://www.youtube.com/embed/#{video_id}?rel=0"
embed_url += "&list=#{list}" if list
Expand Down

0 comments on commit f30a8a2

Please sign in to comment.