<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Web development, starting up, life on the sunny island of Singapore and other geek stuff.</description><title>Spooningfork</title><generator>Tumblr (3.0; @spooningfork)</generator><link>http://blog.spooningfork.com/</link><item><title>HTTP Live Streaming in iOS using AVPlayer</title><description>&lt;p&gt;I&amp;rsquo;ve become very &lt;em&gt;intimate&lt;/em&gt; with my video player class recently and we&amp;rsquo;ve been &lt;em&gt;spending lots of quality time together&lt;/em&gt;, in fact just last week I &lt;em&gt;rewrote&lt;/em&gt; large parts of her.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;She is built on the &lt;/span&gt;&lt;a href="https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html"&gt;AVPlayer Class&lt;/a&gt; and i&lt;span&gt;t&amp;rsquo;s probably just me, but there were a couple things about this class that was just a bit unclear. Here are some things that I found out that might help someone else:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;How do you determine which stream is currently being played by the player? &lt;/strong&gt;avplayer.currentItem.accessLog.events.lastObject.URI (can&amp;rsquo;t believe I couldn&amp;rsquo;t find this out had to read the documentation 3 times before figuring this one out, we actually resorting to burning the stream names into the video files itself to test)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What is the bitrate / bandwidth that the player is seeing / using / reporting / observing? &lt;/strong&gt;avplayer.currentItem.accessLog.events.lastObject.observedBitrate (AVAssetTrack.estimatedDataRate lead me on a wild goose chase&amp;hellip;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What are the rules for switching between streams? &lt;/strong&gt;avplayer.currentItem.accessLog.events.lastObject.indicatedBitrate will be the bitrate that you define in your playlist which is paired with each stream. So what I have observed (this was done purely by using &lt;a href="http://stackoverflow.com/questions/11699805/where-is-network-link-conditioner-prefpane-in-osx-mountain-lion-and-xcode-4-4"&gt;Network Link Conditioner&lt;/a&gt; to modify my network bandwidth and see which stream was played, not at all scientific) the player will play the default stream (first stream in playlist) and will start observing the bitrate. Once the observed bitrate increases to twice of the next stream&amp;rsquo;s indicated bitrate, it will switch to that next stream and will remain there until it drops below that indicated bitrate or if it becomes twice the next one, it will switch up again.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;This meant a couple of things:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Chose your indicatedBitrate carefully.&lt;/strong&gt; Let&amp;rsquo;s assume the Network Link Conditioner&amp;rsquo;s profiles are correct and that for an average 3G connection the bandwidth is 780kbps, from what I observed the player only really gets 680kpbs so if your stream was indicated as 380kpbs, there is a high chance that someone on an average 3G connection will never be able to play it despite getting as high as 680kbps (will need 760kbps observedbitrate to switch up). So take note of the different network conditions like Edge, 3G and LTE and encode accordingly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Have more streams to cater to lower bandwidth connections rather that having them equally spaced out. &lt;/strong&gt;With more people getting cable network speeds, having more streams above 500kpbs doesn&amp;rsquo;t seem to make a difference visually on the device (airplay is another story). Once users go on Wifi, they can get 2Mbps which would give them really good quality video. The devices that really benefit from HLS are those with low bandwidth and lossy connection. This is where HLS really shines. So have more streams to cater for Edge to 3G instead of 3G to Wifi.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Hopefully this discovery will lead to better quality videos for our users. They are a &lt;em&gt;lovely&lt;/em&gt; bunch&amp;hellip;&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/44787139787</link><guid>http://blog.spooningfork.com/post/44787139787</guid><pubDate>Thu, 07 Mar 2013 23:50:47 +0800</pubDate></item><item><title>"If you’re an unreasonable person, trust me: the time it takes to find the best of something is..."</title><description>“If you’re an unreasonable person, trust me: the time it takes to find the best of something is completely worth it. It’s better to have a few fantastic things designed for you than to have many untrustworthy things poorly designed to please everyone.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://dcurt.is/the-best"&gt;The Best | Dustin Curtis&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/35328989816</link><guid>http://blog.spooningfork.com/post/35328989816</guid><pubDate>Fri, 09 Nov 2012 16:21:03 +0800</pubDate></item><item><title>"Don’t build an app based on your website. Build the app that acts as if websites never existed in..."</title><description>“Don’t build an app based on your website. Build the app that acts as if websites never existed in the first place. Build the app for the person who has never used a desktop computer. Because they’re coming. Soon.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://massivegreatness.com/mobile"&gt;My Product Feedback | massive greatness by MG Siegler&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/32267202744</link><guid>http://blog.spooningfork.com/post/32267202744</guid><pubDate>Wed, 26 Sep 2012 00:24:57 +0800</pubDate></item><item><title>"Eventually Apple will just make phones out of unicorn horn and the dewy moisture that collects..."</title><description>“Eventually Apple will just make phones out of unicorn horn and the dewy moisture that collects between Scarlett Johansson’s breasts when she does hot yoga. (Technically, any yoga done by Scarlett Johansson is “hot yoga” but I’m specifically talking about Bikram in this case.) The white one will feature the same moisture collected from Michael Fassbender.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.feedly.com/home#subscription/feed/http://verynicewebsite.net/feed/"&gt;f | verynicewebsite.net&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/32055352686</link><guid>http://blog.spooningfork.com/post/32055352686</guid><pubDate>Sun, 23 Sep 2012 00:23:52 +0800</pubDate></item><item><title>Responsive Measure: A jQuery plugin for responsive typography</title><description>&lt;a href="http://jbrewer.github.com/Responsive-Measure/"&gt;Responsive Measure: A jQuery plugin for responsive typography&lt;/a&gt;: &lt;p&gt;Pretty awesome.&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/32054525873</link><guid>http://blog.spooningfork.com/post/32054525873</guid><pubDate>Sun, 23 Sep 2012 00:10:16 +0800</pubDate><category>design</category></item><item><title>The iPhone 5 (Parody): A Taller Change Than Expected (by Satire)</title><description>&lt;iframe width="400" height="225"  id="youtube_iframe" src="https://www.youtube.com/embed/XNBP18nrRdw?feature=oembed&amp;enablejsapi=1&amp;origin=http://safe.txmblr.com&amp;wmode=opaque" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The iPhone 5 (Parody): A Taller Change Than Expected (by &lt;a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=XNBP18nrRdw"&gt;Satire&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/32054054510</link><guid>http://blog.spooningfork.com/post/32054054510</guid><pubDate>Sun, 23 Sep 2012 00:02:17 +0800</pubDate><category>funny</category></item><item><title>(via xkcd: Refrigerator)</title><description>&lt;img src="http://41.media.tumblr.com/tumblr_mamuec86ZA1qz4jb0o1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;(via &lt;a href="http://xkcd.com/1109/"&gt;xkcd: Refrigerator&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/31909126390</link><guid>http://blog.spooningfork.com/post/31909126390</guid><pubDate>Thu, 20 Sep 2012 13:10:59 +0800</pubDate></item><item><title>(via WWF Legends Minimalist Poster ‘Ultimate...</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m8iwug4rCE1qz4jb0o1_75sq.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;(via &lt;a href="http://www.etsy.com/listing/99930466/wwf-legends-minimalist-poster-ultimate"&gt;WWF Legends Minimalist Poster ‘Ultimate Warrior’ by BAMitsBernie&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/29106265254</link><guid>http://blog.spooningfork.com/post/29106265254</guid><pubDate>Fri, 10 Aug 2012 13:06:16 +0800</pubDate></item><item><title>"Everything will be okay in the end. If it’s not okay, it’s not the end."</title><description>“Everything will be okay in the end. If it’s not okay, it’s not the end.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://ninjasandrobots.com/you-need-some-experience"&gt;I have no idea what I’m doing by Nathan Kontny&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/21917491233</link><guid>http://blog.spooningfork.com/post/21917491233</guid><pubDate>Sat, 28 Apr 2012 00:38:06 +0800</pubDate><category>motivation</category></item><item><title>"There are only two hard things in Computer Science: cache invalidation and naming things."</title><description>“There are only two hard things in Computer Science: cache invalidation and naming things.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://petdance.com/2012/04/the-worlds-two-worst-variable-names/"&gt;The world’s two worst variable names | Andy Lester&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/21437786358</link><guid>http://blog.spooningfork.com/post/21437786358</guid><pubDate>Fri, 20 Apr 2012 23:35:10 +0800</pubDate><category>programming</category></item><item><title>Exploded iPhone 4S Poster (via Tee Trilogy)</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m2nyknrxC81qz4jb0o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Exploded iPhone 4S Poster (via &lt;a href="http://www.teetrilogy.com/"&gt;Tee Trilogy&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/21315905869</link><guid>http://blog.spooningfork.com/post/21315905869</guid><pubDate>Wed, 18 Apr 2012 15:09:59 +0800</pubDate><category>iphone</category></item><item><title>"Maybe after a few dozen failures and months or years of hard work, you might just be that next..."</title><description>“Maybe after a few dozen failures and months or years of hard work, you might just be that next “overnight” success.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.fastcompany.com/1826976/the-dirty-little-secret-of-overnight-successes"&gt;The Dirty Little Secret Of Overnight Successes | Fast Company&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/20531336486</link><guid>http://blog.spooningfork.com/post/20531336486</guid><pubDate>Fri, 06 Apr 2012 00:21:15 +0800</pubDate><category>motivation</category></item><item><title>(via Medisana TargetScale | Uncrate)</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m1lpddwL9j1qz4jb0o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;(via &lt;a href="http://uncrate.com/stuff/medisana-targetscale/"&gt;Medisana TargetScale | Uncrate&lt;/a&gt;)&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/20063931640</link><guid>http://blog.spooningfork.com/post/20063931640</guid><pubDate>Wed, 28 Mar 2012 23:22:25 +0800</pubDate><category>health</category></item><item><title>"The Starter, the Architect, the Debugger and the Finisher, every software project that is remotely..."</title><description>“The Starter, the Architect, the Debugger and the Finisher, every software project that is remotely successful needs all four of these. If you can embody all of them in one person in the same project then all I can say is ‘lucky you’.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://jacquesmattheij.com/The%20Starter%20the%20Architect%20the%20Debugger%20and%20the%20Finisher"&gt;The Starter, the Architect, the Debugger and the Finisher | jacquesmattheij.com&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/19724369427</link><guid>http://blog.spooningfork.com/post/19724369427</guid><pubDate>Thu, 22 Mar 2012 15:22:09 +0800</pubDate></item><item><title>Photo</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m0jy6m6Dea1qzfya1o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://blog.spooningfork.com/post/19284132834</link><guid>http://blog.spooningfork.com/post/19284132834</guid><pubDate>Wed, 14 Mar 2012 16:57:46 +0800</pubDate></item><item><title>myidealhome:

pallet bed (via bodie and fou)
</title><description>&lt;img src="http://41.media.tumblr.com/tumblr_m0roddz8W21qb83abo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a class="tumblr_blog" href="http://myidealhome.tumblr.com/post/19174725474/pallet-bed-via-bodie-and-fou"&gt;myidealhome&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;&lt;li&gt;pallet bed (via &lt;a href="https://www.facebook.com/photo.php?fbid=10150613958871564&amp;set=a.89549861563.86398.58947531563&amp;type=1&amp;ref=nf"&gt;bodie and fou&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;</description><link>http://blog.spooningfork.com/post/19284115943</link><guid>http://blog.spooningfork.com/post/19284115943</guid><pubDate>Wed, 14 Mar 2012 16:56:39 +0800</pubDate></item><item><title>"Men start faltering and exhibit a decline in mental performance as soon as they anticipate..."</title><description>“Men start faltering and exhibit a decline in mental performance as soon as they anticipate interacting with women. Interestingly, though, women face no such problems.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://gizmodo.com/5892856/just-thinking-women-are-nearby-makes-men-dumber"&gt;Just Thinking Women Are Nearby Makes Men Dumber&lt;/a&gt;&lt;/em&gt;</description><link>http://blog.spooningfork.com/post/19283966567</link><guid>http://blog.spooningfork.com/post/19283966567</guid><pubDate>Wed, 14 Mar 2012 16:46:55 +0800</pubDate><category>science</category></item><item><title>Nice retro flip clock screensaver, goes well with an iMac</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m0knpxk1SY1qz4jb0o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Nice retro flip clock screensaver, goes well with an iMac&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/18949100585</link><guid>http://blog.spooningfork.com/post/18949100585</guid><pubDate>Thu, 08 Mar 2012 23:15:32 +0800</pubDate><category>geek</category></item><item><title>Toilet has no curtains…</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_ls48j6MKpc1qfc3mbo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Toilet has no curtains…&lt;/p&gt;</description><link>http://blog.spooningfork.com/post/18946008711</link><guid>http://blog.spooningfork.com/post/18946008711</guid><pubDate>Thu, 08 Mar 2012 20:55:28 +0800</pubDate></item><item><title>Cool shower!
micasaessucasa:

Axor Shower by Philippe Starck
</title><description>&lt;img src="http://40.media.tumblr.com/tumblr_m084jpYwdy1qzib5qo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Cool shower!&lt;/p&gt;
&lt;p&gt;&lt;a class="tumblr_blog" href="http://micasaessucasa.tumblr.com/post/18903988385/axor-shower-by-philippe-starck"&gt;micasaessucasa&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Axor Shower by Philippe Starck&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.spooningfork.com/post/18944606575</link><guid>http://blog.spooningfork.com/post/18944606575</guid><pubDate>Thu, 08 Mar 2012 19:37:32 +0800</pubDate><category>architecture</category></item></channel></rss>
