Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #11  
Old 05-15-2007, 12:18 AM
bert Offline
forum loafer
 
Join Date: Dec 2006
Location: Rotterdam
Posts: 9
progress with video embedding

now embedded jeroens flash player (http://www.jeroenwijering.com/)
and i am able to play locally stored flv files in my pixelpost/video folder to which i upload them.

hacked the index.php and added
$video = "<script type='text/javascript'>
var so = newSWFObject('http://www.bertsimons.nl/blog/video/flvplayer.swf','mpl','400','320','7');so.addParam( 'allowfullscreen','true');so.addVariable('displayh eight','300');so.addVariable('file','http://www.bertsimons.nl/blog/video/<CUSTOM_FIELD_VALUE_ID=1>');so.addVariable('height ','320');so.addVariable('image','http://www.bertsimons.nl/blog/images/$image_name');so.addVariable('width','400');so.add Variable('overstretch','true');so.addVariable('sho wdigits','false');so.addVariable('showicons','fals e');so.addVariable('usecaptions','true');so.addVar iable('usefullscreen','false');so.addVariable('use keys','false');so.write('player');</script>";
$tpl = str_replace("<video>",$video,$tpl);

added <video> in my image_template
i normally upload a new image and in my custom field video I put the name of the video file (without the flv extension) which uses the this image (images/$image_name) as preview

when no video file is uploaded the default value of the custom video field which i set to'.flv' still triggers the flashplayer but now just shows the video preview file which is the uploaded image file as in /images/$imagename

problem till now is taht when clicking an image file it wants to play an non existing flv file and blanks the preview..:-(
Reply With Quote
  #12  
Old 05-15-2007, 12:40 AM
bert Offline
forum loafer
 
Join Date: Dec 2006
Location: Rotterdam
Posts: 9
idea

what I want to do next is to check if the custom addon on value is .flv (which meand no videoname has been put before it)
and if it is then use another stylesheet in which the video is layered behind the image instead on top of it.

I will try to do this with austriakas code;

if ($cf_value=='.flv'){
$tpl = str_replace("<STYLESHEET>",'<link rel="stylesheet" type="text/css" href="PATH_TO_IMAGE_STYLESHEET" title="image" />',$tpl);
else {
$tpl = str_replace("<STYLESHEET>",'<link rel="stylesheet" type="text/css" href="PATH_TO_VIDEO_STYLESHEET" title="video" />',$tpl);

and the new tag <stylesheet> in the image template

if this works then in case of an image the normal image (not with the flash player) will show
Reply With Quote
  #13  
Old 05-15-2007, 03:08 AM
bert Offline
forum loafer
 
Join Date: Dec 2006
Location: Rotterdam
Posts: 9
just added this to index.php. to switch css for image or video.
depending on custom field for video css stylesheet switches to video or image.
added display:none; to the div for the video player in the video.css..

added this to index php at line 650

$query = "SELECT a.name, b.value FROM ".$pixelpost_db_prefix."customfields AS a, ".$pixelpost_db_prefix."customfieldsvalues AS b WHERE b.customfield_id = a.id AND b.parent_id=$image_id AND a.enable='on' AND a.visible='on' order by a.fieldorder";
$result = mysql_query($query) or die("Invalid query (2): " . mysql_error());
while(list($cf_name, $cf_value) = mysql_fetch_row($result))
{
$videocss = '<link rel="stylesheet" type="text/css" href="templates/simple/styles/video.css" title="light" />';
$imagecss = '<link rel="stylesheet" type="text/css" href="templates/simple/styles/image.css" title="light" />';


$cf_value = pullout($cf_value);
if ($cf_value == ".flv"){ $tpl = str_replace("<STYLESHEET>",$imagecss,$tpl);
}
elseif ($cf_value == ".flv"){ $tpl = str_replace("<STYLESHEET>",$imagecss,$tpl);
}
else { $tpl = str_replace("<STYLESHEET>",$videocss,$tpl);
}
}


and it works!!! next week i will try to get some mess out of the code and make a better post. i go to sleep now.. 14 hours of pixelposting.........
Reply With Quote
  #14  
Old 05-17-2007, 04:36 PM
bert Offline
forum loafer
 
Join Date: Dec 2006
Location: Rotterdam
Posts: 9
using different templates instead of stylesheets

so now i don't have to postion the video over the image anymore but can just use a video_template in which no image is displayed.

also changed the standard custom field value to 'no_video'

$query = "SELECT a.name, b.value FROM ".$pixelpost_db_prefix."customfields AS a, ".$pixelpost_db_prefix."customfieldsvalues AS b WHERE b.customfield_id = a.id AND b.parent_id=$image_id AND a.enable='on' AND a.visible='on' order by a.fieldorder";
$result = mysql_query($query) or die("Invalid query (2): " . mysql_error());
while(list($cf_name, $cf_value) = mysql_fetch_row($result))
{
$cf_value = pullout($cf_value);
if ($cf_value == "no_video")
{

}
else
{
$tpl = file_get_contents("templates/".$cfgrow['template']."/video_template.html");
}
}


$video = "<script type='text/javascript'>
var so = new SWFObject('http://www.bertsimons.nl/blog/video/flvplayer.swf','mpl','400','320','7');so.addParam( 'allowfullscreen','true');so.addVariable('displayh eight','300');so.addVariable('file','http://www.bertsimons.nl/blog/video/<CUSTOM_FIELD_VALUE_ID=1>');so.addVariable('height ','300');so.addVariable('image','http://www.bertsimons.nl/blog/images/$image_name');so.addVariable('width','400');so.add Variable('overstretch','true');so.addVariable('sho wdigits','false');so.addVariable('showicons','true ');so.addVariable('usecaptions','true');so.addVari able('usefullscreen','false');so.addVariable('usek eys','false');so.write('player');</script>";


$tpl = str_replace("<video>",$video,$tpl);




and in the video template I just put

<div id="player">this string will be replaced with the video</div>
(tabove line is needed for Jeroen weijerings flashplayer)
<video>


and all is working and can bee seen at

www.bertsimons.nl/blog/test.html
Reply With Quote
  #15  
Old 05-30-2007, 12:25 AM
JohnieR Offline
forum loafer
 
Join Date: May 2007
Posts: 1
I still dosnt understand

I'm sorry, I still dosnt understand how to put videos on my blog - which is the worse thing in yet so great pixelpost.

Could someone tell what files to edit and what to put on where, please. And how should I create a template called video?

Thanks.
Reply With Quote
  #16  
Old 07-18-2007, 12:19 AM
xxivxxv Offline
forum loafer
 
Join Date: Jan 2007
Location: Abbotsford BC
Posts: 12
this is pretty cool. did you ever get it to work for you?
Reply With Quote
  #17  
Old 09-04-2007, 11:14 AM
griet Offline
forum loafer
 
Join Date: Sep 2007
Posts: 7
Does this work?
Who tried it?
Examples of blogs who use it? Because the link of Bert gives an error....
Reply With Quote
  #18  
Old 09-06-2007, 11:44 AM
griet Offline
forum loafer
 
Join Date: Sep 2007
Posts: 7
Nobody ever tried this? Nobody uses it on his website?
I just would like to be sure that the code that is mentioned here is correct before I adjust my website because I'm not really an expert in solving things when they go wrong.
Reply With Quote
  #19  
Old 09-06-2007, 12:15 PM
Dennis's Avatar
Dennis+ Offline
Team Pixelpost
 
Join Date: Jul 2006
Posts: 2,394
Send a message via MSN to Dennis
dwilkinsjr made an addon. Please search the forums.

http://dwilkinsjr.com/public/pixelpo...embed_v0.5.zip
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
Reply With Quote
  #20  
Old 09-06-2007, 12:45 PM
griet Offline
forum loafer
 
Join Date: Sep 2007
Posts: 7
thanks a lot!!!
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 10:08 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs