psiegman / epublib

a java library for reading and writing epub files
http://www.siegmann.nl/epublib
1.05k stars 316 forks source link

How to play audio files of epub book in WebView #16

Open nikhil-naik-rfh2 opened 12 years ago

nikhil-naik-rfh2 commented 12 years ago

Hi i am new to Android,I am creating a epub reader using Paul Siegmann epublib. I succeeded in reading the text and images of Epub book. Now i have to read Audio and Video files from epub book. Can any one give me any suggestions .....

akyl01 commented 12 years ago

Now for images you have to get it by book.getcoverpage and mostly it will not be found. So you have to access through the folder to find the images manually. There is a code somewhere in this site to do this.

For Audio and Video. I recommend that you use a textview for loading text reason being is that it uses a flat string which you can use to text to speech. For video I recommend putting a webview and textviews inside the viewFlipper. Webview being the one that is that shows the video. Use a function to swap from textview to webview and there you go an Audio/Video Book.

nikhil-naik-rfh2 commented 12 years ago

Hey aky101 thanks for the reply I am creating a epub reader so i want to read Audio file which is present in Epub Book. The book is a combination of couple of Xhtml pages,so i want to read Audio from that Xhtml file in the flow itself....

akyl01 commented 12 years ago

Well you can always do it the hard way and get yourself another jar which gets a parser to parse out the specific xhtml file then you can do whatever you want with it. I don't know of parser that is threadsafe so goodluck which doesn't mean it doesn't exist but you have to search for it.

nikhil-naik-rfh2 commented 12 years ago

Hey thank a lot for your reply....