Merge pull request #478 from mahkoh/youtube

add allowfullscreen to youtube embed
This commit is contained in:
Zixaphir 2013-11-22 18:29:28 -08:00
commit c5e140c27a

View File

@ -397,8 +397,10 @@ Linkify =
YouTube:
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
el: (a) ->
$.el 'iframe',
ret = $.el 'iframe',
src: "//www.youtube.com/embed/#{a.dataset.uid}#{if a.dataset.option then '#' + a.dataset.option else ''}?wmode=opaque"
ret.setAttribute "allowfullscreen", "true"
ret
title:
api: (uid) -> "https://gdata.youtube.com/feeds/api/videos/#{uid}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode"
text: (data) -> data.entry.title.$t