use resource_domain for kaltura thumbnails; refs #3761
Change-Id: I7bf236a0dccf1c8446708d9a0b5a9885d08d394e Reviewed-on: https://gerrit.instructure.com/2550 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Brian Whitmer <brian@instructure.com>
This commit is contained in:
parent
3059f0e530
commit
ce0e068190
|
@ -395,12 +395,10 @@ class Attachment < ActiveRecord::Base
|
|||
elsif self.thumbnail #handle attachment_fu iamges that we have made a thubnail for on our s3
|
||||
self.thumbnail.cached_s3_url
|
||||
elsif self.media_object && self.media_object.media_id
|
||||
opts = {
|
||||
:height => options[:height] || 100,
|
||||
:width => options[:width] || 140,
|
||||
:video_seconds => options[:video_seconds] || 5
|
||||
}
|
||||
"http://cdn.kaltura.com/p/156652/thumbnail/entry_id/#{self.media_object.media_id}/width/#{opts[:width]}/height/#{opts[:height]}/bgcolor/ffffff/type/2/vid_sec/#{opts[:video_seconds]}";
|
||||
Kaltura::ClientV3.new.thumbnail_url(self.media_object.media_id,
|
||||
options[:width] | 140,
|
||||
options[:height] || 100,
|
||||
options[:video_seconds] || 5)
|
||||
else
|
||||
# "still need to handle things that are not images with thumbnails, scribd_docs, or kaltura docs"
|
||||
end
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
</span>
|
||||
<div style="border-bottom: 1px dotted #aaa;">
|
||||
<% if comment && comment.media_comment? %>
|
||||
<img src="http://cdn.kaltura.com/p/156652/thumbnail/entry_id/<%= comment.media_comment_id %>/width/50/height/35/bgcolor/F3F4F5/type/2/vid_sec/5" style="float: right; padding-left: 3px;" alt=""/>
|
||||
<% kaltura_thumbnail_url = Kaltura::ClientV3.new.thumbnail_url(comment.media_comment_id, 50, 35, 5, "F3F4F5", 2) %>
|
||||
<img src="<%= kaltura_thumbnail_url %>" style="float: right; padding-left: 3px;" alt=""/>
|
||||
<% end %>
|
||||
<b class="ellipsis"><%= recent_feedback.assignment.title %></b>
|
||||
<% if comment_text or grade %>
|
||||
|
|
|
@ -37,6 +37,7 @@ module Kaltura
|
|||
def initialize
|
||||
config = Kaltura::ClientV3.config
|
||||
@host = config['domain']
|
||||
@resource_domain = config['resource_domain']
|
||||
@endpoint = config['endpoint']
|
||||
@partnerId = config['partner_id']
|
||||
@secret = config['secret_key']
|
||||
|
@ -49,6 +50,10 @@ module Kaltura
|
|||
Canvas::Plugin.find(:kaltura).try(:settings)
|
||||
end
|
||||
|
||||
def thumbnail_url(entryId, width, height, vid_sec = 5, bgcolor = "ffffff", type = "2")
|
||||
"//#{@resource_domain}/p/#{@partnerId}/thumbnail/entry_id/#{entryId}/width/#{width}/height/#{height}/bgcolor/#{bgcolor}/type/#{type}/vid_sec/#{vid_sec}"
|
||||
end
|
||||
|
||||
def startSession(type = SessionType::USER, userId = nil)
|
||||
partnerId = @partnerId
|
||||
secret = type == SessionType::USER ? @user_secret : @secret
|
||||
|
|
|
@ -237,7 +237,7 @@
|
|||
}
|
||||
id = id || $.trim($(this).parent().find(".media_comment_id:first").text());
|
||||
if(id) {
|
||||
var url = "http://" + INST.kalturaSettings.resource_domain + "/p/" + INST.kalturaSettings.partner_id + "/thumbnail/entry_id/";
|
||||
var url = "//" + INST.kalturaSettings.resource_domain + "/p/" + INST.kalturaSettings.partner_id + "/thumbnail/entry_id/";
|
||||
url = url + id;
|
||||
url = url + "/width/" + dimensions.width + "/height/" + dimensions.height + "/bgcolor/000000/type/2/vid_sec/5";
|
||||
var $img = $("<img/>");
|
||||
|
|
Loading…
Reference in New Issue