Simbul / baker

The HTML5 ebook framework to publish interactive books & magazines on iPad & iPhone using simply open web standards
http://bakerframework.com
1.53k stars 378 forks source link

White flash #164

Closed yumyo closed 12 years ago

yumyo commented 13 years ago

The (new) two rendering modes "screenshot" and "three-cards" are simply great! However we are experiencing a white flashing effect for every page while in "screenshot" mode and minor rendering problems in "three-cards" mode (white flashes and small reloading-like bugs).

folletto commented 13 years ago

Unfortunately it's a bug in WebKit and we are still not able to remove it completely. We saw that sometimes building the page differently, or making them shorter, helps reducing that bug.

We are constantly trying to fix that.

yumyo commented 13 years ago

Thanks Fol. I don't know if this helps but we are working with the same bounce of files (html, css, js) in both the stable Baker 2.0 and the latest 'nightbuild'. Inside the stable versione the above bugs are mainly absent (especially the white flash) Please let us know if we could perform some additional testing for you guys. We'll do it anyway ; )

yumyo commented 13 years ago

... as far as we understand those bugs are related to the UIWEBVIEW at preloading stage. We just performed the same test (first comment) with the build 85-g93fe8b4 but inside the brand new iOS5. Everything is smoother and the white flash occurred just on the heavier content after a non-sequential flip through the pages. No doubt iOS5 introduced a lot of improvements but keep investigating the preloading matter still seem the way to gain a stable and robust environment. We hope to be able to contribute soon since we're (finally) starting a custom development project. In the meanwhile we don't want to loose the chance to say again: thank you guys for this great piece of work.

folletto commented 13 years ago

Thank you! :)

Yes, if the problem is diminished with the update it's another sign that it should be a UIWebView issue, ach. :|

Unfortunately we tried to identify the moment when the page is really ready, but it seems there's no easy way... :|

yumyo commented 13 years ago

We tried to optimize our book as far as it was possible, and after a more detailed test we found:

palianah commented 12 years ago

Paste this two lines in the (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:

[webView setOpaque:NO];
webView.backgroundColor = [UIColor clearColor];

I don't know if this is a valid form, but the white flash didn't appear. I am no objective-c programmer, so please understand if this is a bad variant:)

I read this at: http://stackoverflow.com/questions/1547102/cant-change-background-for-uiwebview-in-iphone-sdk

folletto commented 12 years ago

That's a good suggestion, we'll try it. :)

palianah commented 12 years ago

ok :)

yumyo commented 12 years ago

Just tried inserting the above code after the request:

pragma mark - WEBVIEW

Don't know if if is correct. No errors compiling. White flash still present.

casfian commented 12 years ago

First, I got "no rule to process file warning..." for the two .js files but managed to solve it using this tip http://www.nimblekit.com/wiki/index.php/Warning:_no_rule_to_process_file

Now I still can't see my ebook with the new xcode 4.2. Any suggestions?

folletto commented 12 years ago

I don't understand. How is that related to the white flash issue described here? Could you detail a little more?

casfian commented 12 years ago

I think I posted wrongly...I should have posted in bugs report. I can't seem to get baker to work in Xcode 4.2. I downloaded it from bakerframework.com Now I'm trying to get the latest built from Github...

folletto commented 12 years ago

Yes please. Open a new issue. I'd advise if you have problems to use the version from the website and not the work in progress from here. :)

casfian commented 12 years ago

Yeap! Now it's working from Github. Maybe you should upload the fixed baker download to bakerframework.com

folletto commented 12 years ago

You are the first one reporting a problem with the stable version. Please open a new issue if you'd like with all the details of the problem you had so we can rule out it was just a problem in your config, since from the message above it seems you are touching the project config, and that might have broken something.

Please be also aware that the master version is a development one, an might contain bugs.

adilfazal commented 12 years ago

Any luck solving this issue yet?

folletto commented 12 years ago

Nope, sorry.

adilfazal commented 12 years ago

I am having issue at iOS 4.3. It seems fine in iOS 5.0. Please let me know if you any work around in mind.

ayarmanqu commented 12 years ago

Hi Folleto,

I just want to add that my book experiences the white flash issue frequently in OS5 with an iPad 2. It comes and goes. Sometimes only the last page of the book does it and the first pages are fine.

If you want to test my book, let me know and I'll place a download link.

Thanks!

folletto commented 12 years ago

Yup having something else to test would be nice, send it to us at our info mail so we can check it. :)

ayarmanqu commented 12 years ago

There is a free version of the book with no extras, here: http://itunes.apple.com/us/app/pookie-tushka-find-little/id487112926?mt=8

I'll generate a code for the full version and send it via email.

Thank you!

Jorge

folletto commented 12 years ago

Oh no worries then, because we'd need the book itself to test in a development environment, so we can't do it on a published version and we can't ask you to provide even a split of your published book. :)

ayarmanqu commented 12 years ago

Oh, and ... please consider my book for Showcase :)

folletto commented 12 years ago

That's for sure, we are just a little behind with that because I moved and I was without internet for a month now, and my iPad was stolen as well... yeah, not exactly a good period, but now we are planning a meeting for christmas to give the project a little further push. ;)

ayarmanqu commented 12 years ago

Thanks ;)

Please, let us know if the white flash is corrected. I think that is the only thing that makes it obvious that my book is not a "full" Xcode App :(

(and sorry to hear about the stolen iPad)

folletto commented 12 years ago

Thank you. :)

zenz commented 12 years ago

@folletto, so sorry to hear about the stolen iPad. I hate thief!

nruffilo commented 12 years ago

Ok, I'm having this issue for both iOS 4.3 and 5.0. I have heavy CSS animations, a voice over, and lots of images for page sizes around 1-5megs. Ultimately the flash is VERY quick, but noticeable and I need to fix it for a current project.

I haven't tried messing with the baker code yet (I will try that later this weekend) but I noticed that three-card loading did not produce this issue. The only problem is, page load is what starts the animations & voice over. Is there any way to know when the page is visible so that I can queue up the animations & voice over to play when the page is visible and not loaded with three-card?

Any tips on how to solve this problem would be greatly appreciated, as I want to have it solved by tomorrow.

nruffilo commented 12 years ago

I SOLVED THE PROBLEM.... And this is my first attempt with Objective C :)

In RootViewController.m:

- (void)setupWebView:(UIWebView *)webView {
    NSLog(@"• Setup webView");

    webView.delegate = self;

    webView.backgroundColor = [UIColor clearColor];
    webView.opaque = NO;

There is still a tiny flicker if your screenshot doesn't match up with your content, but worked BEAUTIFULLY with pre-rendered screenshots on my iPad 2 (iOS 5) and simulator worked well as well...

inventionarts commented 12 years ago

Chiming in here that my colleague Nick's fix worked like a charm. Rock solid performance, zero flashing. We're building a book with numerous full screen animations, games and activities, and lots of audio. Will let you all know when it's up.

Ron aerbook.com

folletto commented 12 years ago

Uhm then we definitely need more tests, because this fix was proposed in november (see above) and some testers reported it didn't work.

For information, what is the background color of the book (-baker-background)?

nruffilo commented 12 years ago

I'm using clear for the color - the book has many different background colors for different pages. The issue was that, from what I see, the code was implemented in the wrong place. I did find the "Fix" code in the baker framework, but when I placed it elsewhere (see my post with fix) it worked. It works on 4.3 and 5.0. But please, test away.

folletto commented 12 years ago

A-ha! That's a great point @nruffilo! We'll look into it this evening. :)

nruffilo commented 12 years ago

BTW - great job with the framework. Really made making an ebook easy. Not knowing objective C and having less than 1 month to build this ebook app, being able to do it all in HTML/css/javascript was amazing!

folletto commented 12 years ago

Thanks! That's why we started this project, and receiving these comments gives us a great morale boost. :)

Xm4s commented 12 years ago

Thank you for your solution, it actually seems to work pretty well :) The problem is that with this solution there's a problem with the page screenshots.

As soon as everything is fixed I'll commit everything up ;)

nruffilo commented 12 years ago

Screenshots worked fine for me with 3.1...

Nick

folletto commented 12 years ago

@Xm4s worked on it, but from what I got it's due to some edge behaviour when the page is scrolled in a combination with existing backgrounds. He has already a solution in mind, but unfortunately we didn't have time yet to test it tonight.

ghost commented 12 years ago

Faced with the same issue. After first download and install, it all worked well with no flashes. Then I changed -baker-vertical-bounce to false, re-compiled and the white flash re-appeared. Baker 3.1 on iOS 5.0.1 (iPad 1).

Xm4s commented 12 years ago

Ok, I've implemented the fix suggested by nruffilo in the branch "white-flash-fix".

The problem with the solution is that by setting webview.opaque = NO and webview background transparent you'll be seeing the content under the page (page screenshot, user background or plain black) when the webview bounce.

Since there's not a clear moment to reset those property in this fix I try to reset them when the user try to scroll the webview the first time.

Please try this and let us know how it goes :)

Xm4s commented 12 years ago

Since no one has provided any feedback about the fix we can't merge it on the master branch yet

We really need your feedback about this, so please checkout the "white-flash-fix" branch and let us know if it works for you :)

yumyo commented 12 years ago

Hi Xm4s. I'll try it tomorrow and report back ; )

bahmet commented 12 years ago

pls someone advice me how can i try this fix.

folletto commented 12 years ago

You just have to download the branch and test it with a book that had the problem.

Step by step:

  1. Click on "white-flash-fix" branch
  2. Click on ZIP and download it
  3. Open it and test with Xcode with a book that generated before the white flash
bahmet commented 12 years ago

ok i clicked on "white-flash-fix" branch downloaded zip and opened. copied my book folder into it opened with xcode and archived to copy my ipad. now i do not have white flash where i had before....

hope that test is ok for you

folletto commented 12 years ago

That's it! :) Try to play around a bit and stress it, but overall, that's it. :)

nruffilo commented 12 years ago

Glad to hear this may make the build!

-Nick

On Wed, Feb 22, 2012 at 9:49 AM, Davide Casali < reply@reply.github.com

wrote:

That's it! :) Try to play around a bit and stress it, but overall, that's it. :)


Reply to this email directly or view it on GitHub: https://github.com/Simbul/baker/issues/164#issuecomment-4105275

yumyo commented 12 years ago

Ok, tested with the same files used when I opened the issue. No more white flash! Both in "screenshots" and "three-cards" mode. Congrats!

A side question about the "three-cards" mode: I ran my test with "-vertical-bounce: false" and noticed a jerky animation swiping between pages. Any idea? The problem mitigates if I enable "vertical-bounce" for both modes. Since I'm running out of the current issues I'll repost this in a new one.

folletto commented 12 years ago

I'm sorry to do this, but please open a new issue to ask that ;)

bahmet commented 12 years ago

guys, after i downloaded and used "white-flash-fix" my double tap navigator is broken. when i double tap the screen the index.html shows 30-40 px on the down left side of the screen. can you pls help to sort it out thanks