Live data from Hacker News

iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

docs.google.com

61–70 of 121 posts

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#61
Regarding the retina loupe effect demo this has been done a while back - using css and an image for the loupe edge. Picks up mouse and touch events. Even works on older browsers.

http://homepage.ntlworld.com/infinnerty/differences/attic/at...

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#62

Nice to see they're getting bit by their own decisions. They've gone out of their way to ensure that you can't ever play an Audio/Video clip automatically on page load in iOS Safari. Every new iOS release for the first few years included a patch to kill any new workarounds that let you do so. (Curse you iOS 4.3 for taking away our simulated clicks.) But now they have a use case of their own that needs it, so they inv…

How do you know they feel they're getting 'bit'? Maybe they think this is the optimal solution for what they are trying to accomplish? Maybe they have an internal tool for generating the images they need to accomplish these things? Maybe it's "smooth as butter", as they would say, on their side?

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#63
post #26

Earlier quoted context omitted.

Yeah it's weird. My web developer side is impressed by the technical detail that go behind it. But my other web developer side asks why the f*ck should achieving a simple video effect on a web page should be this hard in 2012? There is a whole pattern of similar things like this in web that is killing me a little bit every day. Want to center a div on the page? No worries just wrap it in these 5 divs and apply these…

Android's XML layouts feel a lot like a non-braindead web. There are a lot of similarities really, but simple things like vertically centering an element are as easy as they should be. Text scaling can be a PITA though.

Same with XAML/WPF on Windows platforms which is very refreshing if you've been building for the web for years.

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#64
post #62

Nice to see they're getting bit by their own decisions. They've gone out of their way to ensure that you can't ever play an Audio/Video clip automatically on page load in iOS Safari. Every new iOS release for the first few years included a patch to kill any new workarounds that let you do so. (Curse you iOS 4.3 for taking away our simulated clicks.) But now they have a use case of their own that needs it, so they inv…

How do you know they feel they're getting 'bit'? Maybe they think this is the optimal solution for what they are trying to accomplish? Maybe they have an internal tool for generating the images they need to accomplish these things? Maybe it's "smooth as butter", as they would say, on their side?

There's a reason that we have video codecs like mpeg and h264 instead of using mjpeg for everything; the compression is much better. In that sense, a stream of jpegs is far from optimal, even if it's smooth as butter on a fast connection.

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#65
post #6

I'm not sure if I should be impressed by this. From a technical standpoint, it seems quite clever and unique, but it also seems like a lot of work just to avoid using a tag.

Anybody knows, why can't we use GIF instead?

You probably could, but given that GIF files are limited to a 256-colour palette, it would probably look pretty horrible. Especially for such a large image.

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#66
post #32
post #26

Earlier quoted context omitted.

Yeah it's weird. My web developer side is impressed by the technical detail that go behind it. But my other web developer side asks why the f*ck should achieving a simple video effect on a web page should be this hard in 2012? There is a whole pattern of similar things like this in web that is killing me a little bit every day. Want to center a div on the page? No worries just wrap it in these 5 divs and apply these…

What's difficult about centering a box? Was that just sarcasm? A couple of approaches: Margin Auto w/ a fixed width Absolute 50% w/ negative margins Text-align center parent w/ inline-block display on children If it was sarcasm, disregard my stupidity.

I think I am waiting for simple vertical alignment since CSS1.

It's like variables (yeah I know, LESS / SASS ...).

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#67

Earlier quoted context omitted.

> Apple's JS disables the animation for iOS 4.x and below, so maybe that's why it wasn't playing on your friend's iPod. I see Apple is really embracing the idea of "the one web" here, introducing web-fragmentation even among their own devices. Apple has long stopped impressing me. Back in the days when they were the clear underdogs, they were for web-standards and a unified web, because they saw how that was good, an…

There's nothing non-standards compliant about what they've done, as far as I can tell. Disabling the animation seems like an attempt at ensuring graceful degradation.

Graceful degradation shouldn't be based on user agent sniffing. That defeats the purpose.

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#68
post #40

Speaking of Apple website updates, I am surprised that they have never offered a responsive design for their apple.com site where you buy iPhones and iPads. Every app they make is designed differently for the phone or the iPad, but not the website.

They may not have a responsive site because they want to "show off" that the iPad and iPhone browsers are powerful enough to display fancy full-size sites, along with encouraging first-time users to pinch or double tap to zoom.

The navigation looks terrible on an iPhone. It's a remarkably bad design for mobile.

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#69
This idea is also in use at http://www.sublimetext.com/ The demo is using this technique because streaming video would actually take more bandwidth in this case as only bits of the image are actually changing at one time/incremental changes. It works a treat!

Re: iPhone 5 web teardown: How Apple compresses video using JPEG, JSON, and canvas

#70

> Apple's website needs to work on all major browsers That doesn't seem true. The second-most-prominent links on the iPhone and iPad sites are to videos that only play in Quicktime. If they wanted the site to work everywhere, they'd use a format those browsers can natively play.

Apple uses a bog standard -tag with a h.264 encoded video as its source. Every browser that can play that video (Internet Explorer, Chrome, Safari) will be able to play that video. If your browser can’t (Firefox), then it won’t be able to play that video and Apple is so nice and offers a sensible fallback.

QuickTime is never required.

Post reply on HN