|
#11
|
|||
|
|||
|
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..:-( |
|
#12
|
|||
|
|||
|
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 |
|
#13
|
|||
|
|||
|
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......... |
|
#14
|
|||
|
|||
|
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 |
|
#15
|
|||
|
|||
|
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. |
|
#16
|
|||
|
|||
|
this is pretty cool. did you ever get it to work for you?
|
|
#17
|
|||
|
|||
|
Does this work?
Who tried it? Examples of blogs who use it? Because the link of Bert gives an error.... |
|
#18
|
|||
|
|||
|
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. |
|
#19
|
||||
|
||||
|
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
|
|
#20
|
|||
|
|||
|
thanks a lot!!!
|
| Post Reply |
| Thread Tools | |
|
|