HTML 5 video within iPhone image frame - iphone

I'm somewhat hesitant to ask this question because it it is only borderline software development, but I've had zero luck finding what I need anywhere else.
I am building a landing page for an iPhone app and would like to have a video of the app in use that plays inside an image frame of an actual iPhone device (Apple does this on many of their marketing pages). I don't care about the video being played on anything pre-HTML 5, it can be as simple as an mp4.
Are there any tools out there that will easily generate this sort of functionality for me? Given how often I see this sort of thing, I'm surprised that I am having so much trouble finding something that just =gives it to me out of the box.
Alternatively, I am not opposed to coding something myself, so if that's the only option, a suitable answer to this question would be a pointer to some info on the best way to generically overlay an HTML 5 video on top of an image (the iPhone frame).

The reason you probably don't find anything is probably because it's so simple. Put a <video> tag inside a <div> tag, set background-image of the frame, add some padding so the video is centered within the frame, and voila.

Related

HTML5 Video Pixel Tracking

I know that generally, it's no problem to overlay HTML (and even do advanced compositing operations) to HTML5 native video. I've seen cool tricks with keying out green screens in realtime, in the browser, for example.
What I haven't see yet, though, is something that tracks in-video content, perhaps at the pixel level, and modifies the composited overlay in accordance. Motion tracking, basically. A good example would be an augmented reality sort of app (though for simplicity's sake, let's say augmenting an overlay over on-demand video rather than live video).
Has anyone seen any projects like this, or even better, any frameworks for HTML5 video overlaying (other than transport controls)?
If we use the canvas tag to capture the instances of the video, we are able to get the pixel level information of the video. Then we can detect the motion tracking i think. May be the work of HTML5 will be upto grabing the pixel informaion, then its our work to detect the things we need..
And i didnt find any such frame works for HTML5 video tag, as there is no common video format supported by all browsers...
The canvas tag video mode is not supported by iOS.
Wirewax built an open API for that. Works quite well - even on Iphone.
http://www.wirewax.com/

How to create facebook wall posts and add retina version of picture

We're using the facebook graph API http://developers.facebook.com/docs/reference/api/post/ and adding the picture parameter. Our picture is a 30x30 pixel image, which is exactly the size we want for the facebook web version. However, the image will be pixelated when using the FB mobile app on an iPhone4 (retina display).
Is there any way to serve a 60x60 high resolution image, but render it always at 30x30 for facebook wall posts?
Well.. as of this moment, here is what I have found out, and offer a 'solution' that has worked for me based on the time i've had to test & play with this concept. For all the readers out there, who need a quick answer to the question, i don't have the exact solution to the question, but…. Essentially, your 30x30 image is being scaled to 90x90. The 60x60 image is being scaled to 90x90. And I can not find a way to go around this.
Below is what I have tried. Feel free to add input.
Take your feed image, and stroke a 2-5px black line around the frame of the image.
Load up your app, initiate a wall feed on the device. With the image present, take a screenshot. Mail yourself the image. Open it up in Photoshop (or photo editing program). Use a Marquee tool to outline the image. Cut it out of the screenshot and paste it as a new image. What size is it? 90x90, right? (and obviously 180x180 if image is retina)
Create a 90x 90 image. Copy your original 30x30 image and paste it anywhere you want within the new 90x90 images' frame. Upload it to the URL parameter's location. Re-run your app. By re-running it, i mean you have to shut it down completely, it appears as though the SDK is cacheing the image upon first launch of the feed and you can clear that cache by closing the app completely, and rerunning it. When you do, you will see significant improvements with the look of the image. It may not be a retina image, but it at least won't be 'fuzzy ugly'. At this point, it boils down to how nice of illustrative lines that where done in the design process to remove the aliasing effect produced from the conversion to a raster graphic. As well, i'm not sure if a variation of resampling method will produce even better results.
Some things i've tried:
I've also saved it as a png file with no transparency : 144ppi at 90 x 90 size. In other words, save your 90x90 image with a higher resolution (pixels per inch). Remember to not constrain proportions as you image resize. And note that If you are using adobe products, i.e. photoshop ) - don't save for web, just use 'save as…', as this will retain the ppi you specified. Although, i don't believe i see much of a difference in the quality which this is displayed going this route, and best to try to keep the file size down as this will increase the overall image size by about 500% or more.
I've tried variations of hosting the image twice the size (180x180) within the same hosted folder and naming it image#2x.png & image-large.png <--(just for the heck of it). This is not really solving the problem either.
Some other things I have not tried:
Monitoring your web server traffic, and any "not found" errors to a resource to see if FB is trying to access an a potential alternate resource when grabbing your image for display, the wall feed box that comes up is a webview. Meaning web graphics. (It's FB's web page…meaning their rules, and i doubt the pages' source is available to dabble with within the SDK.. so!…
Look at the HTML of the feed itself with safari browser:
The inspection of the HTML within the final resulting image that is posted on my FB wall I can see this….
<img class="img" src="http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=153675474666495&v=1&size=z&cksum=773bba91f6146b2463eed0a0bb77dc42&src=http%3A%2F%2Fwww.thumbwizards.com%2Fspeakinapps%2Fgraphics%2Fboxed%2Faussie.png" alt="">
I am wondering:
Within HTML5 isn't there a mechanism to provide a toolkit type of javascript to display retina graphics from a web page?
Would it be possible to have that code run when grabbing the url to the image (in meaning, the url of the image would be acting as a pointer to the code.? I haven't tried playing with this, since my logic tells me that per the url above that FB is essentially taking control over the image at this point. I have noticed (and not waited long enough to see) that the image is apparently cached and posting to the wall with a new image, sometimes results in the older image still being used. (and yes, i've cleared my browser cache)… perhaps simply cached in another location..
If there is another parameter for the image type, that is not published, I have not stumbled across any yet.
Can anyone figure out if through source of:
[http://platform.ak.fbcdn.net/www/app_full_proxy.php] if this php file is part of an available image processor out there we can access to view what could be done?
Can anyone mention an app that uses a retina graphic in their feed post?
Just thoughts really, I've decided to not really give a crop, and if
you've made it this far. Thanks for tuning in. ..So, Sulf, your 30x30 is being scaled to 90x90. making it UGLY!.
Good luck.. If you figure anything else out, let me know!
Mark
apple specify that if you want to add the retina effect for your ios app then the images you are using in this format -i.e
sampleImag.png- 57*57(size) , 163 (DPI)
sampleImag#2x.png - 114*114(size),326 (DPI) when you use these specific graphic images you will get your app is showing retina effect in iphone 4 and above generation.
Just point your code to a larger scaled image and Facebook will take care of the rest.

three20 TTTabBar performance?

I used TTTabBar in the Three20 library. It seems to be a good simulator. But its scroll speed is significantly slower in the device (iPhone 4).
All I did was just replacing few names in it. So I was curious if maybe I did something wrong. So I tried the sample project provided by the library. And it's slow too!
How to use it not slowly?
I think the TTTabBar is used in the 'USA TODAY' app. It almost looks the same, but it's not slow. There must be a way.
It can also depend on the content which you are going to load (meaning web content), images from the web service in to the scrollview.
Or maybe you have provided the animation to the component within the scrollview. Check it out.
If it is animation then give minimum animation time as the device can not respond fast to touch or gesture as in the simulator.
Is three20 Library free of cost? I have one for a PDF book to turn the pages like with gesture (how can we know that particular library is free of cost?).
Try to load all your content in the initWithNibName method. (e.g. Parse websites, load images)
That was the solution for me because the content is loaded when the app starts up.

Is there a View Controller to show thumbnails like the Photos app?

I am looking to replicate the image gallery view that shows thumbnails, like in the photos app on the iPhone.
Is there a view controller or any examples that anyone can provide to replicate this?
There isn't one provided by Apple. I would recommend looking at Three20. It has a few things with look a lot like the Photos app.
Another option is AQGridView.
Take a look at the video of Session 104 from the WWDC 2010. It's basically a 40 minute tutorial on how to do the photo app.
Bear in mind that allowing users to zoom will greatly increase the space required. If you use CATiledLayers, that is, which, depending on your desired zoom level, you should consider doing.
Oh, and there is source code ;)
What they don't tell you is how they did their tiling. I found that you can
a) download ready-made tiles from the server with the app or with a content update (you can use ImageMagick's crop tileWidthXtileHeight - e.g. crop 100x100 - to do the tiling). This has the disadvantage of large downloads.
b) download ready-made tiles from the server as needed (may lead to lags in your app, but then MKMapView does it quite nicely, doesn't it?)
c) tile on the phone as needed (here you can also consider caching the results, although that will likely mean you have to check space left on the device)
I've recently given enormego's PhotoViewer a try. It's easy to use, and it's much more focused than the Three20 project. (Which I also use and like a lot.)

iPhone/iPad draw pdf like iBooks?

Does anyone know how to use core graphics to draw a pdf like in iBooks. I can already draw a pdf page using core graphics but was curious how iBooks shows a lower quality view of each page so it loads fast and then when you stay on a page longer it renders it a full quality. This makes it able to open the pdf without having to make the user wait like most magazine apps you see on ipad. Any ideas would help!
Apple have some "ZoomingPDFViewer" sample code:
http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281
I suspect that might give you some good ideas :-)
I assume they use multiple layers, the first layer loads the pdf in low resolution and the better resolution is prepared in the background. When ready these layers are swapped.
Have a look at CGPDFDocumentRef and CATiledLayer in the documentation.