Thursday, March 1, 2012

Javascript in ebooks


There is a way to solve this problem and keeping almost everybody happy.
But first the case against and for javascript in ebooks.

AGAINST

The reasons not to support javascript are quite numerous. When you list them all I’m almost embarrassed about how much of an ebook javascript supporter I’ve been in the past. (I still am, in a way. But more on that later.)
Problems for ereader vendors:
  • Support. Your ereader becomes an app platform with all of the responsibilities and problems that follow. The documentation and support requirements of a non-JS ereader are extensive enough, now they are expected to add javascript.
  • Security. Being an app platform and because ebooks are persistent downloads, ebooks potentially face more serious security problems than a website would. Ebooks are more extensive than the persistent widgets we’ve used in the past and many ereader devices don’t have as neat an update story as you’d need to deliver security updates.
  • Consistency. Nobody has delivered solid javascript support in a reflowable, paginated, ereader app yet. (iBooks is too buggy to count as solid.) We have no idea whether the various ereader vendors are even capable of delivering javascript support in a consistent manner. (Readium might solve this problem.)
  • Context mismatch. The javascript DOM and APIs all assume that they are run in specific context. When you implement a browser-based ereader app you create a context mismatch where the book’s javascript is executed in the app’s context. This creates bugs both in the book’s JS and in the app and opens the app up to a host of security problems. (It’s a bit as if every web page were allowed to execute arbitrary Objective C code in Mac OS X’s Safari browser, rewriting the UI, preferences, rendering, etc. at will.)
Javascript in ebooks also has problems for authors/devs. Where many ereaders have no update story, ebooks are worse. One of the core concepts in web development is iterative development. Every website is a living thing that is regularly updated and tweaked to match the changing browser landscape. Javascript-heavy websites that aren’t updated often end up being unusable when the market takes an unusual turn. There are many pages, for example, that still don’t work on the iPad, despite it having a screen resolution and CPU speed that was considered desktop mainstream only a few years ago.
Ebooks that rely on javascript are, quite simply, going to stop working some day. Any ereader vendor who wants to support JS in ebooks has to support automatic, silent, background ebook updates so that ebook authors can push out fixes when (not if) the books break.
Apple’s current tactic with iBooks is worse than useless:
  • Different APIs enabled depending on whether you are in an ePub or in the iBooks 2.0 format. No documentation to help you out with the differences.
  • No auto-update story for the ebooks. When an update breaks a book (which happens almost with every iBooks release) it remains broken until the reader re-downloads it. That is, if the author has sent Apple an update and if Apple has approved it.
  • If iBooks were a browser it would be the buggiest browser maintained. The latest releases of all browsers are by far more stable, more documented, more programmer-friendly than iBooks. Even the worst mainstream browser I can think of (which would be Android’s default browser) isn’t as bad as iBooks.
  • All documentation is secret. You only have access to it if you are publishing through iTunes Connect. Anybody going through an aggregator, or freelance ebook developers who aren’t publishing themselves, aren’t supposed to have access to the documentation or the testing tools Apple provides.
  • No console. No debugging tool. No DOM inspector. No breakpoints. No nothing. iBooks is a dark, secretive, hellhole that doesn’t tell you anything about anything. It’s next to impossible to know what’s going on if something isn’t working.
In short, iBooks is a nightmare to develop for. It is the platform from hell. It offers more design features than other platforms, and is the only one that supports javascript, but, frankly, those features aren’t worth the pain involved.
So, if iBooks is any indicator of what the authoring experience for ebook javascript will be like, then you can count me out.
Thanks, but no thanks. I put a higher value on my sanity than that.
There’s one additional hurdle. One that most people keep misunderstanding when I state it: Apple won’t let third party ereader apps ship with javascript support.
They think I’m saying that Apple won’t let ereader apps ship with more or better javascript support than iBooks, or that Apple will be heavy-handed in protecting iBooks from competitors.
They may well, but that’s not the reason. Apple wouldn’t let ereader apps ship with comprehensive javascript support even if they didn’t make iBooks and weren’t in the ebookstore business.
Why?
Because an ereader app that supports javascript in ebooks is, as I said above, an app platform and Apple doesn’t allow competing app platforms ship through the iOS app store. They just don’t. They even sometimes block apps that vaguely smell like app platforms, like customisable dashboards and the like.
Allowing an app platform to ship via the iOS app store would be a major policy change at Apple.
The only exception I can think of is if an ereader app adds javascript support that is horrible, buggy, and unusable, Apple might let that slide, but that won’t help authors, for obvious reasons.
Third party ereader apps just aren’t going to ship with javascript support on iOS and iOS is too big a chunk of the tablet market to be ignored. Nobody is going to author javascript-enabled ebooks when they’d only work in less than 10% of the market. It doesn’t matter what the ereader vendors keep saying, or what IDPF says, it just isn’t worth it for authors or publishers. A delusion repeated like a chant still remains a delusion.

FOR

With all those problems, why have I always been in favour of javascript in ebooks, even to the point of tweet-flooding the patient folks at IDPF about the issue?
Simple: We don’t know what an interactive ebook looks like, yet.
We have plenty of ideas. Quite a few antecedents from the days of pre-web hypertext. Then a few more from the era of CD-ROMs. These interactive works vary enormously and require different capabilities. Then we have the web.
All of these platforms have allowed some sort of programming and many of the common features require it.
We are only now, after two decades, reaching a point where we have a bit of an idea of what common features the web requires and have started to implement them declaratively (like some of HTML5’s form features). Even so, we still rely on javascript because it’s just simpler than going through the process of inventing and then standardising declarative methods of authoring the same features.
We aren’t even close to this for ebooks. We don’t know what we want. We don’t know what we need. We don’t know what will be popular or enjoyable. What we don’t know can’t be implemented as native widgets and can’t be integrated into the ereader’s UI and chrome.

THE PROBLEM SPACE

There are several contexts were javascript might be useful in an ebook.
Main body. Running a script in the primary text of the ebook gives you access to several things. You can:
  • Modify the text depending on actions (like StretchText) and outside factors (like the weather).
  • Monitor the readers using software similar to our current web analytics (if network access is allowed).
  • Alter the book’s content and structure based on the reader’s progress and demonstrated intent.
  • Dynamically add links to the text based on arbitrary factors.
Most of these options don’t seem particularly appealing. StretchText never grew beyond a niche and I’m not sure readers are comfortable with the idea of having their book reading tracked like their web reading. Some of these options might be useful but are next to impossible to do well. (Intelligently coming up with useful/interesting changes to main content is harder than it sounds.)
Dynamically adding links might be useful, but since most uses I can think of (and most precedents) are sleazy marketdroid tactics, that’s also of doubtful value.
Still, hard to know the value when nobody’s trying.
Embedded widgets. The web equivalent would be iframes executing javascript code.
The iBooks 2.0 textbook format implements this, at least for native widgets. (I don’t know if they do so for HTML/JS widgets).
The web has plenty of examples, most of them ads. Google, I think, uses this for their native HTML5 video embed codes.
Popups and appendices. This is how a large majority of non-app interactivity works on the web. You take an action (click on an image, link, graphic) and something interactive pops up in an overlay or separate window. Then you use the slideshow, flash infographic, or whatever in that separate window or context and when you’re done you close it to return. The state of the original reading context is preserved.
Spine. A javascript that runes in the context of the entire book – not just a chapter – with access to the entire book’s structure.
Not many antecedents because it hasn’t really been done before. But I can think of several hypertext structures and tactics that would probably require this. Many of the hypertexts that have been authored with Storyspace, for example, might need this. The most complex ones are usually distributed as applications.

THE SOLUTION

One solution has already been implemented by, at least, a couple of apps:
  • In-app browser windows.
Kindle and Kobo for iOS (I haven’t tested the Android versions) both do this when you click on a link in an ebook. An embedded webview window pops up fullscreen over the main content. You aren’t thrown out of the app into Safari. You aren’t asked what you want to do before throwing you out of the app into Safari (iBooks really is one on the most half-baked apps I’ve ever encountered). You just get a fully-fledged, fully-enabled, browser view in an overlay over the book.
The best part is that this is standard practice across the iOS platform – most apps pop up a web page in an overlay – so the readers will know exactly what to do and how it works.
It’s easy to see the use cases:
  • You have a thumbnail image of a graph floated to the right in your book. The reader clicks/presses it and the web page pops up with a fully interactive graph they can play with.
  • Every chapter in a textbook might offer links to exercises as either lists of links or sets of thumbnails that the student can press and complete online, allowing the textbook author to optionally maintain some sort of state using bog-standard web tech.
  • A photo thumbnail links to a slideshow web page.
  • A map image links to a Google maps page.
When an OS or browser engine update breaks the web pages, the author just updates them on the server like any other web page. No need to involve the ereader vendor.
Of course, websites don’t live as long as books might, many of them go offline after a few years, but I doubt that would be as big a problem as people expect.
This also is completely useless when the reader is offline, but that’s a small price to pay, IMO.
This solution, obviously, only addresses overlay widgets, but that’s a very big and rich territory for us to mine in authoring ebooks.
Officially supporting this as a way to extend ebooks also gets ereader vendors out of implementing and supporting javascript.

IMPROVING THE SOLUTION

Ereader vendors can improve on this in several ways.
They can offer integrated mirroring for webpages that are supposed to be linked to from their ebooks. That way they can make sure the pages are live (if the official page is down, load it from a mirror) and don’t go offline for the lifetime of their platform.
They can implement prerendering in their ereaders. The ebook author would include this:
<link rel="prerender" href="http://example.org/index.html">
in a tag in the head of the current ebook chapter and the ereader would prefetch and prerender that page, off-screen, so that it displays instantaneously when the reader presses the link or thumbnail.
They might even extend the ePub’s metadata with a scheme that lets authors list prerendering hints; a list of webpages they intend to link to from the book. The ereader could cache the files and when a chapter is loaded that links to one of these files it could prerender the page while the user is reading the main text. They could even use this metadata list to implement backup mirrors for the web pages.

IF YOU CAN’T TELL, I LIKE THIS SOLUTION

I think this is a classic 80/20 compromise. It gets us 80% of what we want from both widgets and javascript with 20% of the effort.
With prerendering and official mirroring we get what we want, both as readers and authors. We get stability. We get rich interactivity. We get javascript.
All with much less hassle for the ereader vendor than full javascript or widget support would entail.
Best of all, we already have a basic implementation of this solution on two major platforms, Kindle iOS and Kobo iOS.

Analyst: Publishers Seeing Steady Print Declines Should Ready for Steep Drop


Analyst: Publishers Seeing Steady Print Declines Should Ready for Steep Drop

Publishers are more optimistic that they won’t see “significant” drops in print revenue in 2012, according to a recent survey. That optimism may be misplaced.
While print publishing revenues showed a steady decline across the industry in 2011, publishers should ready themselves for a steep drop in 2012 or 2013, according to a Forrester analyst.
In a Digital Book World survey conducted by Forrester Research, 5% of publishers believe their print sales will “decrease significantly” in 2012 versus 12% who thought the same about 2011 when asked in 2010. The percentage of publishers who predicted any print declines in 2012 was virtually unchanged versus the previous year.
“There’s an optimism about the pessimism,” said James L. McQuivey, Ph.D., vice president and principal analyst at Forrester, who conducted the survey. “But in reality the decline hasn’t hit yet. And when it does, it comes in big drops, not gradual tapers – that’s what we learned from music and DVD, both of which tapered down until they hit big drops and shelf-space disappeared rapidly. The same will happen in books, probably by late this year and certainly in 2013.”
In late 2011, book publishers representing 74% of U.S. publishing revenues were surveyed on a wide range of topics concerning digital books. The same survey was conducted in 2010.
According to the Association of American Publishers, print revenue in the two largest publishing segments for which it tracks monthly book sales numbers was down 17.5% and 15.6%, respectively.
(E-book revenue overall was up 117%. E-book revenue’s increase of about half-a-billion dollars just about matched decreases in the adult hardcover and adult paperback segments, the two largest at $1.3 billion and $1.2 billion, respectively.)
At several major book publishing companies, including Penguin and Simon & Schuster, increases in digital revenues accounted for declines in print revenues. But, because of higher profit margins on e-book revenues versus print-book revenues, profits were up even though sales were flat.
For some, less-diversified publishers, a precipitous decline in print due to rapid drops in shelf space could be disastrous.
“For those people – illustrated books, cookbooks – if print goes down, they go out,” said Thad McIlroy, a Vancouver-based digital publishing consultant.
On the even more “pessimistic” side of pessimism, fewer publishers believe they will see “significant” gains in print in 2012 than did in last year’s version of the survey: 2% versus 9%.
“There is always a segment that can expect to grow,” said McQuivey. “But these successes will be modest and may not represent an opportunity worth investing in because they won’t last.”

Wednesday, February 22, 2012

Smaller iPad in 'testing stage,' says research firm



by  


An Apple tablet with a smaller display is undergoing tests, says a Taipei-based market researcher, which also released a 2012 tablet market forecast.
A smaller iPad is undergoing tests, a market researcher says, adding fuel to rumors about a downsized Apple tablet.

"Smaller iPads...are still in the testing stage; whether or not these prototypes will enter mass production remains unknown," TrendForce, a Taipei-based market research and consulting firm, said today.

The impact of a small iPad would be felt mostly in 2013, TrendForce said. "If production ensues, the release time will possibly be in 4Q12, right before Christmas. With a smaller size and a resolution of 1024x768, as opposed to iPad 3's 2048x1536, the small iPad will not hurt iPad 3's sales in 2012 and will have a bigger impact in 2013," according to TrendForce.

TrendForce forecasts a total tablet market of over 94 million units in 2012 with Apple grabbing more than a 60 percent share.

TrendForce forecasts a total tablet market of over 94 million units in 2012 with Apple grabbing more than a 60 percent share.
(Credit: TrendForce)
If a so-called iPad-Mini materializes, analysts expect it to have a 7.85-inch display compared with the iPad 2's 9.7-inch screen.

TrendForce also offered its forecast for the 2012 tablet market, which is expected to grow 53 percent over 2011 to 94.4 million units. Apple will control the lion's share of the market due to its technological lead. "Apple's high tablet market share can be attributed to its tablet competitors failing to catch up with the iPad's advancements," TrendForce said.

And the iPad 3 will only solidify this trend. "The iPad 3 will further secure [Apple's] leading status," TrendForce said. "The only concern is that iPad 3's high resolution panel comes with a low yield rate; whether or not the panel production will be enough to supply the market demand remains to be seen."


Read more: http://news.cnet.com/8301-13924_3-57382410-64/smaller-ipad-in-testing-stage-says-research-firm/#ixzz1n8sm5r5U

Sunday, January 22, 2012

How Publishers Should Prepare for EPUB 3

By Jeremy Greenfield, Editorial Director, Digital Book World, @JDGsaid

http://www.digitalbookworld.com/2012/how-publishers-should-prepare-for-epub-3/

The future of e-books is now.

The approval of a new coding language for e-books, developed by the International Digital Publishing Forum (IDPF), a global trade and standards organization for the promotion of electronic publishing, means that soon it will be a relatively simple matter for e-books to contain video, audio, dynamic content and all sorts of interactive features.
The catch? Many of the features of EPUB 3, as it’s called, can’t currently be rendered by most e-reading software. Meaning, if a book publisher created a new e-book using EPUB 3 to embed a Google map or a Twitter feed, the book wouldn’t work properly on most e-readers.
But that’s all about to change.
“2012 will be the year when retailers adopt EPUB 3,” said Bill McCoy, executive director of the IDPF.
For instance, Ingram Content Group, the country’s largest distributor of digital and physical books, said that its e-textbook reader, VitalSource Bookshelf, which is available as an application for the iPad, iPhone, Mac Windows, browsers, iOS clients, and Android in the near term, will begin to support EPUB 3 in April.
“VitalSource works with 200 education publishers, most of which are gearing up for EPUB 3,” said Rick Johnson, chief technology officer for VitalSource.
As more e-reader software supports more of EPUB 3, publishers need to prepare for changes in creative capabilities, workflow, hiring and, maybe most important of all, their relationship with booksellers.
—
Hear more about EPUB 3 and what publishers should do about it at the Digital Book World Conference + Expo in New York City from January 23 to 25.
—

The Coming Battle With Retailers
First the tech jargon, then the plain speak: EPUB 3 is built on HTML 5, which means that publishers can build JavaScript into their books.
This is significant, because JavaScript can theoretically be used to track e-book reader behavior, information publishers have coveted since the dawn of the Kindle age – and that retailers have refused to share.
“Retailers, like Amazon, are known for not disclosing certain information,” said McCoy. “Publishers would love to know that information.”
With EPUB 3, publishers should be able to build software into their books that tells them how much a reader reads, when they read and for how long, for starters.
While publishers should push hard to gather all the information retailers will allow, retailers may resist, citing security risks and privacy concerns, said McCoy.
But the terms of the conflict might change when retailers allow books to fetch remote data, like a dynamic Google map or an ad that changes at the whim of the publisher.
“Once you allow that, it’s very hard to limit,” said McCoy. “Some distribution channels will enable that kind of remote data access early in 2012. The question is when the top-end vendors do that. That will depend on competitive situations. Some may try to jump first. I don’t want to predict the moves in the game of Risk, but some of the vendors are more oriented at being open than others.”
Publishers might have an unlikely ally on their side: the specter of piracy.
“As you move into the world of HTML 5, interactivity is becoming the new DRM [digital rights management],” said Johnson, who helped craft the EPUB 3 language as part of a working group at IDPF. “As you enable new interactivity, you are making it harder for people to share the content; you have to have the whole book in order to use those rich features.”
As EPUB 3 is adopted, many of those “rich features” will require remote data calls.

New Paradigms in Sales and Marketing
If allowed, remote data calls through JavaScript embedded in an EPUB 3 e-book will open up a whole new world of customer information and customer interaction for book publishers.
Beyond being able to collect dynamic data from readers, publishers will be able to talk to readers, on the fly. The most obvious incarnation of this is advertising.
“JavaScript support allows the same kind of ad ecosystem as exists on the Web,” said McCoy, meaning that publishers can theoretically advertise anything at any time using ad space they develop in their books sold with such capabilities.
For instance, a book sold today might advertise a related book in the back-matter, plugs for new books that typically appear in the back of the book. If that ad were served through JavaScript, publishers would know just how readers responded to it, and if response wasn’t what was hoped for, they could change or adjust the ad for better results.

New Ways of Thinking About Content
As tablet and smartphone adoption increases, readers will expect richer features from books.
“Users want features. They want eye candy, they want sharing,” said Johnson.
That doesn’t necessarily mean that publishers should seek to add features haphazardly to their current pipeline of e-books. Publishers should think more holistically about their content.
“Publishers are going to need to think about their content as a more malleable asset,” said McCoy. “If you’re doing a novel, you don’t think of it as only a hardcover.”
With the proliferation of devices and screen sizes, publishers need to consider all of the different kinds of places their content could appear – and both compensate and take advantage of those different venues.
“It’s not just about tablets. EPUB 3 is going to live in browsers, in native applications,” and publishers that try to get their content onto screens of all sizes – and looking good – will be ahead of the curve, said Johnson. Scripts, or bits of code that answer questions for a piece of software, that can be built within EPUB 3 will allow publishers to optimize one piece of content for multiple screens, he added.

New Workflows
Publishers that want to build new kinds of reading experiences need to think about what new features they want to add to their books at the earliest possible stage.
“They need to figure out how they want their books to sing and dance,” said Eric Freese, until recently a solutions architect at Aptara, a Falls Church, Va.-based e-book production house; he was also part of the working group at IDPF that developed EPUB 3 and is now an information architect at Amsterdam-based health publisher Elsevier. “Do they want audio and video added in? If so, they need to be thinking about that at creation time, not publication time. The earlier the better. By thinking about it early, you’re more nimble and flexible with what you can do at the end.”
For those publishers that haven’t quite mastered the art of quality assurance (QA), EPUB 3 will bring fresh challenges, ones that should be addressed by changes in workflow.
“With EPUB 3, you have the capability to style things differently and have things adjust to layout,” said Johnson. “You have to make sure you have all the basics down. I encourage publishers to have a good way to do QA work.”

Hiring New, Expensive Workers
EPUB 3 is built on HTML 5. A relatively new coding language, HTML 5 isn’t yet a common skill for developers. And where there’s scarcity, there’s cost.
“If you’re doing children’s books or cookery or anything that needs to take advantage of interactivity, HTML 5 is going to be the core building block and that’s the core skill that publishers need to make sure they have in house or an outsourced relationship that they can count on as a business partner,” said McCoy.
Publishers will need to hire more in-house staff, said Johnson. They will either need to build their own HTML 5 development teams or at least hire a knowledgeable liaison for any vendors they work with.
“With this enhanced digital content, they [publishers] will need to grow the skills and capabilities of their staff,” said Johnson. “They will also demand more from their vendors.”
Building it or buying it, engaging an HTML 5 development team is a costly proposition.
According to Salary.com, the median salary for a Web applications developer in New York is nearly $95,000. And that’s for people whose skills may not even reach the high level necessary for top HTML 5 development.
And that doesn’t factor in the recruitment costs. Good developers are hard to come by, with the unemployment rate for technology workers under 4% for most of 2011 and companies like Google, Facebook and hot startups duking it out for top talent.