Instead of this:
echo get_post_meta($post->ID, $key, true);
What I think you want is this:
$fieldvalue = get_post_meta($post->ID, $key, true);
echo $proPlayer->addPlayerCode($fieldvalue);
You can often combine the two lines like so, if you want:
echo $proPlayer->addPlayerCode(get_post_meta($post->ID, $key, true));
To be safe you’d wrap the whole thing in an if/else like so:
if ($proPlayer) {
echo $proPlayer->addPlayerCode(get_post_meta($post->ID, $key, true));
}
Debugging will be easier without the if
part, though, since you’ll get an error if it doesn’t exist. Then you’ll know I’ve got the name wrong, or the plugin isn’t loading, or something.
Also please bear in mind that I’m guessing. Looking at the code it looks to me like this should work, but I haven’t tested it.