Sindbad~EG File Manager

Current Path : /var/www/html/cisuenolar.sumar.com.py/wp-content/plugins/peepso-videos/assets/js/audio/
Upload File :
Current File : /var/www/html/cisuenolar.sumar.com.py/wp-content/plugins/peepso-videos/assets/js/audio/embed.js

import peepso from 'peepso';
import VideoAbstract from './abstract';

/**
 * VideoEmbed class.
 * @class VideoEmbed
 */
export default class VideoEmbed extends VideoAbstract {
	/**
	 * Fetch video information.
	 * @return {Promise}
	 */
	fetch() {
		return new Promise( ( resolve, reject ) => {
			if ( this.data ) {
				resolve( this.data );
			} else {
				let params = { url: this.source, accepted_type: 'audio' };
				this.xhr = peepso.postJson( 'videosajax.get_preview', params, json => {
					if ( json.success ) {
						this.data = json.data;
						resolve( this.data );
					} else {
						reject( json && json.errors && json.errors[ 0 ] );
					}
				} ).ret;
			}
		} );
	}

	/**
	 * Abort fetching process.
	 */
	fetchAbort() {
		if ( this.xhr ) {
			this.xhr.abort();
			this.xhr = undefined;
		}
	}
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists