src/actions/Play.js
/**
	 * Prepare the needed values to run the fade function on the given player
	 *
	 * @param {string} fadeTime - The time it will take the audio to reach it's maximum audio
	 * @param {Audio} player - The Audio object to modify
	 *
	 * @return {Promise} - This promise will resolve once the fadeIn has ended
	 */
Prepare the needed values to run the fade function on the given player
@param {string} fadeTime - The time it will take the audio to reach it's maximum audio
@param {Audio} player - The Audio object to modify

@return {Promise} - This promise will resolve once the fadeIn has ended
Prepare the needed values to run the fade function on the given player @param { string } fadeTime - The time it will take the audio to reach it ' s maximum audio @param { Audio } player - The Audio object to modify @return { Promise } - This promise will resolve once the fadeIn has ended
static fadeIn (fadeTime, player) {
		const time = parseFloat (fadeTime.match (/\d*(\.\d*)?/));
		const increments = time / 0.1;
		const maxVolume = player.volume * 100;
		const volume = (maxVolume / increments) / maxVolume;
		const interval = (1000 * time) / increments;
		const expected = Date.now () + interval;
		player.volume = 0;
		player.dataset.fade = 'in';
		player.dataset.maxVolume = maxVolume;
		return new Promise ((resolve, reject) => {
			setTimeout (() => {
				Play.fade (player, volume, interval, expected, resolve);
			}, interval);
		});
	}
static fadeIn ( fadeTime , player ) { const time = parseFloat ( fadeTime . match ( / \d*(\.\d*)? / ) ) ; const increments = time / 0.1 ; const maxVolume = player . volume * 100 ; const volume = ( maxVolume / increments ) / maxVolume ; const interval = ( 1000 * time ) / increments ; const expected = Date . now ( ) + interval ; player . volume = 0 ; player . dataset . fade = 'in' ; player . dataset . maxVolume = maxVolume ; return new Promise ( ( resolve , reject ) => { setTimeout ( ( ) => { Play . fade ( player , volume , interval , expected , resolve ) ; } , interval ) ; } ) ; }
Prepare the needed values to run the fade function on the given player
 @param {string} fadeTime - The time it will take the audio to reach it's maximum audio
 @param {Audio} player - The Audio object to modify
Prepare the needed values to run the fade function on the given player @param { string } fadeTime - The time it will take the audio to reach it ' s maximum audio @param { Audio } player - The Audio object to modify