remove sizes from user content video tags in api responses

This makes it easier for api consumers to apply their own css styling.

test plan: embed a kaltura video in a user content, like a discussion
topic. Then get that data from the api, and verify the <video> tag
returned has no width or height.

Change-Id: I8f2029449e34734b3c2d4eb91aa00118326c680e
Reviewed-on: https://gerrit.instructure.com/10644
Reviewed-by: BJ Homer <bj@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
Brian Palmer 2012-05-09 12:46:43 -06:00
parent 0c004fcf64
commit b3bd68d894
3 changed files with 5 additions and 3 deletions

View File

@ -236,8 +236,6 @@ module Api
thumbnail = media_object_thumbnail_url(media_id, :width => 550, :height => 448, :type => 3, :host => host)
node['poster'] = thumbnail
node['data-media_comment_type'] = 'video'
node['width'] = '550'
node['height'] = '448'
end
node['preload'] = 'none'

View File

@ -62,6 +62,10 @@ describe UserContent, :type => :integration do
video['poster'].should match(%r{http://www.example.com/media_objects/qwerty/thumbnail})
video['src'].should match(%r{http://www.example.com/courses/#{@course.id}/media_download})
video['src'].should match(%r{entryId=qwerty})
# we leave width/height out of it, since browsers tend to have good
# defaults and it makes it easier to set via client css rules
video['width'].should be_nil
video['height'].should be_nil
end
it "should translate media comment audio tags" do

View File

@ -968,7 +968,7 @@ describe DiscussionTopicsController, :type => :integration do
{ 'id' => @reply2.id,
'parent_id' => @root1.id,
'user_id' => @teacher.id,
'message' => "<p><a href=\"http://localhost/files/#{@reply2_attachment.id}/download?verifier=#{@reply2_attachment.uuid}\">This is a file link</a></p>\n <p>This is a video:\n <video poster=\"http://localhost/media_objects/0_abcde/thumbnail?height=448&amp;type=3&amp;width=550\" data-media_comment_type=\"video\" width=\"550\" height=\"448\" preload=\"none\" class=\"instructure_inline_media_comment\" data-media_comment_id=\"0_abcde\" controls=\"controls\" src=\"http://localhost/courses/#{@course.id}/media_download?entryId=0_abcde&amp;redirect=1&amp;type=mp4\"></video>\n </p>",
'message' => "<p><a href=\"http://localhost/files/#{@reply2_attachment.id}/download?verifier=#{@reply2_attachment.uuid}\">This is a file link</a></p>\n <p>This is a video:\n <video poster=\"http://localhost/media_objects/0_abcde/thumbnail?height=448&amp;type=3&amp;width=550\" data-media_comment_type=\"video\" preload=\"none\" class=\"instructure_inline_media_comment\" data-media_comment_id=\"0_abcde\" controls=\"controls\" src=\"http://localhost/courses/#{@course.id}/media_download?entryId=0_abcde&amp;redirect=1&amp;type=mp4\"></video>\n </p>",
'created_at' => @reply2.created_at.as_json,
'updated_at' => @reply2.updated_at.as_json,
'replies' => [ {