Best way of drawing text to the screen - ipad

I am working on a read-along-book app for the iPad which is very similar to this Toy Story book ([url=http://itunes.apple.com/us/app/toy-story-read-along/id364376920?mt=8]Toy Story Read-Along for iPhone, iPod touch, and iPad on the iTunes App Store[/url]). So my question is how would be the best way to draw the text to the screen and then, here seems to be the tricky part, highlight over each word as it is read by the narrator? I have some pretty nice page turning animation setup now and a few other things on there way, but need some good suggestions for the text. Any examples are very much welcomed!

I'll answer only for the text highlighting.
I guess the best way to do it is to create a separate app that play the audio file you want to use.
when the apps starts there will be a button for starting the audio playback.
once pressed play, the app starts a timer.
now you start listening the audio, every time a starts a word that you want to highlight tap the screen.
the app tracks the time.
at the end of the audio file, the apps dumps the timestamps.
at this point you'll have the exact time in which you'll have to start highlighting the single word in your application.
Hope it help!

Related

Trying to create an Xcode Objective-C function that records a video capture of my UIView contents and saves to phone

I'm trying to create an Xcode Objective-C function that can be called from a button tap, that will record the contents of a UIView and its subviews (or a fixed section of the screen e.g. 320x320 in the center) and then allow the user to save the video to their iPhone camera roll. I also want to include the audio that is being played by the app at the time of the recording e.g background music and sound effects.
I'm having trouble finding any info on this as their seems to be a lot of people trying to record their running app for external purposes like the app store video preview. I need my video captured within the app, to be used as an app feature.
Does anyone know if this can be done or know a website or tutorial where I can learn what's needed? Thanks
I know this post is two years old, but for anybody who comes along who might need to record their iOS app's screens and save them to the phone's camera roll or even a specific URL, take a look at https://github.com/alskipp/ASScreenRecorder
I've tried it and it works! The frames per second aren't 60 so I don't know how well it would work if you were trying to record an action game, but it's still pretty awesome.
You can't do that with just one function, check that project:
https://github.com/coolstar/RecordMyScreen

Airplay with AVQueuePlayer has gaps

My app uses AVQueuePlayer to show video clips back to back. In testing on my AppleTV, it seems that when I switch to the next video in the queue, there is a small time gap where the Apple TV 'takes over' the screen and the home screen of the Apple TV is displayed. Is there any way to prevent this gap from happening, even a black screen or loading indicator would be a better experience.
I was having this exact same problem and was dismayed when I saw that no one had yet to find an answer.
The solution I ended up going with involved taking advantage of the multiple display support added in iOS 5. There are some helpful links in learning how to do this here:
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012555-CH1-SW1
http://blog.redfin.com/devblog/2012/05/creating_a_dual-screen_airplay_experience_for_ios_and_apple_tv.html#.UjCe5mRATZY
The app I am designing will basically look for the availability of an external screen. If it finds one it will play the videos on the viewcontroller I provide for that external screen. That viewcontroller can have a black background so that any pause in between videos looks natural and no longer has the Apple TV home screen pop into view for a moment.

Screen Capturing IN IOS

I have searched it on net many times but didn't get a proper solution. I want to implement screen recording video in IOS. Let me make it more clear. Suppose I am playing a game and after playing that game , I want to replay that game to check how well I have played the game. So ultimately I want to record every action performed on screen. Switching from one screen to another , coming back to root screen etc. Every action must be recorded. I am tiered of searching it on google. Can anybody tell me how to implement it ?
Any help will highly be appreciated.
Thanks in advance.
this might be helpful checkout
http://codethink.no-ip.org/wordpress/archives/673
Been there - just record the user actions and everything that affects the game. When you want to generate the video, just replay every user action in your world and instead of rendering the UI to the screen, generate video frames.
One of the typical problems is adding audio (music/sound effects) to the video but that would require a separate questions.
If you don't want to generate a video file but only replay the actions on your device, then you can just disable user interaction and replay the user actions directly.

Adding Play Stop Pause icons to iPhone Media player app

I have built a player app. It has play, stop, pause rewind and ff buttons.
Where would I find 'stock' icons for the buttons? Eg. the same ones used on the YouTube app and apparently all the other 'mainstream' player applications.
Also, when I go from stop to play or pause, there's a white 'flash' that happens behind the button. Is this something I create programatically behind the buttons?
I may be making something difficult out of something easy. I just don't want to create 'custom' versions if there real ones are readily available in the package.
I noticed there's been quite a few views of this page, and wanted to update the limited success I had.
I discovered an excellent website called Glyphish.com which has an incredible selection of artwork.
Hope this helps.

Mobile Safari: Audio + cache manifest

I'm having a small web app, which plays really short sound bits on the click of several buttons. It explicitly targets mobile Safari on iOS (iPad).
After reading here and elsewhere about the several "shortcomings" of HTML5 audio in this context on mobile Safari and trying a few "hacks" and tricks, I'm stuck with a situation where Safari seems simply (for the lack of a better word) broken:
I can play sound A (it takes a long time for it to start — I'm assuming it's downlading [again]?) on the click of button A. After that, clicking on button B will immediately play the sound A again. Same for button C. In some cases it will play a different sound, sometimes even the right one. But mostly sound A. The format in use was .aiff, is now .m4a .
After writing a few tiny versions myself, I decided to go with the Buzz library to handle the sound loading/playing/etc..
Funnily enough, their demo includes a game, which does pretty much exactly what I need and triggers the same faulty behavior. I even ended up in a situation where any audio player in mobile Safari in any tab would play a certain sound out of the Buzz demo game (!).
I was hoping a cache manifest might help overcome Apples preloading limitations and force the app to play the sound right after hitting the button in offline mode. But after confirming that the whole app had been cached, I can't play/hear any sound in offline mode.
Has anyone managed to get something like this to work somehow? (— Having seen how Apple handles certain things, I' don't expect much response, though… )
Update 1:
The example in this answer causes the same effect: How to synthesize audio using HTML5/Javascript on iPad
Update 2:
Updating iOS (and so Safari) seems to resolve the audio bug. The cache manifest doesn't seem to effect audio files, though. These files are just not available at all.
After removing the cache manifest the app works okay, but adding it to the "home screen" and reloading it prevents the audio from playing as well.
I wish I could tell you there's a magic formula to get all your html5 media to work perfectly, but there isn't. Mobile support for HTML5 audio/video is pretty poor right now; much further behind than its desktop predecesors. To make matters worse, each of the different platforms handle it differently and most of them only support it in semi-recent versions.
However, there are some tricks you can employ to get media files to work correctly in mobile Safari. In order to explain them, you'll need to understand some of its shortcomings.
1) You can't load multiple audio / video files
Its been my experience that the browser will only load one file at a time. If you play one file, go and play another, and then come back and it'll just load that file all over again. And, although I didn't try it myself, I don't believe a cache manifest will help you here.
What I had to do is combine all my audio files into one large audio file. Then, depending on which audio track was requested, I'd move the play position to the appropriate starting position and play that track. Then, I'd use a setInterval to examine the playback every few milliseconds to determine if the current play position hit the end of the track. Once it did, I paused it. Pluis, I gave myself a few seconds (2-3) between each track, just in case the phone's CPU was under a lot of load and checked the feed a little too late.
2) You can't auto-play audio / video files
Apple built into their HTML5 media tag technology the limitation that these tracks would only load and play in response to a user click event. That way, developers couldn't auto-play annoying tracks when you went to their websites.
When I was using audio/video tags, I was trying to build a rich media advertisement. So I hooked my audio/tracks loading to the banner click event, when you click a banner and expand the advertisement.
What I'd suggest you should do is have a small lightbox popup come up, asking the user if they want to turn on/off sound. You can attach your load functions to the click event of that popup box, regardless if the user turns the sound on or off.
Personally, I didn't have much luck using the load() function. I'd run that function to load the audio and then click play and it would just load it again. It could have always been that I just didn't do it right, so feel free to prove me wrong and get that working. What did is I told the track to play, so that way it would start loading, and then I'd use a setInterval to see if the current play time incremented just a few milliseconds. Once I noticed that it started to play the track, I'd immediately pause it.
3) Audio/Video tags are only supported in iOS 4.0 and higher
There's no trick to getting around this. Its just the facts.
Here's a few sites that helped when when I was developing with audio/video tags:
http://www.w3.org/wiki/HTML/Elements/video
http://dev.w3.org/html5/spec-author-view/video.html#media-elements
Good luck!

Resources