Ticket #1375: meta-1375.diff
File meta-1375.diff, 1.6 KB (added by , 9 years ago) |
---|
-
wordpress.tv/public_html/wp-content/themes/wptv2/plugins/wordpresstv-twitter-cards/wordpresstv-twitter-cards.php
27 27 // Add the tags necessary for the player 28 28 $video_info = video_get_info_by_guid( $video_id[0] ); 29 29 list( $width, $height ) = wp_expand_dimensions( $video_info->width, $video_info->height, 560, 315 ); 30 $mp4_url = set_url_scheme( wp_get_attachment_url( $video_info->post_id ), 'https' ); 30 31 31 32 $og_tags['twitter:card'] = 'player'; 32 33 $og_tags['twitter:player'] = sprintf( 'https://videopress.com/v/%s?autoplay=0', $video_id[0] ); 33 34 $og_tags['twitter:player:width'] = $width; 34 35 $og_tags['twitter:player:height'] = $height; 35 $og_tags['twitter:player:stream'] = wp_get_attachment_url( $video_info->post_id );36 $og_tags['twitter:player:stream'] = $mp4_url; 36 37 $og_tags['twitter:player:stream:content_type'] = 'video/mp4'; 38 // Filters OG tags pending WPCOM fix. See https://meta.trac.wordpress.org/ticket/1375 and https://github.com/Automattic/jetpack/issues/2950 39 $og_tags['og:video:type'] = 'video/mp4'; 40 $og_tags['og:video'] = $mp4_url; 41 $og_tags['og:video:secure_url'] = $mp4_url; 37 42 38 43 return $og_tags; 39 44 }