diff --git a/app/assets/stylesheets/application/learning_objects.scss b/app/assets/stylesheets/application/learning_objects.scss index 0d1853fada60b2752c6c44c9519982900878e027..17a1cd8bc5cdfed824a8e0afc16386033441c4bc 100644 --- a/app/assets/stylesheets/application/learning_objects.scss +++ b/app/assets/stylesheets/application/learning_objects.scss @@ -87,9 +87,24 @@ $background-grey: #e7e7e8; } .learning-object { - .thumbnail { + .view { width: 530px; height: 298px; + audio { + width: inherit; + position: relative; + top: 50%; + transform: translateY(-50%); + } + img { + width: inherit; + height: inherit; + border: 0; + } + video { + width: inherit; + height: inherit; + } } .stats { text-align: right; diff --git a/app/views/learning_objects/show.html.erb b/app/views/learning_objects/show.html.erb index a21298c24756b9fa37a395e002cabd8699ac915d..03df9208895d121bbf9ca7af153d29fd42edb1da 100644 --- a/app/views/learning_objects/show.html.erb +++ b/app/views/learning_objects/show.html.erb @@ -25,7 +25,15 @@ <div class="row learning-object"> <div class="col-md-7"> - <%= learning_object_thumbnail @learning_object, "large" %> + <div class="view"> + <%= + case @learning_object.type + when 'Ãudio' then audio_tag(@learning_object.get_retrievelink, controls: true) + when 'VÃdeo' then video_tag(@learning_object.get_retrievelink, controls: true, autobuffer: true, poster: @learning_object.thumbnail) + else learning_object_thumbnail @learning_object, "large" + end + %> + </div> <div class="pull-right" style="padding-right:122px"> <span class="glyphicon glyphicon-eye-open"><%= @learning_object.views %> </span> <span class="glyphicon glyphicon-star"><%= @learning_object.likes %> </span>