Skip to content

Commit

Permalink
Merge pull request #559 from akvo/feature/540_related_videos
Browse files Browse the repository at this point in the history
[#540] Added '&rel=0' to Youtube links on update page
  • Loading branch information
zzgvh committed May 19, 2014
2 parents 83d7547 + 330ad53 commit c739356
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions akvo/rsr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,9 @@ def get_video_oembed(self, html=''):
try:
data = oembed.site.embed(self.video).get_data()
html = data.get('html', '')
# Add 'rel=0' to the video link for not showing related Youtube videos
if "youtube" in html:
html = html.replace("feature=oembed", "feature=oembed&rel=0")
except:
pass
return mark_safe(html)
Expand Down

0 comments on commit c739356

Please sign in to comment.