Hey all.

I have been spending tons of time trying to get this to work but with no resolve.

I am using the Video module with the FLV player. I can get the video to work just fine in the node.

What I need to do is pull the most recent video (video posted node) and display the actual video (not a link to the node) in a block on the homepage of my site.

Anyone have an idea of how best to approach this?

I have been going through the video.module functions in hopes of just calling one of the functions from the block, but that is not possible as the $node object does not have a value at that point.

Comments

ytin’s picture

I haven't used the video module since I either use the embedded fields or swf tools but you can try views module to display the node as a block.

shanejeffery86’s picture

Not the best solution, but this is work around and it does work. I put the following function in the template.php file for the template that I am currently using.

function get_video_block(){
	include_once (drupal_get_path('module', 'video').'/includes/common.inc');
		
	$node = db_fetch_object(db_query("SELECT * FROM node LEFT JOIN video ON (node.vid = video.vid)
														 LEFT JOIN video_upload ON (node.vid = video_upload.vid)
														 LEFT JOIN files ON (video_upload.fid = files.fid)
										WHERE type='video' ORDER BY node.nid LIMIT 1"));
	$node->vidfile = $node->filepath;
	
	echo _video_common_get_player($node);
}

Then from the block that you create, you call the function get_video_block!

It works perfectly :)