Sindbad~EG File Manager

Current Path : /var/www/html/cibahia.sumar.com.py/wp-content/plugins/peepso-videos/assets/js/video/
Upload File :
Current File : //var/www/html/cibahia.sumar.com.py/wp-content/plugins/peepso-videos/assets/js/video/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 {
				this.xhr = peepso.postJson( 'videosajax.get_preview', { url: this.source }, ( 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