1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/node_modules/videojs-playlist/test/util.js
Daniel Neto 14f492d68f update
2023-07-02 19:30:57 -03:00

31 lines
713 B
JavaScript

import document from 'global/document';
import videojs from 'video.js';
/**
* Destroy a fixture player.
*
* @param {Object} context
* A testing context.
*/
export function destroyFixturePlayer(context) {
context.player.dispose();
}
/**
* Create a fixture player.
*
* @param {Object} context
* A testing context.
*/
export function createFixturePlayer(context) {
context.video = document.createElement('video');
context.fixture = document.querySelector('#qunit-fixture');
context.fixture.appendChild(context.video);
context.playerIsReady = false;
context.player = videojs(context.video, {}, () => {
context.playerIsReady = true;
});
context.player.playlist();
}