src/MediaEmbed.php
public function parseId($id, $host, $config = []) {
		if (empty($id) || empty($host)) {
			return null;
		}

		// local files?
		if ($host === 'local') {
			$res = $this->embedLocal($id);
			if (!$res) {
				$stub = [];
				$Object = $this->object($stub, $config);
				return $Object;
			}
			//TODO
			return null;
		}

		// all other hosts
		$host = $this->getHost($host);
		if (!$host) {
			return null;
		}
		$stub = $host;
		$config += $this->config;

		$stub['id'] = $id;
		$stub['reverse'] = true;
		$Object = $this->object($stub, $config);

		return $Object;
	}
public function parseId($id, $host, $config = []) {
		if (empty($id) || empty($host)) {
			return null;
		}

		// local files?
		if ($host === 'local') {
			$res = $this->embedLocal($id);
			if (!$res) {
				$stub = [];
				$Object = $this->object($stub, $config);
				return $Object;
			}
			//TODO
			return null;
		}

		// all other hosts
		$host = $this->getHost($host);
		if (!$host) {
			return null;
		}
		$stub = $host;
		$config += $this->config;

		$stub['id'] = $id;
		$stub['reverse'] = true;
		$Object = $this->object($stub, $config);

		return $Object;
	}
public function parseId ( $ id , $ host , $ config = [ ] ) { if ( empty ( $ id ) || empty ( $ host ) ) { return null ; } // local files? if ( $ host === 'local' ) { $ res = $ this -> embedLocal ( $ id ) ; if ( ! $ res ) { $ stub = [ ] ; $ Object = $ this -> object ( $ stub , $ config ) ; return $ Object ; } //TODO return null ; } // all other hosts $ host = $ this -> getHost ( $ host ) ; if ( ! $ host ) { return null ; } $ stub = $ host ; $ config += $ this -> config ; $ stub [ 'id' ] = $ id ; $ stub [ 'reverse' ] = true ; $ Object = $ this -> object ( $ stub , $ config ) ; return $ Object ; }
Prepare embed video from different video hosts.

@param string $id
@param string $host
@param array $config

@return \MediaEmbed\Object\MediaObject|null
Prepare embed video from different video hosts .