start video record on view load in ios - objective-c

I've looked through the Apple documentation but have seen no mention of how to do this, nevermind if it's even possible or not. I'd like to make it so that an iPhone/iPad begins video recording automatically when a certain view is loaded, and stops and saves when the view is dismissed. Is there any way that I can do this or am I just going to have to use the normal UI for video recording?

Use AVCaptureSession
https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/occ/cl/AVCaptureSession

Related

Is it possible to programmatically force an ios ap in split view to go full screen in ios9?

I am developing this app for ipad and ios9 and at some point the user will click on a button to watch a video. But I wouldn't want the user to just see it in the split view size he's currently on (like 1/3rd or 14th) instead I would like the app to close the other open app and for it to take over the entire screen.
Does anyone know if that's possible? Thanks.
By-default, the video always get played in full-screen mode. When video playing is finished, the player gets dismissed and you will see your screen (from where you played the video). In your case, in split view controller.
Do let me know if you need further details.

Event that fires when video is loaded and first frame is visible? Or how to crossfade two videos another way?

I am trying to use video.js in a samsung smart tv application which unfortunately can only play one video at a time.
I need to simulate the smooth, preferably crossfade, transition between two videos. I am trying to do this by first fading in a screenshot of the next video and using that to cover up the screen while I switch video sources of the video.js plugin. When the player is ready I need to remove the screenshot.
The closest I have found is to remove the screenshot when "loadedmetadata" is called however I am still seeing an inconsistant blip of a black flash between the time the screenshot is removed and the video plays. This is very jarring and I need a consistent way to remove the screenshot only when the first frame has been loaded into the player.
Any other suggestions on how I could each a smooth transition between two videos while only using one video element would be greatly appreciated.
I found the loadeddata event which, as described on MDN :
The loadeddata event is fired when the first frame of the media has finished loading.
loadedmetadata only announce that media informations such as duration are loaded, but the loadeddata event should do the trick.

Playing a muted video without interrupting background music

My design calls for a video playing in the background of my login screen, exactly like 6snap has.
I would like to avoid the default behavior of stopping the user's music when the video starts to play. My video does not have sound.
I'm using:
<MediaElement Source="MyVideo.mp4" />
I tried setting IsMuted=true which didn't help. Does anyone have an idea how 6snap managed it?
Edit: currently trying the animated gif route. Using the ImageTools 3rd party library and having converted my MP4, it works fine. My 9 second 640x1136 3MB video became a 41MB GIF, so I have to reduce the quality drastically. Still trying to find a better way if possible.
You won't be able to do that with Background Audio and MediaElement, hence as MSDN says:
When a MediaElement control plays audio or video content, any background sounds or media already playing are halted. The app launches the playback experience when the user taps the control. Only one MediaElement control can operate at a time.
It's no matter you have no sound - when you start to play all background sounds/media are halted.
I'm not sure how the App you have mentioned achieved that, but maybe you can try with DirectX/XNA - thought I've not tried this and don't know if that would help.

MPMoviePlayerController swapping videos flicker

I'm using MPMoviePlayerController to play different videos.
However, when I change the video using setContentURL (I'm just targeting OS 3.2 and above), I notice a white flicker.
Is there anyway I can get rid of that flicker and make the transition between videos look smooth?
Thanks,
Tee
Unfortunately not, and I've had this problem too. You could use another instance of the controller, and use an animation to transition from one video to the other, to have a bit more control over the process.

iPhone SDK Question with Audio/Mic

I am trying to do an app, to where when it launches, it will detect audio, and then play it back automatically. NO BUTTONS, nothing to press. Just a picture of something then, it listens for audio, then plays it back. Similar to the Talking Carl app in the App Store. Any ideas/help? Would appreciate it, if i could use the code with IB.
Work through this example:
http://www.iphoneam.com/blog/index.php?title=using-the-iphone-to-record-audio-a-guide&more=1&c=1&tb=1&pb=1
And then you'll want to put the code for recording and playing back the audio in the viewDidLoad method of whichever view is your main view.
One thing you might also want to consider is how long you want it to record before it plays it back? And also, you'll want to stop recording once the sound starts playing... and also you'll want to start recording again once the sound STOPS playing.... all these things to think about and learn about :)