protected function locateAutoembedMedia() {

		// Searches for URLs on a line by themselves in the post content.
		preg_match_all( '|^\s*(https?://[^\s"]+)\s*$|im', $this->content, $matches, PREG_SET_ORDER );

		if ( empty( $matches ) || ! is_array( $matches ) ) {
			return '';
		}

		foreach ( $matches as $value ) {

			// Let WP work its magic with the 'autoembed' method.
			$embed = $GLOBALS['wp_embed']->autoembed( $value[0] );

			if ( $embed ) {

				// If we're given a shortcode, roll with it.
				if ( preg_match( "/\[{$this->type}\s/", $embed ) ) {

					$this->original_media = $value[0];

					return $this->doShortcode( $this->type, $embed );
				}
			}
		}

		return '';
	}