How to check you tube video exist or not with embedded HTML - iphone

I am using Embedded HTML for playing video on iOS 5 and it is working perfectly, But if video doesn'n exist then it show blank screen. How can i identify video exist or not ? even in this case webView didFailLoadWithError not getting called. Any help will be appreciate. Thanks

You could check for existence of the video using Javascript (see How can I check existence of a file with JavaScript?) and then (again using JS) if the video exists update the reference in the <video> element.

Related

jPlayer doesn't play audio file automatically in iPad

I am trying to play audio file using jPlayer in iPad. It works fine in Safari on my local PC but when I tried to open it in my iPad it doesn't play audio automatically.
Please help me.
Thanks
You may have to initialize jPlayer on user action in Mobile Safari.
The first time a media element is played must be initiated by a user gester. ie., The user must click the play button. This affects the operation of a jPlayer("play") in the ready event handler. The browser will ignore the command. jPlayer will simply wait until the user presses the play button.
Once the first gesture has been received, JavaScript code is then allowed to do whatever you want with the media element. Note that a jPlayer media player instance uses a audio and a video element. Each require their own gesture.
As a hack, you could possibly add a handler for a touch event on an outer container element (or body) and initialize any jPlayer instances that you want.
Ref: http://www.jplayer.org/latest/developer-guide/#jPlayer-known-issues-event-driven
Do you mean it doesn't play automatically? Because if it does, I don't see what your problem is.
Check if you have entered the correct path for option swfPath.

How can i detect CODEC in MPMoviePlayerController in iphone-sdk

When Video is made with the Sorenson CODEC... MPMoviePlayerController just plays Audio(and not the Video), Instead i want to show my custom error message at this point. How can i detect which CODEC is used by particular File programmatically ... ?
EDIT: I am not using Quick time in my code so that solution won't work
Thanks
Check this documentation to understand the Quicktime file format :
http://developer.apple.com/library/mac/documentation/QuickTime/QTFF/qtff.pdf
The field you are looking for is the "vfmt" code that is containing the video fourcc code (there is one for each video track in your file, so take care if your file is containing several video tracks). The fourcc codes for Sorenson codec are "SVQ1" and "SVQ3".
Now you'll have to write some code to parse the QT file to find the correct atom, extract the "vfmt" value and compare it to SVQ1/SVQ3 !
Apple is providing some classes to easily parse quicktime files, but it is only available on Mac OS, not on iOS !

video trimming in uiimagepicker

I was able trim the video when i used the photo library source type. But when I use the camera source type trimmed video appears to be saved. but when i play the saved video it is not trimmed. Can any one pls help me with this?
It looks like you can't use uiimagepicker AND get the edited video. You have to use UIVideoEditorController.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIVideoEditorController_ClassReference/Reference/Reference.html#//apple_ref/occ/cl/UIVideoEditorController

UIWebView intercept "setting movie path:" from javascript audio player

In iOS 4, I've got a page loaded in a UIWebView with a javascript audio player. I did not create this player, it is owned by a third party, so I can't tinker with it. When I click the play button, I see an NSLog printout like the following:
setting movie path: http://data.myaudio.com/thefile.mp3
My question is, what is getting it's movie path set and how do I intercept it? The audio will continue to play until I create another UIWebView, or use the built in audio controls accessible by an iPhone home button double tap, or close the app. I can't intercept the path with shouldStartLoadWithRequest:, the javascript function audio.play() appears to call some built in player directly. I'd like to control where and how the audio is being played, but short of parsing the HTML for any <audio> tags, I can't figure out how to grab that path and point it somewhere other than the default.
UIWebView is essentially a wrapper for WebKit. Apple does not want you to touch anything more about it than is provided by the existing delegate methods.
That being said, you can modify the DOM of any loaded document by injecting JavaScript. This way you could also modify the audio.play to not do anything and instead get the URL to play with your own player that you can control.

How to record a video automatically in Iphone app without user interaction

I am working an iphone app that needs to record a vedio automatically.
I used mobile coreservices framework and using that. I made it to came into video mode and clicking on record option its start capturing a vedio. But I want it automatically that is.. I should able to record a video without clicking on record option. That is when video mode comes up its automatically start record video.
Could any one help?
You can look at UIImagePickerControllers startVideoCapture method which is used to start taking video from the camera, this is to be used when you arent using the camera standard controlors and you provide and overlay view. Here is a reference UIImagePickerCOntroller ref. If this is not enough for you, you might want to look into AVFoundation framework which gives you a lot more control over video capturing process...hope that helps