PHPCow Help

Full Version: How to embed video with phpcow
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to embed videos on phpcow

One of my favorite features I added was embedding video on phpcow. Here is how I went about doing it;

Go to your admin panel>templating>create new function

The next window that pops up should have the following:

function name
description
code

function name :enter whatever you want to call it ex. video embedding

description: this is what will show up for the listing, also good to take advantage of some SEO here

code: here is where you will drop in the code from whatever website it is you're grabbing the video from. ex:<div id="container" style="position:relative;width:320px;height:308px"><div id="flash_container" style="position:absolute;top:0px;left:0px;z-index:1"><OBJECT id="player296" codeBase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" height="308" width="320" padding="0" classid="clsid27cdb6e-ae6d-11cf-96b8-444553540000" VIEWASTEXT><PARAM NAME="FlashVars" VALUE="autoplay=false&assetId=video:assetmms:2104122&playerId=player296"><PARAM NAME="Movie" VALUE="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf"><PARAM NAME="src" VALUE="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf"><PARAM NAME="WMode" VALUE="transparent"><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="AllowNetworking" VALUE="all"><embed src="http://o.aolcdn.com/mediaplayer/players/fpm/fpm.swf" FlashVars="autoplay=false&assetId=video:assetmms:2104122&playerId=player296" quality="high" width="320" height="308" name="player296" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed></OBJECT></div><div id="videoContainer" style="position:absolute;left:0px;top:32px; z-index:2"></div></div>

thats just a current story from aol video on my site

Thats it! Then hit save, and then put the function into your template wherever you want it to appear. If you want to keep updating the video daily/weekly or whatever you then need only go into the same location, and instead of create function, click on edit function, change out the description, insert the new code and then check the "rebuild template" box before saving and it will automatically update your website with the new video.
I don't like the limitation of this feature.....I think there should be a way to add videos or other media where you want within the individual articles, instead of having to do it through template edits......on a static website that might work well.....but for a site thats constantly adding content its very limiting.
Instead of creating a function, can't you just add it direct to the HTML source. That way you can control the position for each article individualy.
I like doing it this way since my only video usage is on the homepage so I can simpling go into the function and quickly update the news everyday.

Yes, you could hard code it but it just seemed like too much work to me. Lol2
This is how I integrate videos into PhpCow:

1. Create a category for videos (i.e. "Video Clips")

2. Create articles with title, description, author, ... and place in the video category. The body of the article: just put the embedded video code in, nothing else. You have to switch to HTML screen, not visual, to place the code.

3. Create a custom block showing only title and body of the article from video category.

4. Put the custom block into your template where you want the video to be shown. Done!

Note: Depend on the width of the space you want to show videos on your homepage, you need to resize the video so that it won't break your template.

Check out on our website homepage: http://www.thiennhien.net and video category: http://www.thiennhien.net/news/192 I haven't figured out how to get the "screenshots" of the videos for thumbnails.
That very cool Thiennhien! I like the look on the video page, even without the screenshot of th videos. Nice tip!
I guess this way would bring to fore the IE Quirk (Click Here To Activate Component......). All this needs to be done through swfobjects route to avoid that.

IE quirk is primarily due to M$ losing out on a patent battle.
Here's one example done thru custom functions and swfobjects and all video handling through ftp and it only appears on articles where it has to at fixed position just like Article Photo.

http://www.cinemawithoutborders.com/news...05-10.html

Cheers
thiennhien, i wish CUSTOM BLOCKS had the possibility of including custom functions. Then your issue of having smaller thumbnail sort of video displayed on category template would have been a cakewalk. As of now i guess there's no way out.
Reference URL's