add allowfullscreen to youtube embed

This commit is contained in:
mahkoh 2013-10-24 18:19:50 +02:00
parent 0224a5c0cc
commit 1e2a7c17c7

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