@playkit-js/playkit-js-dual-screen 3.1.11 → 3.1.12-canary.0-dcd47f2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### 3.1.12-canary.0-dcd47f2 (2023-09-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **FEC-13017:** dual-screen API e2e test ([#118](https://github.com/kaltura/playkit-js-dual-screen/issues/118)) ([dcd47f2](https://github.com/kaltura/playkit-js-dual-screen/commit/dcd47f2))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
### 3.1.11 (2023-08-21)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -4,6 +4,10 @@ import {mockKalturaBe, loadPlayer, MANIFEST, MANIFEST_SAFARI, getPlayer} from '.
|
|
|
4
4
|
|
|
5
5
|
const {EventType, FakeEvent, Error} = core;
|
|
6
6
|
|
|
7
|
+
Cypress.on('uncaught:exception', (err, runnable) => {
|
|
8
|
+
return false;
|
|
9
|
+
});
|
|
10
|
+
|
|
7
11
|
describe('Dual-Screen plugin', () => {
|
|
8
12
|
beforeEach(() => {
|
|
9
13
|
// manifest
|
|
@@ -12,7 +16,7 @@ describe('Dual-Screen plugin', () => {
|
|
|
12
16
|
cy.intercept('GET', '**/width/164/vid_slices/100', {fixture: '100.jpeg'});
|
|
13
17
|
cy.intercept('GET', '**/height/360/width/640', {fixture: '640.jpeg'});
|
|
14
18
|
// kava
|
|
15
|
-
cy.intercept('
|
|
19
|
+
cy.intercept('**/index.php?service=analytics*', {});
|
|
16
20
|
});
|
|
17
21
|
|
|
18
22
|
describe('dual-screen layouts', () => {
|
|
@@ -349,4 +353,87 @@ describe('Dual-Screen plugin', () => {
|
|
|
349
353
|
});
|
|
350
354
|
});
|
|
351
355
|
});
|
|
356
|
+
|
|
357
|
+
describe('Dual-screen plugin API', () => {
|
|
358
|
+
const testThumbsResult = (result: any, expectedResult: any) => {
|
|
359
|
+
return (
|
|
360
|
+
result.height === expectedResult.height &&
|
|
361
|
+
result.url === expectedResult.url &&
|
|
362
|
+
result.width === expectedResult.width &&
|
|
363
|
+
result.x === expectedResult.x &&
|
|
364
|
+
result.y === expectedResult.y &&
|
|
365
|
+
result.slide === expectedResult.slide
|
|
366
|
+
);
|
|
367
|
+
};
|
|
368
|
+
it('should check dual-screen service got registered', () => {
|
|
369
|
+
mockKalturaBe('dual-screen-0-media.json', 'cue-points-empty.json');
|
|
370
|
+
loadPlayer({}, {autoplay: false}).then(kalturaPlayer => {
|
|
371
|
+
const dualScreenService = kalturaPlayer.getService('dualScreen');
|
|
372
|
+
expect(dualScreenService).not.undefined;
|
|
373
|
+
expect(dualScreenService).has.key('getDualScreenThumbs');
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
it('should return thumbs for 2 active media', () => {
|
|
377
|
+
mockKalturaBe('dual-screen-2-media.json', 'cue-points-empty.json');
|
|
378
|
+
loadPlayer({layout: 'PIP'}).then(kalturaPlayer => {
|
|
379
|
+
const thumbResult = {
|
|
380
|
+
height: 92,
|
|
381
|
+
url: 'https://qa-apache-php7.dev.kaltura.com/p/5174/sp/517400/thumbnail/entry_id/0_5n7s22ge/version/100002/width/164/vid_slices/100',
|
|
382
|
+
width: 164,
|
|
383
|
+
x: 164,
|
|
384
|
+
y: 0,
|
|
385
|
+
slide: undefined
|
|
386
|
+
};
|
|
387
|
+
const dualScreenService = kalturaPlayer.getService('dualScreen');
|
|
388
|
+
cy.get('[data-testid="dualscreen_pipChildren"]').then(() => {
|
|
389
|
+
const thumbs = dualScreenService.getDualScreenThumbs(1);
|
|
390
|
+
expect(Array.isArray(thumbs)).to.be.true;
|
|
391
|
+
thumbs.map((thumbInfo: any) => {
|
|
392
|
+
expect(testThumbsResult(thumbInfo, thumbResult)).to.be.true;
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
it('should return 1 thumbs if layout SingleMedia', () => {
|
|
398
|
+
mockKalturaBe('dual-screen-1-media.json', 'cue-points-empty.json');
|
|
399
|
+
loadPlayer({layout: 'SingleMedia'}).then(kalturaPlayer => {
|
|
400
|
+
const dualScreenService = kalturaPlayer.getService('dualScreen');
|
|
401
|
+
cy.get('[data-testid="dualscreen_pipMinimized"]').then(() => {
|
|
402
|
+
const thumbs = dualScreenService.getDualScreenThumbs(1);
|
|
403
|
+
expect(Array.isArray(thumbs)).to.be.false;
|
|
404
|
+
expect(typeof thumbs === 'object').to.be.true;
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
it('should test media and slide thumb', () => {
|
|
409
|
+
mockKalturaBe('dual-screen-0-media.json', 'cue-points.json');
|
|
410
|
+
loadPlayer({}, {startTime: 15}).then(kalturaPlayer => {
|
|
411
|
+
const dualScreenService = kalturaPlayer.getService('dualScreen');
|
|
412
|
+
cy.get('[alt="Slide 2"]')
|
|
413
|
+
.and('have.prop', 'naturalWidth')
|
|
414
|
+
.should('be.greaterThan', 0)
|
|
415
|
+
.then(() => {
|
|
416
|
+
const slideThumb = {
|
|
417
|
+
height: 223,
|
|
418
|
+
slide: true,
|
|
419
|
+
url: 'https://mock-thumb-assets/api_v3/index.php/service/thumbAsset/action/serve//thumbAssetId/1_ri4o1mvs/ks/123',
|
|
420
|
+
width: 400,
|
|
421
|
+
x: 0,
|
|
422
|
+
y: 0
|
|
423
|
+
};
|
|
424
|
+
const mediaThumb = {
|
|
425
|
+
height: 92,
|
|
426
|
+
url: 'https://qa-apache-php7.dev.kaltura.com/p/5174/sp/517400/thumbnail/entry_id/0_5n7s22ge/version/100002/width/164/vid_slices/100',
|
|
427
|
+
width: 164,
|
|
428
|
+
x: 4264,
|
|
429
|
+
y: 0,
|
|
430
|
+
slide: undefined
|
|
431
|
+
};
|
|
432
|
+
const thumbs = dualScreenService.getDualScreenThumbs(16);
|
|
433
|
+
expect(testThumbsResult(thumbs[0], mediaThumb)).to.be.true;
|
|
434
|
+
expect(thumbs[1]).to.eql(slideThumb);
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
});
|
|
352
439
|
});
|