Live data from Hacker News

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

docs.google.com

71–80 of 121 posts

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

#71

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!

Highly unlikely that a real video format would take more bandwidth if encoded properly. Video engineers have thought of this problem.

H.264 would emit "skip" macroblocks for everything except the area that was changing (probably near the cursor). The repetition of "skip" would be easily compressed.

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

#73
post #62

Earlier quoted context omitted.

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.

I wonder what they'll do when the much better h.265 comes out.

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

#75

Earlier quoted context omitted.

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.

Yeah I've dabbled just a bit with these and they seem like a nice way to build UIs, also making data binding a lot cleaner than on the web or in the various mobile SDKs.

Honestly I think Microsoft has the best developer toolkit in the business right now but they haven't yet had the product design prowess to put that technology in the consumer's hands in any significant numbers.

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

#76

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…

>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

Which sounds very wise from a user perspective.

Imagine every crappy web advertiser auto playing videos on page load on Mobile Safari. Yuck.

I don't want videos to auto-play on my Laptop, why would I want them on my phone?

>Curse you iOS 4.3 for taking away our simulated clicks

Simulated clicks? I rest my case...

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

#77
post #76

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…

> 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 Which sounds very wise from a user perspective. Imagine every crappy web advertiser auto playing videos on page load on Mobile Safari. Yuck. I don't want videos to auto-play on my Laptop, why would I want them on my phone? > Curse you iOS 4.3 for taking away our simulated clicks Simulated cl…

What do you do when that happens on your laptop? You close the page and move on. Why does it need to be any different on your mobile/tablet? I assume the battery cost of 2 seconds of video loading/playing once in a long time is negligible.

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

#78
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.

>Margin Auto w/ a fixed width Absolute 50% w/ negative margins Text-align center parent w/ inline-block display on children

Yes, totally intuitive and logical solutions all of them.

If you have w3c Stockholm syndrome, that is.

E.g "Just absolute 50% it with a negative margin" (oh, yes, and you would have to know the width beforehand).

>If it was sarcasm, disregard my stupidity.

It's not the stupidity, is the willingness to put up with BS convoluted inelegant workarounds for lack of basic, bread and butter, features.

If you value elegant APIs, KISS and DSLs, you should run screaming in the opposite direction in all those three, horrible, horrible, techniques.

W3C first came up with their (broken) model, and then they kludged solutions to use cases with it, instead of starting from the use cases first. That's why we have had the tables before and the need for the flexbox and grid layout now.

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

#79
post #76

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…

> 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 Which sounds very wise from a user perspective. Imagine every crappy web advertiser auto playing videos on page load on Mobile Safari. Yuck. I don't want videos to auto-play on my Laptop, why would I want them on my phone? > Curse you iOS 4.3 for taking away our simulated clicks Simulated cl…

>What do you do when that happens on your laptop? You close the page and move on.

No, I proactively install apps such as "Click to flash" and the like to make sure this DOES NOT happen on my laptop.

>Why does it need to be any different on your mobile/tablet? I assume the battery cost of 2 seconds of video loading/playing once in a long time is negligible.

Because I could be anywhere surfing with my mobile/tablet, in the dentist's office or even in a meeting. I don't want pages to jump at me with video I have not requested. Ever.

And I don't want web marketers to assume anything about the battery life cost of their actions on MY devices.

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

#80
post #65

Earlier quoted context omitted.

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.

Also you would end up having varying frame rates in different browsers.
Post reply on HN