File tree 1 file changed +5
-7
lines changed
app/assets/javascripts/backbone/plugins
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,10 @@ class Kandan.Plugins.YouTubeEmbed
6
6
7
7
template : _ .template '''
8
8
<div class="youtube-preview">
9
- <a target="_blank" class="youtube-preview-link" href="<%= videoUrl %>">
10
- <img class="youtube-preview-image" src="<%= thumbUrl %>" />
11
- </a>
9
+ <iframe width="560" height="315"
10
+ src="http://www.youtube.com/embed/<%= videoId %>"
11
+ frameborder="0" allowfullscreen>
12
+ </iframe>
12
13
<div class="name"><%= subtitle %></div>
13
14
</div>
14
15
'''
@@ -24,18 +25,15 @@ class Kandan.Plugins.YouTubeEmbed
24
25
else
25
26
# Spaces indicate a subtitle
26
27
comment = $ .trim (message .content .substr (message .content .indexOf (" " ) + 1 ));
27
- videoUrl = message .content .split (" " )[0 ]
28
28
29
29
videoId = message .content .match (@options .idRegex )[1 ]
30
- thumbUrl = " http://img.youtube.com/vi/#{ videoId } /0.jpg"
31
30
32
31
subtitle = null
33
32
subtitle = " Youtube: #{ comment} " if comment? and comment .length > 0
34
33
subtitle ||= videoUrl
35
34
36
35
message .content = @options .template ({
37
- videoUrl : videoUrl,
38
- thumbUrl : thumbUrl,
36
+ videoId : videoId,
39
37
subtitle : subtitle
40
38
})
41
39
return Kandan .Helpers .Activities .buildFromMessageTemplate (message)
You can’t perform that action at this time.
0 commit comments