I already add metadata to the video – I assume what you’re asking for are parameters to overall the default information and to add your own?
Hello David.
yes, but it’s tunable only in the settings for the whole website. But it would be great to have an ability to manage it to every using of the shortcode.
So, could you add metadata parameter to the shortcode parameters (I mean something like this:
[youtube metadata=”yes” controls=2]SJrXgCLgcwY[/youtube]
[youtube metadata=”no” controls=2]fSQ6a77dAuM[/youtube]
If you added to profile settings it would be very useful too.
Okay, yes, that’s easy. But I have a question to help me understand this a little better… why would you need to turn the metadata off on an individual basis?
Thank you very much, David.
It’s easy to explane:
Generally, to have schema metadata is a great idea! But:
1) In some cases I need insert the same video into the same page twice. It won’t make google or other parsers happy.
2) In some cases I want to extend matadata of a video with additional block like
<div itemprop=”hasPart” itemscope itemtype=”http://schema.org/Clip”>
This case I’d prefer have video embeded “naked” and “dress” it in metedata by myself. But I’d be happy to do it just sometimes, so this functionality of the plugin is very useful 🙂
I understand – thank you for the explanation.
I’ll add this to the list of enhancements.
Many thanks, David!
You are really great!
One wish more but regarding the same subject.
Would you be so kind to add all parameters of the video that you use for creating metedate (like published and others), to [ vinfo], please.
Of course – a great idea. I’ll add that to the list.
Thank you, David.
I think you can add published, duration, channelid, channeltitle.
I’m sorry that I advise you what to do with your code, but I thinks it’s better to explain what do I mean.
I’d add to api-access.php:
$return_data = array(
….
‘channelid’ => ”,
‘channeltitle’ => ”,
‘duration’ => ”,
)
and
if ( isset( $api_data[‘snippet’][‘channelId’] ) ) {
$return_data[‘channelid’] = htmlspecialchars( $api_data[‘snippet’][‘channelId’] );
}
if ( isset( $api_data[‘snippet’][‘channelTitle’] ) ) {
$return_data[‘channeltitle’] = htmlspecialchars( $api_data[‘snippet’][‘channelTitle’] );
}
if ( isset( $api_data[‘contentDetails’][‘duration’] ) ) {
$return_data[‘duration’] = htmlspecialchars( $api_data[‘contentDetails’][‘duration’] );
}`
and to generate-other-code.php :
$output = str_ireplace( ‘%published%’, $data[‘published’], $output );
$output = str_ireplace( ‘%channelid%’, $data[‘channelid’], $output );
$output = str_ireplace( ‘%channeltitle%’, $data[‘channeltitle’], $output );
$output = str_ireplace( ‘%duration%’, $data[‘duration’], $output );
probably would change all str_replace to str_ireplace.
I’m sorry :)))