Skip to content

Commit ea2c7c8

Browse files
author
Tang, Yu(ytang1)
committed
Merge pull request #129 from magento-vanilla/PR
[Vanilla] Bug Fixes - Product Video
2 parents 0924fbc + 7e77c1b commit ea2c7c8

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function retrieveRemoteImage($fileUrl, $localFilePath)
128128
$image = $this->curl->read();
129129
if (empty($image)) {
130130
throw new \Magento\Framework\Exception\LocalizedException(
131-
__('Could not get video information. Please check your connection and try again.')
131+
__('Could not get preview image information. Please check your connection and try again.')
132132
);
133133
}
134134
$this->fileUtility->saveFile($localFilePath, $image);

app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ require([
303303
additionalParams += '&autoplay=1';
304304
}
305305

306-
src = 'http://player.vimeo.com/video/' +
306+
src = window.location.protocol + '//player.vimeo.com/video/' +
307307
this._code + '?api=1&player_id=vimeo' +
308308
this._code +
309309
timestamp +
@@ -483,7 +483,7 @@ require([
483483
}
484484
);
485485
} else if (type === 'vimeo') {
486-
$.getJSON('http://www.vimeo.com/api/v2/video/' + id + '.json?callback=?',
486+
$.getJSON(window.location.protocol + '//www.vimeo.com/api/v2/video/' + id + '.json?callback=?',
487487
{
488488
format: 'json'
489489
},

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ define([
508508
$image.find('.magnify-lens').remove();
509509
$image.on('click', function () {
510510
if ($(this).hasClass('video-unplayed') && $(this).find('iframe').length === 0) {
511+
$('.fotorama__arr--next').hide();
512+
$('.fotorama__arr--prev').hide();
513+
511514
$(this).removeClass('video-unplayed');
512515
$(this).find('.' + PV).productVideoLoader();
513516

@@ -611,6 +614,8 @@ define([
611614
$(this).remove();
612615
$item.append(cloneVideoDiv);
613616
$item.addClass('video-unplayed');
617+
$('.fotorama__arr--next').show();
618+
$('.fotorama__arr--prev').show();
614619
self._hideCloseVideo();
615620

616621
});

app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ define(['jquery', 'jquery/ui'], function ($) {
327327
.attr('width', this._width)
328328
.attr('height', this._height)
329329
.attr('src', src)
330+
.attr('webkitallowfullscreen', '')
331+
.attr('mozallowfullscreen', '')
332+
.attr('allowfullscreen', '')
330333
);
331334
this._player = window.$f(this.element.children(':first')[0]);
332335

lib/web/fotorama/fotorama.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3506,6 +3506,13 @@ fotoramaVersion = '4.6.4';
35063506

35073507
that.requestFullScreen = function () {
35083508
if (o_allowFullScreen && !that.fullScreen) {
3509+
3510+
//check that this is not video
3511+
var isVideo = $((that.activeFrame || {}).$stageFrame || {}).hasClass('fotorama-video-container');
3512+
if(isVideo) {
3513+
return;
3514+
}
3515+
35093516
scrollTop = $WINDOW.scrollTop();
35103517
scrollLeft = $WINDOW.scrollLeft();
35113518

0 commit comments

Comments
 (0)