Skip to content

Commit 8157da9

Browse files
author
Dmitry Kologrivov
committed
Merge branch 'ME-MAGETWO-QA' into 'master3'
ME-MAGETWO-QA See merge request !146
2 parents 4951f2e + f103439 commit 8157da9

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

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
@@ -569,8 +569,8 @@ require([
569569
type = 'youtube';
570570
} else if (href.host.match(/vimeo\.com/)) {
571571
type = 'vimeo';
572-
vimeoRegex = new RegExp(['https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)',
573-
'?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)'
572+
vimeoRegex = new RegExp(['https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)',
573+
'?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|)(\\d+)(?:$|\\/|\\?)'
574574
].join(''));
575575
id = href.href.match(vimeoRegex)[3];
576576
}

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ define([
1111
], function ($) {
1212
'use strict';
1313

14+
/**
15+
* @private
16+
*/
17+
var allowBase = true; //global var is needed because fotorama always fully reloads events in case of fullscreen
18+
1419
/**
1520
* @private
1621
*/
@@ -68,8 +73,8 @@ define([
6873
type = 'youtube';
6974
} else if (href.host.match(/vimeo\.com/)) {
7075
type = 'vimeo';
71-
vimeoRegex = new RegExp(['https?:\\/\\/(?:www\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)',
72-
'?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|)(\\d+)(?:$|\\/|\\?)'
76+
vimeoRegex = new RegExp(['https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)',
77+
'?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|)(\\d+)(?:$|\\/|\\?)'
7378
].join(''));
7479
id = href.href.match(vimeoRegex)[3];
7580
}
@@ -309,13 +314,16 @@ define([
309314

310315
if (
311316
videoItem.mediaType === this.VID && videoItem.isBase &&
312-
this.options.VideoSettings[0].playIfBase
317+
this.options.VideoSettings[0].playIfBase && allowBase
313318
) {
314319
this.Base = true;
320+
allowBase = false;
315321
}
316322
}
317323

318-
this._createCloseVideo($(this.element).data('fotorama'), this.Base);
324+
if (!this.isFullscreen) {
325+
this._createCloseVideo($(this.element).data('fotorama'), this.Base);
326+
}
319327
},
320328

321329
/**
@@ -327,7 +335,7 @@ define([
327335
scriptTag = document.getElementsByTagName('script')[0];
328336

329337
element.async = true;
330-
element.src = 'https://f.vimeocdn.com/js/froogaloop2.min.js';
338+
element.src = 'https://secure-a.vimeocdn.com/js/froogaloop2.min.js';
331339
scriptTag.parentNode.insertBefore(element, scriptTag);
332340
},
333341

@@ -523,9 +531,11 @@ define([
523531
this.Base = false;
524532
}
525533
}, this), 50);
526-
} else { //if not a vimeo - play it immediately
527-
$(this.element).data('fotorama').activeFrame.$stageFrame[0].click();
528-
this.Base = false;
534+
} else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen
535+
setTimeout($.proxy(function () {
536+
$(this.element).data('fotorama').activeFrame.$stageFrame[0].click();
537+
this.Base = false;
538+
}, this), 50);
529539
}
530540
}
531541
},

app/design/frontend/Magento/blank/Magento_ProductVideo/web/css/source/_module.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
}
6464
}
6565

66+
@media only screen
67+
and (min-device-width : 320px)
68+
and (max-device-width : 780px)
69+
and (orientation : landscape) {
70+
.product-video {
71+
height: 100%;
72+
width: 81%;
73+
}
74+
}
75+
6676
.fotorama__arr.hidden-video {
6777
z-index: -1;
6878
}

0 commit comments

Comments
 (0)