<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Viddler Developers Lab</title>
	<atom:link href="http://lab.viddler.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://developers.viddler.com</link>
	<description>Testing tomorrow's video platform, today.</description>
	<pubDate>Tue, 03 Jun 2008 15:51:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Live redesigning Viddler&#8217;s Developer site</title>
		<link>http://developers.viddler.com/2008/06/03/developers-live-redesign/</link>
		<comments>http://developers.viddler.com/2008/06/03/developers-live-redesign/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 15:51:57 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[developers]]></category>

		<category><![CDATA[documentations]]></category>

		<category><![CDATA[redesign]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[wiki]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://developers.viddler.com/?p=23</guid>
		<description><![CDATA[Watch for falling rocks!  We&#8217;re sort of live updating the Viddler&#8217;s Developer site.
We&#8217;ve got a new template designed by Viddler&#8217;s Lead Designer Andrew Smith which will facilitate our needs not only for the Developer site but also for a few other sub-level domains we&#8217;ll be launching in the next few weeks.  Andrew provided me with [...]]]></description>
			<content:encoded><![CDATA[<p>Watch for falling rocks!  We&#8217;re sort of live updating <a href="http://developers.viddler.com/">the Viddler&#8217;s Developer site</a>.</p>
<p>We&#8217;ve got a new template designed by Viddler&#8217;s Lead Designer Andrew Smith which will facilitate our needs not only for the Developer site but also for a few other sub-level domains we&#8217;ll be launching in the next few weeks.  Andrew provided me with a style guide of sorts and so now I&#8217;m put to the task of getting both Wordpress and MediaWiki, the two applications we use to pull off this site, to bend to my will.</p>
<p>Everything should work ok, but will look a little wonky while I&#8217;m updating. If you have any concerns, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/06/03/developers-live-redesign/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The ViddlerPop! bookmarklet - beta 0.2</title>
		<link>http://developers.viddler.com/2008/05/29/viddlerpop-beta02/</link>
		<comments>http://developers.viddler.com/2008/05/29/viddlerpop-beta02/#comments</comments>
		<pubDate>Thu, 29 May 2008 10:46:40 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[bookmarklet]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[viddlerpop]]></category>

		<guid isPermaLink="false">http://developers.viddler.com/?p=22</guid>
		<description><![CDATA[The response from the first version of the bookmarklet has been pretty strong. It has now been updated a little, based on the comments we&#8217;ve received, and hopefully you&#8217;ll find it even more useful.
Changes in beta 0.2

Sharing via Twitter now works, even when logged out of Twitter.com.
Window is now resizable.

We still need to fix the [...]]]></description>
			<content:encoded><![CDATA[<p>The response from <a href="http://developers.viddler.com/2008/05/28/viddlerpop-beta01/">the first version</a> of the bookmarklet has been pretty strong. It has now been updated a little, based on the comments we&#8217;ve received, and hopefully you&#8217;ll find it even more useful.</p>
<h3>Changes in beta 0.2</h3>
<ul>
<li>Sharing via Twitter now works, even when logged out of Twitter.com.</li>
<li>Window is now resizable.</li>
</ul>
<div>We still need to fix the Firefox 3 RC1 issue <a href="http://developers.viddler.com/2008/05/28/viddlerpop-beta01/#comment-110">that Evan Sims pointed out</a>, as well as figure out how to make the bookmarklet work on pages where a Viddler video is embedded, and not just on Viddler.com.</div>
<div></div>
<div>Thanks for all of your feedback so far!</div>
<div></div>
<h3>To upgrade or install</h3>
<p>To update your bookmarklet, just delete the old one, and use this new one: <a href="javascript:viddlerPause();w=window.open('http://lab.viddler.com/services/popoutplayer/?url='+encodeURIComponent(location.href),'ViddlerPopOut','width=420,height=500,toolbar=no,location=no,status=no,resizeable=yes,scrollbars=no');(function(){setTimeout('w.focus()',1000);})();">ViddlerPop!</a></p>
<p>As always, if you have any questions, just ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/05/29/viddlerpop-beta02/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The ViddlerPop! bookmarklet - beta 0.1</title>
		<link>http://developers.viddler.com/2008/05/28/viddlerpop-beta01/</link>
		<comments>http://developers.viddler.com/2008/05/28/viddlerpop-beta01/#comments</comments>
		<pubDate>Wed, 28 May 2008 10:24:29 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[beta]]></category>

		<category><![CDATA[bookmarklet]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[viddlerpop]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://developers.viddler.com/?p=21</guid>
		<description><![CDATA[I like watching video in Viddler&#8217;s player.  All of my favorite podcasts are now using Viddler including WineLibrary TV, DiggNation, Two Guys on Beer, just to name a few.  But sometimes I don&#8217;t like keeping a browser tab open to watch these longer videos while I&#8217;m doing other things like surfing the Web, writing code, [...]]]></description>
			<content:encoded><![CDATA[<p>I like watching video in Viddler&#8217;s player.  All of my favorite podcasts are now using Viddler including <a href="http://viddler.com/winelibrarytv/">WineLibrary TV</a>, <a href="http://viddler.com/diggnation/">DiggNation</a>, <a href="http://viddler.com/tgob/">Two Guys on Beer</a>, just to name a few.  But sometimes I don&#8217;t like keeping a browser tab open to watch these longer videos while I&#8217;m doing other things like surfing the Web, writing code, or replying to the endless amounts of email I seem to get.</p>
<p>This is where ViddlerPop!, a new bookmarklet we&#8217;re playing with, comes in and saves the day.  Now instead of keeping a browser tab open dedicated to a Viddler video, I can watch this video in its own window.</p>
<p>Here is <a href="http://www.viddler.com/explore/cdevroe/videos/441/">a quick video demonstration</a> of how this first version works.</p>
<p><div id="viddlervideo-94276-15eb971d" class="viddlervideo"><p><a href="#viddlervideo-94276-15eb971d" onclick="loadViddlerVideo('94276','15eb971d','player',437,292);" title="Click to play this video."><img width="437" height="292" src="http://cdn-ll-15.viddler.com/e2/thumbnail_2_15eb971d.jpg" alt="Video thumbnail." /></a></p><p><a href="#viddlervideo-94276-15eb971d" onclick="loadViddlerVideo('94276','15eb971d','player',437,292);" return false;">Click to play this video.</a></p></div></p>
<p>Please leave us some feedback to let us know what you think of the bookmarklet, how you&#8217;d like it to improve, and if you find any bugs.  Thanks in advance!</p>
<h3>Installation</h3>
<p>To install <a href="javascript:viddlerPause();w=window.open('http://lab.viddler.com/services/popoutplayer/?url='+encodeURIComponent(location.href),'ViddlerPopOut','width=420,height=500,toolbar=no,location=no,status=no,resizeable=yes,scrollbars=no');(function(){setTimeout('w.focus()',1000);})();">ViddlerPop!</a> just drag the ViddlerPop! link to your browser&#8217;s bookmarks bar - or, right-click and &#8220;Add to bookmarks&#8221;. I believe in Firefox it is right-click and &#8220;Bookmark this Link&#8221;.</p>
<p>Questions?  Fire away!</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/05/28/viddlerpop-beta01/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where did the lab go?</title>
		<link>http://developers.viddler.com/2008/05/16/where-did-the-lab-go/</link>
		<comments>http://developers.viddler.com/2008/05/16/where-did-the-lab-go/#comments</comments>
		<pubDate>Fri, 16 May 2008 13:29:36 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[developers]]></category>

		<category><![CDATA[updates]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://developers.viddler.com/?p=20</guid>
		<description><![CDATA[In an effort to make developing on Viddler&#8217;s platform as easy as possible, we&#8217;ve moved the lab from lab.viddler.com to developers.viddler.com.  Everything should be forwarded now and we&#8217;ll be now setting up shop here.  The wiki is still available, but we&#8217;re going to be adding a whole new interface to our Developers area over the [...]]]></description>
			<content:encoded><![CDATA[<p>In an effort to make developing on Viddler&#8217;s platform as easy as possible, we&#8217;ve moved the lab from lab.viddler.com to developers.viddler.com.  Everything should be forwarded now and we&#8217;ll be now setting up shop here.  <a href="http://wiki.developers.viddler.com/">The wiki</a> is still available, but we&#8217;re going to be adding a whole new interface to <a href="http://developers.viddler.com/">our Developers area</a> over the next few weeks.</p>
<p>Please stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/05/16/where-did-the-lab-go/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Started With phpViddler, Part 3: Recording videos with a webcam</title>
		<link>http://developers.viddler.com/2008/04/22/phpviddler-part-3-recording-videos/</link>
		<comments>http://developers.viddler.com/2008/04/22/phpviddler-part-3-recording-videos/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 09:16:04 +0000</pubDate>
		<dc:creator>kyleslat</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[phpViddler]]></category>

		<category><![CDATA[recording]]></category>

		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=18</guid>
		<description><![CDATA[One of the great aspects of Viddler&#8217;s API is the ability to embed our webcam recorder right into your site.  With only a few lines of code, your users will be able to record video using any camera attached to their computer, and it&#8217;s automatically uploaded to Viddler and encoded.  Let&#8217;s dive right [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great aspects of Viddler&#8217;s API is the ability to embed our webcam recorder right into your site.  With only a few lines of code, your users will be able to record video using any camera attached to their computer, and it&#8217;s automatically uploaded to Viddler and encoded.  Let&#8217;s dive right in!</p>
<p>First off, if you haven&#8217;t checked out <a href="http://lab.viddler.com/2008/04/20/phpviddler-part-1-listing-video/">part one</a> and <a href="http://lab.viddler.com/2008/04/20/getting-started-with-phpviddler-part-2-user-authentication-and-sessions/">part two</a> of the phpViddler series, you&#8217;ll want to do that first, as some of that code will be necessary for recording.<br />
<span id="more-18"></span><br />
As explained on <a href="http://wiki.developers.viddler.com/index.php/Record_With_Webcam_API">the wiki page</a>, there are 2 steps to embedding the video recorder on your site:</p>
<ol>
<li>Get a record_token using either <a href="http://wiki.developers.viddler.com/index.php/Viddler.users.auth">Viddler.users.auth</a> with get_record_token set to &#8220;1&#8243; or <a href="http://wiki.developers.viddler.com/index.php/Viddler.videos.getRecordToken">Viddler.videos.getRecordToken</a>.</li>
<li>Use the returned record_token to embed the recorder on your site.</li>
</ol>
<h3>Getting A Record Token</h3>
<p>In order to embed the video recorder, you&#8217;ll need to pass a &#8220;record token,&#8221; which is a one-time use key that allows the user to record a video.  There are two ways to get the record token, so I&#8217;ll go through both.</p>
<h4>During User Authentication</h4>
<p>When you use the <code>user_authenticate()</code> function (<a href="http://lab.viddler.com/2008/04/20/getting-started-with-phpviddler-part-2-user-authentication-and-sessions/">covered in part 2</a>), you can pass a third parameter to return a record token, which is then returned along with the sessionid:</p>
<pre name="code" class="php">
&lt;?php
$sessionResponse = $viddler-&gt;user_authenticate(&#x27;user&#x27;, &#x27;password&#x27;, &#x27;1&#x27;);
$recordToken = $sessionResponse[&#x27;auth&#x27;][&#x27;record_token&#x27;];
?&gt;
</pre>
<h4>After Authentication</h4>
<p>If you already have a valid sessionID, but you haven&#8217;t yet generated a record token, you can use the <code>video_getrecordtoken()</code> method, which takes a sessionID as a parameter.  Here&#8217;s how you&#8217;d use it:</p>
<pre name="code" class="php">
&lt;?php
$recordToken = $viddler-&gt;video_getrecordtoken($sessionID);
?&gt;
</pre>
<p>Personally, I prefer grabbing the token during authentication, since it cuts down on the number of API calls I have to make, but it really depends on the situation.</p>
<p><strong>Note:</strong> While sessionIDs expire, as you no doubt learned in part two, record tokens <em>never expire</em> but can only be used once.  So if you generate a record token for the user when they login, you can keep this token until it is used for as long as you&#8217;d like.</p>
<h3>Embedding the Video Recorder</h3>
<p>Now that you have your record token, it&#8217;s time to embed the video recorder.  Thankfully, phpViddler makes it easy again with the <code>video_getRecordEmbed()</code> function.  To use it, just pass it a record token:</p>
<pre name="code" class="php">
&lt;?php
echo $viddler-&gt;video_getRecordEmbed($recordToken);
?&gt;
</pre>
<p>And with that, your users are ready to record videos right from your site!</p>
<h4>Knowing When Recording is Finished</h4>
<p>After your user successfully records a video, you&#8217;ll likely want to send them to a new page, or call some other action.  Luckily, the video recorder calls a javascript function, <code>recordDone()</code> when it&#8217;s finished.  To implement this, you&#8217;ll have to add something like the following to your record page:</p>
<pre name="code" class="javascript">
<script language="javascript">
function recordDone(username, user_video_number, video_id) {
  // Alert the user that recording is finished
  alert(&quot;Thanks &quot; + username + &quot;, you&#x27;ve recorded video #&quot; + user_video_number + &quot; with id &quot; + video_id);

  // Send user to new page
  top.location(&#x27;http://newpage.com&#x27;);
}
</script>
</pre>
<p>As you can see, <code>recordDone()</code> receives 3 arguments, which you can use however you&#8217;d like:</p>
<ul>
<li><strong>username</strong>: The user who recorded a video</li>
<li><strong>user_video_number</strong>: The number that appears in the video&#8217;s Viddler URL, e.g. http://www.viddler.com/explore/kyleslat/videos/24/</li>
<li><strong>video_id</strong>: The video&#8217;s unique ID, which can be used to embed the player.</li>
</ul>
<p>So, there you have it, with a few simple lines of code, users are now able to record video directly from your site!  Next up, we&#8217;ll be tackling uploading videos, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/22/phpviddler-part-3-recording-videos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>vAvatar: Easily embed Viddler avatars</title>
		<link>http://developers.viddler.com/2008/04/21/vavatar-easily-embed-viddler-avatars/</link>
		<comments>http://developers.viddler.com/2008/04/21/vavatar-easily-embed-viddler-avatars/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 19:33:30 +0000</pubDate>
		<dc:creator>kyleslat</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[avatar]]></category>

		<category><![CDATA[service]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=17</guid>
		<description><![CDATA[In order to make it easier for developers to include Viddler avatars in their applications, we&#8217;re introducing a simple service called &#8220;vAvatar&#8221;.  To include an avatar, just use an image tag like this:

&#60;img src="http://lab.viddler.com/services/avatar/USERNAME" /&#62;

Just replace &#8220;USERNAME&#8221; with the username whose avatar you want to display.  For example, here&#8217;s mine, using vAvatar:

Is there [...]]]></description>
			<content:encoded><![CDATA[<p>In order to make it easier for developers to include Viddler avatars in their applications, we&#8217;re introducing a simple service called &#8220;vAvatar&#8221;.  To include an avatar, just use an image tag like this:</p>
<pre name="code" class="html">
&lt;img src="http://lab.viddler.com/services/avatar/USERNAME" /&gt;
</pre>
<p>Just replace &#8220;USERNAME&#8221; with the username whose avatar you want to display.  For example, here&#8217;s mine, using vAvatar:</p>
<p><img src="http://lab.viddler.com/services/avatar/kyleslat" /></p>
<p>Is there anything else you&#8217;d like vAvatar to do?  Let us know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/21/vavatar-easily-embed-viddler-avatars/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting started with phpViddler Part 2: User authentication and sessions</title>
		<link>http://developers.viddler.com/2008/04/20/getting-started-with-phpviddler-part-2-user-authentication-and-sessions/</link>
		<comments>http://developers.viddler.com/2008/04/20/getting-started-with-phpviddler-part-2-user-authentication-and-sessions/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 22:49:38 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[phpViddler]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=16</guid>
		<description><![CDATA[If you haven&#8217;t already, please be sure to read part one that Kyle put together, which covers the simple task of initiating the phpViddler class and using it to list videos.  Some of the code found herein may not make sense if you haven&#8217;t read part one.
I think you&#8217;ll find, through these tutorials, that [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t already, please be sure to read part one that Kyle put together, which covers the simple task of <a href="http://lab.viddler.com/2008/04/20/phpviddler-part-1-listing-video/">initiating the phpViddler class and using it to list videos</a>.  Some of the code found herein may not make sense if you haven&#8217;t read part one.</p>
<p>I think you&#8217;ll find, through these tutorials, that using phpViddler makes it dead simple to use Viddler&#8217;s APIs.  Please leave feedback if you have any specific areas you&#8217;d like us to cover.</p>
<h3>Authenticating a user</h3>
<p>To authenticate a user you will need both the username and password of the user.  For this example, we&#8217;ll say the username is my username, <a href="http://www.viddler.com/explore/cdevroe/">cdevroe</a>, and the password will be a fake password of &#8216;password&#8217;.</p>
<p><span id="more-16"></span></p>
<p>There are a few important points to remember when authenticating a user using Viddler&#8217;s API, whether you use phpViddler or not.  Each time you authenticate a user you are giving a sessionID representing a &#8220;session&#8221; for <em>that username and password</em>.  If you are looking to log in a different user, you will need to re-authenticate the credentials to get another sessionID.</p>
<p>As we move forward with this series, you will learn more about where you use a sessionID to do things like changing meta data, uploading video, etcetera.</p>
<p>To start a new session, this is the code you will need to use once you have the username and password for the user.</p>
<pre name="code" class="php">
&lt;?php
// Authenticate the user, return array of response
$sessionResponse = $viddler->user_authenticate('cdevroe','password');
?&gt;</pre>
<p>By default, <a href="http://wiki.developers.viddler.com/index.php/Phpviddler">phpViddler</a> will return a multi-dimensional array of <a href="http://wiki.developers.viddler.com/index.php/Viddler.users.auth">the Viddler.users.auth</a> API method.</p>
<p><strong>Check for errors</strong> before you do anything.  Typical authentication errors are that the username does not exist (error code 101), or the password provided is incorrect (error code 103).</p>
<p>Once you&#8217;ve determined there are no errors, you can now put the sessionID into a variable for use later.  In our next parts, we&#8217;ll be using the sessionID in a number of ways.</p>
<pre name="code" class="php">
&lt;?php
// Store sessionID in variable.
$sessionID = $sessionResponse['auth']['sessionid'];
?&gt;</pre>
<h3>Notes about sessions</h3>
<p>SessionIDs expire after 15 minutes of inactivity.  You should build your application with this in mind.  For example, if you build an uploading tool, and the upload of a video file takes longer than 15 minutes, the session you are using to upload a video with will expire before your upload is finished.  Don&#8217;t panic!  All you need to do is ask for a new one and you&#8217;re all set.</p>
<p>(Super side note: If you come to a point in your code where you need a sessionID, you can quickly run any method that requires a sessionID to see if the session is still valid, if it isn&#8217;t, get a new one, and continue your code.)</p>
<p>In our next part, we&#8217;ll be covering the use of our Record with Webcam API and uploading video files.</p>
<p>If you have any questions about authenticating users, or sessions in general, feel free to ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/20/getting-started-with-phpviddler-part-2-user-authentication-and-sessions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Viddler.rb: A Ruby Wrapper For Viddler&#8217;s API</title>
		<link>http://developers.viddler.com/2008/04/20/viddler-rb/</link>
		<comments>http://developers.viddler.com/2008/04/20/viddler-rb/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 17:48:35 +0000</pubDate>
		<dc:creator>kyleslat</dc:creator>
		
		<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=15</guid>
		<description><![CDATA[Ilya Sabanin (friend: ilya) has released a Ruby wrapper for Viddler&#8217;s API.  He&#8217;s done a great job integrating all the existing API methods, so if you&#8217;re a Ruby developer, you&#8217;ll definitely want to check this out.  To start using Viddler.rb, just install the &#8220;viddler&#8221; gem:
$ gem install viddler
For more information, check out Viddler.rb&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Ilya Sabanin (friend: <a href="http://viddler.com/explore/ilya">ilya</a>) has released a Ruby wrapper for Viddler&#8217;s API.  He&#8217;s done a great job integrating all the existing API methods, so if you&#8217;re a Ruby developer, you&#8217;ll definitely want to check this out.  To start using Viddler.rb, just install the &#8220;viddler&#8221; gem:</p>
<pre>$ gem install viddler</pre>
<p>For more information, check out <a href="http://viddler.rubyforge.org/rdoc/">Viddler.rb&#8217;s documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/20/viddler-rb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Getting Started With phpViddler Part 1: Listing Videos</title>
		<link>http://developers.viddler.com/2008/04/20/phpviddler-part-1-listing-video/</link>
		<comments>http://developers.viddler.com/2008/04/20/phpviddler-part-1-listing-video/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 17:35:48 +0000</pubDate>
		<dc:creator>kyleslat</dc:creator>
		
		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[phpViddler]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[viddler]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=14</guid>
		<description><![CDATA[Over the next couple weeks, Colin and I are going to be guiding you through how to use Viddler's API with phpViddler, the PHP wrapper for our API functions.  We'll be covering everything from embedding videos to registering new users, so keep checking back!

Today, I'll be covering how to list videos using the Viddler API and phpViddler using the functions <code>videos_listbyuser</code>, <code>videos_listbytag</code>, and <code>videos_listfeatured</code>.
]]></description>
			<content:encoded><![CDATA[<p>Over the next couple weeks, Colin and I are going to be guiding you through how to use Viddler&#8217;s API with phpViddler, the PHP wrapper for our API functions.  We&#8217;ll be covering everything from embedding videos to registering new users, so keep checking back!</p>
<p>Today, I&#8217;ll be covering how to list videos using the Viddler API and phpViddler using the functions <code>videos_listbyuser</code>, <code>videos_listbytag</code>, and <code>videos_listfeatured</code>.<br />
<span id="more-14"></span></p>
<h3>Getting Set up</h3>
<p>To start using the Viddler API, you&#8217;ll need to get an API key, which you can get by filling out <a href="http://lab.viddler.com/getting-started/request-key/">this form</a>.  Once you&#8217;ve received your API key, go ahead and <a href="http://wiki.developers.viddler.com/index.php/Phpviddler">download phpViddler from our wiki</a>.  Now onto the actual code.  To get phpViddler going, you&#8217;re going to need to add the following to your script:</p>
<pre name="code" class="php">
&lt;?php
  include_once(&#x27;phpviddler.php&#x27;);

  $viddler = new Phpviddler();
  $viddler-&gt;apiKey = &#x27;YOUR API KEY&#x27;;
?&gt;
</pre>
<p>So what happened here?  We included the &#8216;phpviddler.php&#8217; file, which houses the Phpviddler class.  Next, we created a new instance of the <code>Phpviddler</code> class called <code>$viddler</code>, and then finally we set the API key for phpViddler to use.</p>
<h3>Getting A User&#8217;s Videos</h3>
<p>One of the first things you&#8217;ll likely want to do is get videos by a specific user.  To accomplish this, we&#8217;ll be using the <code>videos_listbyuser()</code> function, which calls the <a href="http://wiki.developers.viddler.com/index.php/Viddler.videos.getByUser">viddler.videos.getByUser API method</a>.  We&#8217;ll then want to display each video using <code>video_getEmbed()</code>.  Here&#8217;s the code:</p>
<pre name="code" class="php">
$videos = $viddler-&gt;videos_listbyuser(&#x27;username&#x27;);

foreach($videos[&#x27;video_list&#x27;][&#x27;video&#x27;] as $video) {
  echo $viddler-&gt;getEmbed($video[&#x27;id&#x27;]);
}
</pre>
<p>Replace &#8220;username&#8221; with the username you&#8217;re looking up, the above code will retrieve and display all of their videos.  First, let&#8217;s go over what each line does.</p>
<pre name="code" class="php">
$videos = $viddler-&gt;videos_listbyuser(&#x27;username&#x27;);
</pre>
<p>Here we&#8217;re just calling the <code>videos_listbyuser()</code> function and passing &#8220;username&#8221; as an argument.  If you look at the code for <code>videos_listbyuser()</code>, you&#8217;ll notice it actually takes 4 arguments: $user, $page, $per_page, and $sessionid.  We&#8217;ll ignore $sessionid for now, since we&#8217;ll be covering sessions in a later post.  $page and $per_page are used for limiting your results.  So, if you want to page through results and have 5 per page, you&#8217;d use the following call:</p>
<pre name="code" class="php">
$videos = $viddler-&gt;videos_listbyuser(&#x27;username&#x27;, 1, 5);
</pre>
<p>Just change $page to go to the next set of videos.  Now, onto handling what Phpviddler returns:</p>
<p>Whenever you make a call using phpViddler, you&#8217;ll get an array returned.  For instance, the above call, if you put in &#8220;winelibrarytv&#8221; for a user, you&#8217;ll get something like the following:</p>
<pre name="code" class="php">
Array
(
    [video_list attr] => Array
        (
            [total] => 456
        )

    [video_list] => Array
        (
            [video] => Array
                (
                    [0] => Array
                        (
                            [author] => winelibrarytv
                            [id] => c866e246
                            [title] => episode445
                            [length_seconds] => 860
                            [description] =>
                            [view_count] => 1452
                            [upload_time] => 1208384555000
                            [comment_count] => 0
                            [url] => http://www.viddler.com/explore/winelibrarytv/videos/522/
                            [thumbnail_url] => http://cdn-ll-46.viddler.com/e2/thumbnail_2_c866e246.jpg
                        )

                    [1] => Array
                        (
                            [author] => winelibrarytv
                            [id] => add5b980
                            [title] => episode444
                            [length_seconds] => 1090
                            [description] =>
                            [view_count] => 17216
                            [upload_time] => 1208288599000
                            [comment_count] => 0
                            [url] => http://www.viddler.com/explore/winelibrarytv/videos/520/
                            [thumbnail_url] => http://cdn-ll-80.viddler.com/e2/thumbnail_2_add5b980.jpg
                        )

                )

        )

)
</pre>
<p>So, to iterate through the videos, you just need to use a foreach loop with the $videos[&#8217;video_list&#8217;][&#8217;video&#8217;] array:</p>
<pre name="code" class="php">
foreach($videos[&#x27;video_list&#x27;][&#x27;video&#x27;] as $video) {
  echo $viddler-&gt;getEmbed($video[&#x27;id&#x27;]);
}
</pre>
<p>Passing the video id to $viddler-&gt;getEmbed() returns the proper embed code for the video.</p>
<h3>Other Video List Functions</h3>
<p>There are a couple other functions in phpViddler which behave similar to <code>videos_listbyuser()</code>: <code>videos_listbytag()</code> and <code>videos_listfeatured()</code>.</p>
<h4>videos_listbytag($tag, $page, $per_page)</h4>
<p>This function utilizes the <a href="http://wiki.developers.viddler.com/index.php/Viddler.videos.getByTag">Viddler.videos.getByTag API call</a> and can take 3 arguments, $tag, $page, and $per_page.  $tag refers to the tag you&#8217;re searching by, and $page and $per_page behave the same as before.  Here&#8217;s how you would use it to get all videos tagged with &#8220;metoday&#8221;:</p>
<pre name="code" class="php">
$videos = $viddler-&gt;videos_listbytag(&#x27;metoday&#x27;);  

foreach($videos[&#x27;video_list&#x27;][&#x27;video&#x27;] as $video) {
  echo $viddler-&gt;getEmbed($video[&#x27;id&#x27;]);
}
</pre>
<h4>videos_listfeatured()</h4>
<p>Using this function enables you to get all the videos featured on the <a href="http://blog.viddler.com">main Viddler Blog</a> and uses the <a href="http://wiki.developers.viddler.com/index.php/Viddler.videos.getFeatured">Viddler.videos.getFeatured API call</a>.  It doesn&#8217;t require any arguments, so you would just use it like this:</p>
<pre name="code" class="php">
$videos = $viddler-&gt;videos_listfeatured();

foreach($videos[&#x27;video_list&#x27;][&#x27;video&#x27;] as $video) {
  echo $viddler-&gt;getEmbed($video[&#x27;id&#x27;]);
}
</pre>
<h3>More to come</h3>
<p>And, with that, we&#8217;ve finished our look at how to list videos with phpViddler.  Over the next couple of weeks, we&#8217;ll be posting more tutorials, so make sure to <a href="http://lab.viddler.com/feed/">subscribe to our RSS feed</a> and keep checking back!  Also, if you ever have any questions, you can either leave a comment on the blog, or start a new thread in the <a href="http://www.viddler.com/groups/developers/">Developers group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/20/phpviddler-part-1-listing-video/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Viddler mambot for Joomla!</title>
		<link>http://developers.viddler.com/2008/04/16/viddler-mambot/</link>
		<comments>http://developers.viddler.com/2008/04/16/viddler-mambot/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 08:30:31 +0000</pubDate>
		<dc:creator>Colin Devroe</dc:creator>
		
		<category><![CDATA[3rd-party projects]]></category>

		<category><![CDATA[joomla]]></category>

		<category><![CDATA[mambot]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[viddler]]></category>

		<guid isPermaLink="false">http://lab.viddler.com/?p=13</guid>
		<description><![CDATA[A mambot is &#8220;a small, task-oriented function for Joomla! software&#8221;.  Viddler Antonio Edward (friend: labanex) has released a Viddler mambot that makes it easy to embed Viddler videos, using both the normal and simple player, on your Joomla! powered Web sites.
As it stands you have to do some digging into the HTML embed code to [...]]]></description>
			<content:encoded><![CDATA[<p>A mambot is &#8220;a small, task-oriented function for Joomla! software&#8221;.  Viddler Antonio Edward (friend: <a href="http://www.viddler.com/explore/labanex/">labanex</a>) has released <a href="http://wiki.developers.viddler.com/index.php/Joomla%21">a Viddler mambot</a> that makes it easy to embed Viddler videos, using both the normal and simple player, on your <a href="http://www.joomla.org/">Joomla!</a> powered Web sites.</p>
<p>As it stands you have to do some digging into the HTML embed code to get the values you need to make this plugin work, but perhaps someone with some Joomla! experience can help Antonio out by using <a href="http://wiki.developers.viddler.com/index.php/OEMBED">oEmbed</a> to make this process even easier?</p>
<p>It is a great first step for Joomla! users.  Thanks Antonio!</p>
]]></content:encoded>
			<wfw:commentRss>http://developers.viddler.com/2008/04/16/viddler-mambot/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
