Getting Attached to Video

November 10th, 2009

One of the areas I’ve been refining in this last round of work on MemoryMiner 2.0 is the way that video is displayed in the attachment viewer. Most consumer point-and-shoot cameras take video, so I often shoot short videos that don’t need editing and attach them to photos. One of my favorites is of my son sending a bowl of oatmeal off the edge of his high chair when he was a toddler.

At any rate, the video I had shot was 640 X 480 pixels, and thus when viewed in the MemoryMiner 1.x attachment viewer (which uses a WebView to display all attachments) would have scrollers:

In order to see the playback controls you’d have to scroll. Ugly.

In 2.0 I wanted to fix this, so at first I thought I’d use a QTMovieView, thinking I could have better control over sizing and scaling. This turned out to be a bad solution for two reasons. First is that the video is scaled up in size as the view is resized: chunky ugly video sucks. Secondly, the playback controls aren’t nearly as slick looking as in the QuickTime web browser plugin. Have a look here:

Since I was already using a WebView to display all attachments (because I’m lazy, and for the most part the WebView does a spectacular job of doing the right thing) I thought maybe I could make the HTML to display the video smarter. After some help from Schmichael Padullah (name changed to protect the guilty) I learned about the magic of the max-width/max-height CSS attribute. I created this HTML test:

<html>
<body style=”background-color: rgb(38,38,38);”>
<video controls=”" autoplay=”"
style=”margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
max-width:90%; max-height:90%;” name=”media” src=”file:///Users/johnfox/Movies/PieOatmeal.mov”>
</body>
</html>

Works like a champ! So now, for video attachments I programmatically create an HTML string using NSString stringWithFormat so I can set the max-width, max-height and src values then load that into the WebView. The result?

It’s About Time!

November 3rd, 2009

It’s been so long since I last posted, I’m truly embarrassed. However, it’s not without reason. I’ve been so heads down with getting MemoryMiner 2.0 ready for sale, that I’ve simply been ignoring the blog.

Since MemoryMiner is very very nearly ready to ship (Fabio, you’re going to have that beautiful new web site ready for me, right?) I thought it would be nice to add another sneak preview, which is the totally revamped time slider. The time slider in the current 1.x version of MemoryMiner only allows you to search with a resolution of one month:

MM 1.x date range slider

The biggest problem with this time slider is that it doesn’t change resolution as the date range does (i.e. you want to see months and days for a time span of just a few months, or decades and years for a longer time span). Further, at a certain point, you can’t cram in all the markers on a traditional slider: the user never gets accurate results.

This is not an easy problem to solve, but I think I’ve come up with a pretty elegant solution. Behold the new multi-resolution time slider, shown here measuring in decades and years:

MM 2.0 Decades/Years Date range slider

…shown here, measuring in years and months:

MM 2.0 Years/Months Date range slider

…and shown here, measuring in months and days:

MM 2.0 Years/Months Date range slider

It took a tremendous effort to get this all working correctly, and there’s a still a bit graphical tweaking to do, but it’s a world of improvement over the prior solution.

I have tons of ideas for new things to do with timelines, but first I have to ship 2.0, so back to the time machine (I mean coal mine).

PS Another excuse for the lack of blog posts is that I’ve been podcasting regularly on the Mac Developer Network (http://www.mac-developer-network.com/category/shows/). I even did two video podcasts, one of which can be seen here: http://www.pixelcorps.tv/mbkd_031