vimeo works, does not yet fetch the title
This commit is contained in:
parent
07a074edb6
commit
7796776135
3 changed files with 9 additions and 4 deletions
|
|
@ -168,10 +168,10 @@ module ApplicationHelper
|
|||
|
||||
message = process_links(message)
|
||||
message = process_youtube(message)
|
||||
message = process_vimeo(message, options[:vimeo_maps])
|
||||
message = process_autolinks(message)
|
||||
message = process_emphasis(message)
|
||||
message = process_youtube_again(message, options[:youtube_maps])
|
||||
message = process_vimeo(message, options[:vimeo_maps])
|
||||
|
||||
if options[:newlines]
|
||||
message.gsub!(/\n+/, '<br />')
|
||||
|
|
@ -267,7 +267,7 @@ module ApplicationHelper
|
|||
else
|
||||
title = I18n.t 'application.helper.video_title.unknown'
|
||||
end
|
||||
message.gsub!(vimeo[0], '<a class="video-link" data-host="vimeo.com" data-video-id="' + video_id + '" href="#video">Youtube: ' + title + '</a>')
|
||||
message.gsub!(vimeo[0], '<a class="video-link" data-host="vimeo.com" data-video-id="' + video_id + '" href="#video">Vimeo: ' + title + '</a>')
|
||||
end
|
||||
return message
|
||||
end
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ var Stream = {
|
|||
'<a href="//www.youtube.com/watch?v=' + $this.data("video-id") + '" target="_blank">Watch this video on Youtube</a><br />' +
|
||||
'<iframe class="youtube-player" type="text/html" src="http://www.youtube.com/embed/' + $this.data("video-id") + '"></iframe>'
|
||||
);
|
||||
} else if($this.data("host") === "vimeo.com"){
|
||||
$container.html(
|
||||
'<p><a href="http://vimeo.com/' + $this.data("video-id") + '">Watch this video on Vimeo</a></p>' +
|
||||
'<iframe class="vimeo-player" src="http://player.vimeo.com/video/' + $this.data("video-id") + '"></iframe>'
|
||||
);
|
||||
} else {
|
||||
$container.html('Invalid videotype <i>' + $this.data("host") + '</i> (ID: ' + $this.data("video-id") + ')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ header
|
|||
.right
|
||||
:display inline
|
||||
|
||||
.youtube-player
|
||||
.youtube-player, .vimeo-player
|
||||
:border none
|
||||
:height 370px
|
||||
:width 500px
|
||||
|
|
@ -550,7 +550,7 @@ ul.show_comments
|
|||
:margin
|
||||
:bottom 0px
|
||||
|
||||
.youtube-player
|
||||
.youtube-player, .vimeo-player
|
||||
:border none
|
||||
:height 250px
|
||||
:width 400px
|
||||
|
|
|
|||
Loading…
Reference in a new issue