WordPress.org

Ready to get started?Download WordPress

Forums

Vixy YouTube Embed and Download
[resolved] Metadata type old-fashioned (3 posts)

  1. applewerbung
    Member
    Posted 2 months ago #

    Hi,

    great job with your plugin! Thanks for adding metadata for iframes.

    One thing I wanted to mention: the metadata style you're using seems to be outdated (at least it's not recognised by Google) So it's pretty useless right now :(

    I tried changing the /includes/generate-embed-code.php file to adapt schema.org metadata, but it always crashes anything when I want change sth (I'm bad at PHP...)

    Here's the code I tried:

    // Add IFRAME embed code
    
    	if ( ( $iframe ) or ( ( $embedplus ) && ( $fallback == "v" ) ) ) {
    		if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
    		if ( $metadata != 0 ) { $result .= $tab . '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">' . "\n"; $tab .= $tab; }
    		$result .= $tab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '&wmode=' . $wmode . '"';
    		if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
    		$result .= " ></iframe>\n";
    		if ( $metadata != 0 ) {
    			$result .= $tab . '<meta itemprop="embedURL" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . "\n";
    			$result .= $tab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/maxresdefault.jpg"/>' . "\n";
    			$result .= $tab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg"/>' . "\n";
    			$result .= $tab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/default.jpg"/>' . "\n";
    			$result .= $tab . '<meta itemprop="width" content="' . $width . '"/>' . "\n";
    			$result .= $tab . '<meta itemprop="height" content="' . $height . '"/>' . "\n";
    			$tab = "\t";
    			$result .= $tab . '</div>' . "\n";
    		}
    	}

    Could you change adapt that in a way it works? :D
    PS: Google recommends this metadata style.

    Thanks a lot, Apple Werbung

    https://wordpress.org/plugins/youtube-embed/

  2. Applian Technologies, Inc.
    Member
    Plugin Author

    Posted 2 months ago #

    Thanks - we'll look at that.

    We were using the official Metadata definitions rather than the Google specific ones (we thought anyway). We'll take a look and make any changes to the plugin.

    Applian.

  3. Applian Technologies, Inc.
    Member
    Plugin Author

    Posted 1 month ago #

    Version 3.2.1, released yesterday, should have updated the metadata to the correct, Google approved version.

    Applian.

Reply

You must log in to post.

About this Plugin

About this Topic