blog

Archive

Posts Tagged ‘Video’
site-map
tools

New WordPress Plugin: Youtube Feeder

September 9th, 2010
partner
1 comment

Inspired by my most recent post about embedding a Youtube feed with a shortcode, some features I wanted to add to it, and a certain amount of interest in expanding it, I have written my second WordPress plugin.

It's interesting that today is almost exactly 1 year from the date I released my first wordpress plugin (which I'll hopefully be updating soon).


Here's what the plugin does:

Youtube Feeder allows you to embed a dynamic Youtube video feed anywhere in your WordPress blog. The feed is always up to date because it pulls directly from Youtube's data api, but it can also cache the Youtube feed based on configurable settings.

The plugin is very flexible because every aspect is configurable. Each video feed can be configured separately, or you can use defaults that take effect site-wide. Each component is given highly accessible classes for complete customization of the display through CSS.

Head on over to the Youtube Feeder project page for more details!

trademarks

WordPress: Embed Youtube Feed With a Simple Shortcode

August 13th, 2010news 35 comments

UPDATE: Looking for more functionality and an easier installation method?

Check out my WordPress plugin: Youtube Feeder

It's based on this code and has a LOT more features


WordPress shortcodes are great. They let you perform complex operations or display dynamic content with just a tiny bit of text in any page or post.

I recently needed a way to embed the most recent videos from a Youtube channel (very dynamic information) in a WordPress page, so I decided to write a shortcode for it.

The code is actually pretty simple. Just add the following to your theme's functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function youtube_feed_shortcode($atts)
{
    // Defaults:
    extract(shortcode_atts(array(
            'user' => 'flamadiddle86', // youtube user
            'limit' => 5, // maximum number of videos
            'height' => 385, // video height
            'width' => 480 // video width
        ), $atts));
    $data = @json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/'.$user.'/uploads?alt=json'), TRUE);
    $counter = 0;
    $content = '<div class="youtubefeed">';
    foreach($data['feed']['entry'] as $vid)
    {
        $url = $vid['media$group']['media$content'][0]['url'];
        $title = $vid['title']['$t'];
        $ycontent = $vid['content']['$t'];
        $content.= '<object width="'.$width.'" height="'.$height.'">'.
            '<param name="movie" value="'.$url.'"></param>'.
            '<param name="allowFullScreen" value="true"></param>'.
            '<param name="allowscriptaccess" value="always"></param>'.
            '<embed src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$width.'" height="'.$height.'"></embed></object>'.
            '<div class="youtubetitle">'.$title.'</div>'.
            '<div class="youtubecontent">'.$ycontent.'</div>'."\n";
        $counter++;
        if($counter == $limit)
        {
            break;
        }
    }
    $content .= '</div>';
    return $content;
}

add_shortcode('youtubefeed', 'youtube_feed_shortcode');

And it couldn't be easier to use. The videos you see below were embedded simply by putting this code in the post:

1
[youtubefeed]

Read more...

marketing
privacy

PHP and FFMPEG - Performing intelligent video conversion

October 5th, 2009jobs 9 comments

Whenever I have limited experience with something or just need to do some research, I go straight to StackOverflow.com - a computer programming question and answer site.  Out of the 24 questions I've asked on the site, only one has gone unanswered to date, and I've gleaned countless other answers from questions others have already asked.  In case you haven't already guessed, I really like the site.

Not long ago, I needed to convert uploaded video files for a project in PHP.  FFMPEG was a clear and obvious choice for the job, but I had never used it before, so I turned to my favorite resource.  Sure enough, I got enough information in the answers to build a fully working solution.  I posted that solution as an answer to my own question in case anyone else could use it.

Unfortunately, StackOverflow seems to be having trouble displaying my answer, so I've reposted it here for anyone who needs it.

Read more...

content
site-map