Aug 2010

NGMoviePlayer - AVFoundation-based video player

I put up on bitbucket NGMoviePlayer — it uses AVFoundation to play movies. It does some of what MPMoviePlayerControllerView does.

(I had to write a custom movie player because of a bug in iOS 4 where after you play a movie that’s embedded in a UIWebView, MPMoviePlayerController won’t work as expected: it plays just a few frames and then automatically pauses the movie. <radr://8326264>)

In writing this code I used a few things that were new to me: AVFoundation, blocks, and UIGestureRecognizer. (I got to do some learnin’, in other words.) (I still have to support older OSes with most of my code, and sometimes it takes a while before I get to use the cool new stuff.)

Side note: one of the interesting things about AVFoundation is that the headers say it will be available for Mac OS X 10.7.

Anyway... if this helps somebody out there at some point, then cool.

My personal VisiCalc moment

Every successful computing platform has to have a “VisiCalc moment” — the moment it goes from fun toy and technology demo to “holy crap this thing is useful.”

For the Apple II Plus that moment came the first time people saw VisiCalc. Imagine never having seen a spreadsheet on a computer — imagine always having done that stuff by hand. Then, for the first time, you enter some numbers and formulas into a computer and watch it calculate. Then edit some numbers and watch it recalculate. Pure magic. PFM.

I don’t think there’s a single VisiCalc moment that everyone will have for the iPad — but, for me personally, it was OmniFocus. That’s when my iPad went from toy to indispensable tool (oh, but still a fun toy, too).

Before OmniFocus, my iPad wandered around my desks without a real place. Now it has a place right next to my dev machine’s keyboard.

Flexibility and power

Whenever I think about new (or old) features in software, I think about whether they’re flexibility or power features.

They’re different things. Flexibility is the ability to change how software works; power is the ability to do more with less effort.

There’s a complicated relationship between the two things. Sometimes flexibility may add to power — if I could just make these things green, my eye could pick them out more easily, and I’d get my work done more quickly.

But flexibility detracts from power just as often — or more often. Flexibility is an invitation. It says, “Hey, futz with this. And this. And this. You’re not getting anything done, but at least you kind of have the illusion of doing something.”

One thing I love about iPhone and iPad apps is that they have to be designed for power. There’s just not enough conceptual canvas space for a ton of flexibility.

And I think people who use software — which includes you and me and everybody reading this — are learning to value power over flexibility. In part because of iOS apps, and in part because our attentions are further disintegrated and we have less time for each app.

How many more apps do you use now than you did five years ago? You used to get by with email and chat — then you added Twitter and Facebook. And an iPhone and screenfuls of more apps. And an iPad and more screenfuls.

You don’t spend your time skinning your audio player anymore, in other words. You just play music. And you do other things while the music’s playing.

It may go against the grain a little bit, but I’ll say it: I’m incredibly excited for the future of Mac software. I don’t expect we’ll make software that looks and feels like iOS apps (we shouldn’t), but I do expect we’ll learn from iOS apps how power is the real goal, and that flexibility is just a tool to use exceedingly sparingly, only when it substantially increases power.

RSTwitterCallGetXAuthAccessToken

I put up some sample code for getting an OAuth access token when calling https://api.twitter.com/oauth/access_token (for xAuth clients).

I was having trouble getting this working, so I wrote a one-.m-file, easy-to-debug class so I could make it work. It’s not meant to be used as-is, but it might be helpful to other folks writing apps that talk to Twitter.

Archive