The Revver Video plugin is a very useful tool for showing revenue-earning videos on my sites, but I'd like to make a change in the way it displays video in a post.
Currently, the plugin displays videos before the post's content. I'd like to place it after the content, but don't see an easy way to achieve it.
Someone started a topic asking the same question on the Revver Support Forum. The response was:
There's no easy way to do it, but if you're really determined to have the video at the end of the content, you can alter the embedVideoOnPost function in the revver.php file to append the Revver specific content instead of prepending it.
I understand what the answer means, but I don't know how to go about doing it.
Here are the relevant lines of code. If anyone can suggest what to change, it'd be much appreciated.
/**
* embeds a revver video player on a post. this is called by a filter.
* @content - the text of the post this is embedding into
*
*/
function embedVideoOnPost($content) {
global $wp_query;
global $revver_is_in_rss;
$post_id = $wp_query->post->post_id;
$video_id = $wp_query->post->video_id;
if ($video_id == 0) return $content . $this->getVideoCommentsWidget($wp_query->post);
$divId = "revverVideo-" . $post_id . "-" . $video_id;
// if we're in rss mode just embed a thumbnail
// which will link to the post. this makes the
// video thumb visible right in the feed.
if ( $revver_is_in_rss ) {
echo '<div class="revver-video-thumb"><a href="';
the_permalink();
echo '" rel="bookmark" title="' . __('Watch Video for: ', $this->pluginName) . the_title('', '', false);
echo '"><img src="http://frame.revver.com/frame/170x128/' . $video_id . '.jpg" width="170" />';
echo '</div>';
} else {
$flash_width = (int) get_option($this->pluginName . "_flash_width");
$flash_height = (int) get_option($this->pluginName . "_flash_height");
$flash_height += 32; // 32 pixels is for the flash player controls
$flash_logo = get_option($this->pluginName . "_flash_logo");
$flash_logo_uri = get_option($this->pluginName . "_flash_logo_uri");
$flash_autoplay = get_option($this->pluginName . "_flash_autoplay");
$flash_allowfullscreen = get_option($this->pluginName . "_flash_allowfullscreen");
$share_displayshare = get_option($this->pluginName . "_share_displayshare");
$share_displaydetails = get_option($this->pluginName . "_share_displaydetails");
echo "<div id='" . $divId . "' class='revver-video'></div>";
echo "<script type='text/javascript'>\n";
echo "//<![CDATA[\n";
echo 'revverVideo.embed( {"divId": "' . $divId . '", "mediaId": ' . $video_id;
echo ', "width": ' . $flash_width . ', "height": ' . $flash_height;
if ($flash_logo == "custom") {
echo ', "pngLogo": "' . $flash_logo_uri . '"';
} else {
echo ', "pngLogo": "' . $flash_logo . '"';
}
if (is_single() && $flash_autoplay == "yes") echo ', "autoStart": "true"';
if ($flash_allowfullscreen == "yes") {
echo ', "allowFullScreen": true';
} else {
echo ', "allowFullScreen": false';
}
echo ', "affiliateId": ' . $this->userId . ' })' . "\n";
echo "//]]>\n";
echo "</script>";
if ($share_displayshare == "yes" || $share_displaydetails == "yes") {
include(REVVER_ABSPATH . "includes/video-details-and-sharing.php");
}
}
return $content . $this->getVideoCommentsWidget($wp_query->post) . "<span class='revver-after-video'></span>";