I’ve been meaning to put together a couple good tutorials for some of my friends. All I need is a good screencast utility. I’m finding that the ones I’ve tried so far produce varying results. The most recent of course made the output completely unintelligible as the resolution was so low you could even make out the text in large fonts. I’m starting to get very annoyed with the whole aspect. If anyone out there can recommend some good utilities, please go ahead and let me know.
Month: August 2011
Embed YouTube
A simple YouTube URL parser and embed code output script:
<?php function embed_youtube ($url) { // split up string $parts = array_merge(array(), array_filter(explode('/', $url))); // clean parts if(stripos($parts['1'], 'www') !== false) { $parts['1'] = substr($parts['1'], 4); } // parse link switch($parts[1]) { case 'youtu.be': $video = $parts[2]; break; case 'youtube.com': $raw = array_merge(array(), array_filter(explode('?', $parts[2]))); $qs = array_merge(array(), array_filter(explode('&', $raw[1]))); $qp = array(); foreach($qs as $value) { $qi = array_merge(array(), array_filter(explode('=', $value))); $qp[$qi[0]] = $qi[1]; } $video = $qp['v']; break; default: $video = FALSE; } // build embed string ?> http://www.youtube.com/embed/ <?php } ?>
Wrote this function as a favor to a friend. Now I’m releasing it to the world as public domain.