Skip to content

Commit 8de016a

Browse files
authored
Merge pull request #7494 from magento-atwix-pyrrans/delivery-bunch-2022-02-28
[Pyrrans] Delivery bunch from 03/07/2022
2 parents 81340cb + e882a00 commit 8de016a

File tree

14 files changed

+2656
-160
lines changed

14 files changed

+2656
-160
lines changed

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<data key="telephone">333-33-333-33</data>
333333
<data key="country">Germany</data>
334334
<data key="state">Berlin</data>
335-
<data key="vatNumber">DE265675123</data>
335+
<data key="vatNumber">DE257486969</data>
336336
</entity>
337337
<entity name="US_Address_California">
338338
<data key="firstname">John</data>

app/code/Magento/ProductVideo/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"suggest": {
1818
"magento/module-customer": "*",
19-
"magento/module-config": "*"
19+
"magento/module-config": "*",
20+
"magento/module-theme": "*"
2021
},
2122
"type": "magento2-module",
2223
"license": [

app/code/Magento/ProductVideo/view/frontend/requirejs-config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ var config = {
77
map: {
88
'*': {
99
loadPlayer: 'Magento_ProductVideo/js/load-player',
10-
fotoramaVideoEvents: 'Magento_ProductVideo/js/fotorama-add-video-events'
10+
fotoramaVideoEvents: 'Magento_ProductVideo/js/fotorama-add-video-events',
11+
'vimeoWrapper': 'vimeo/vimeo-wrapper'
1112
}
1213
},
1314
shim: {
14-
vimeoAPI: {}
15+
vimeoAPI: {},
16+
'Magento_ProductVideo/js/load-player': {
17+
deps: ['vimeoWrapper']
18+
}
1519
}
1620
};

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

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ define([
100100
videoData: '',
101101
videoSettings: '',
102102
optionsVideoData: '',
103-
dataMergeStrategy: 'replace',
104-
vimeoJSFrameworkLoaded: false
103+
dataMergeStrategy: 'replace'
105104
},
106105

107106
/**
@@ -163,7 +162,6 @@ define([
163162
if (this._checkForVideoExist()) {
164163
this._checkFullscreen();
165164
this._listenForFullscreen();
166-
this._checkForVimeo();
167165
this._isVideoBase();
168166
this._initFotoramaVideo();
169167
this._attachFotoramaEvents();
@@ -396,27 +394,6 @@ define([
396394
return checker;
397395
},
398396

399-
/**
400-
*
401-
* @private
402-
*/
403-
_checkForVimeo: function () {
404-
var allVideoData = this.options.videoData,
405-
videoItem;
406-
407-
if (window.Froogaloop) { // prevent duplicated initialization
408-
return;
409-
}
410-
411-
for (videoItem in allVideoData) {
412-
if (allVideoData[videoItem].provider === this.VI) {
413-
this._loadVimeoJSFramework();
414-
415-
return;
416-
}
417-
}
418-
},
419-
420397
/**
421398
*
422399
* @private
@@ -448,27 +425,6 @@ define([
448425
}
449426
},
450427

451-
/**
452-
*
453-
* @private
454-
*/
455-
_loadVimeoJSFramework: function () {
456-
var element = document.createElement('script'),
457-
scriptTag = document.getElementsByTagName('script')[0];
458-
459-
element.async = true;
460-
element.src = 'https://f.vimeocdn.com/js/froogaloop2.min.js';
461-
462-
/**
463-
* Vimeo js framework on load callback.
464-
*/
465-
element.onload = function () {
466-
this.onVimeoJSFramework();
467-
this.vimeoJSFrameworkLoaded = true;
468-
}.bind(this);
469-
scriptTag.parentNode.insertBefore(element, scriptTag);
470-
},
471-
472428
/**
473429
*
474430
* @param {Event} e
@@ -708,7 +664,7 @@ define([
708664
$(event.target).removeClass(this.VU);
709665
type = $(event.target).find('.' + this.PV).data('type');
710666

711-
if (this.vimeoJSFrameworkLoaded && type === this.VI) {
667+
if (type === this.VI) {
712668
$(event.target).find('.' + this.PV).productVideoLoader();
713669
} else if (type === this.VI) {
714670
this._showLoader();
@@ -732,8 +688,7 @@ define([
732688
* @private
733689
*/
734690
_handleBaseVideo: function (fotorama, srcNumber) {
735-
var waitForFroogaloop,
736-
videoData = this.options.videoData,
691+
var videoData = this.options.videoData,
737692
activeIndex = fotorama.activeIndex,
738693
number = parseInt(srcNumber, 10),
739694
activeIndexIsBase = videoData[activeIndex];
@@ -743,22 +698,11 @@ define([
743698
}
744699

745700
if (activeIndexIsBase && number === 1 && $(window).width() > this.MobileMaxWidth) {
746-
if (this.options.videoData[fotorama.activeIndex].provider === this.VI) {
747-
waitForFroogaloop = setInterval($.proxy(function () {
748-
if (window.Froogaloop) {
749-
clearInterval(waitForFroogaloop);
750-
fotorama.requestFullScreen();
751-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
752-
this.Base = false;
753-
}
754-
}, this), 50);
755-
} else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen
756-
setTimeout($.proxy(function () {
757-
fotorama.requestFullScreen();
758-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
759-
this.Base = false;
760-
}, this), 50);
761-
}
701+
setTimeout($.proxy(function () {
702+
fotorama.requestFullScreen();
703+
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
704+
this.Base = false;
705+
}, this), 50);
762706
}
763707
},
764708

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
*/
1010
define([
1111
'jquery',
12-
'jquery-ui-modules/widget'
12+
'jquery-ui-modules/widget',
13+
'vimeoWrapper'
1314
], function ($) {
1415
'use strict';
1516

@@ -307,7 +308,8 @@ define([
307308
_create: function () {
308309
var timestamp,
309310
additionalParams = '',
310-
src;
311+
src,
312+
id;
311313

312314
this._initialize();
313315
timestamp = new Date().getTime();
@@ -325,10 +327,11 @@ define([
325327
this._code +
326328
timestamp +
327329
additionalParams;
330+
id = 'vimeo' + this._code + timestamp;
328331
this.element.append(
329332
$('<iframe></iframe>')
330333
.attr('frameborder', 0)
331-
.attr('id', 'vimeo' + this._code + timestamp)
334+
.attr('id', id)
332335
.attr('width', this._width)
333336
.attr('height', this._height)
334337
.attr('src', src)
@@ -338,10 +341,11 @@ define([
338341
.attr('referrerPolicy', 'origin')
339342
.attr('allow', 'autoplay')
340343
);
341-
this._player = window.$f(this.element.children(':first')[0]);
342344

343-
// Froogaloop throws error without a registered ready event
344-
this._player.addEvent('ready', function (id) {
345+
/* eslint-disable no-undef */
346+
this._player = new Vimeo.Player(this.element.children(':first')[0]);
347+
348+
this._player.ready().then(function () {
345349
$('#' + id).closest('.fotorama__stage__frame').addClass('fotorama__product-video--loaded');
346350
});
347351
},
@@ -350,23 +354,23 @@ define([
350354
* Play command for Vimeo
351355
*/
352356
play: function () {
353-
this._player.api('play');
357+
this._player.play();
354358
this._playing = true;
355359
},
356360

357361
/**
358362
* Pause command for Vimeo
359363
*/
360364
pause: function () {
361-
this._player.api('pause');
365+
this._player.pause();
362366
this._playing = false;
363367
},
364368

365369
/**
366370
* Stop command for Vimeo
367371
*/
368372
stop: function () {
369-
this._player.api('unload');
373+
this._player.unload();
370374
this._playing = false;
371375
},
372376

app/code/Magento/Theme/view/base/requirejs-config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ var config = {
4545
'jquery-ui-modules/tabs': 'jquery/ui-modules/widgets/tabs',
4646
'jquery-ui-modules/tooltip': 'jquery/ui-modules/widgets/tooltip',
4747
'jquery-ui-modules/widget': 'jquery/ui-modules/widget',
48-
'jquery-ui-modules/timepicker': 'jquery/timepicker'
48+
'jquery-ui-modules/timepicker': 'jquery/timepicker',
49+
'vimeo': 'vimeo/player',
50+
'vimeoWrapper': 'vimeo/vimeo-wrapper'
4951
}
5052
},
5153
shim: {
@@ -57,7 +59,10 @@ var config = {
5759
'matchMedia': {
5860
'exports': 'mediaCheck'
5961
},
60-
'magnifier/magnifier': ['jquery']
62+
'magnifier/magnifier': ['jquery'],
63+
'vimeo/player': {
64+
'exports': 'Player'
65+
}
6166
},
6267
paths: {
6368
'jquery/validate': 'jquery/jquery.validate',

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/static/framework/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
require __DIR__ . '/autoload.php';
1818

19+
error_reporting(E_ALL);
1920
if (!defined('TESTS_TEMP_DIR')) {
2021
define('TESTS_TEMP_DIR', dirname(__DIR__) . '/tmp');
2122
}

0 commit comments

Comments
 (0)