How to delay video streaming in MPMoviePlayer - iphone

I am playing video stream from urls,in MPMoviePlayer.When I click the play button,Json
parsing happens and video is getting played after a buffer. all the videos are 30s. After the
first buffer video plays for 5-6 seconds,and stops.then again buffers and play.It continues
till 30th second.So the viewers get disturbed a lot. Is there any idea to overcome this?

one shortcut idea is you out
sleep(4);
in before playing the player
~thanking You

Related

Unity something went wrong when play too many audio clips simultaneously

I'm making a rhythm game, and I use 'AudioSource.PlayOneShot()' function to play the hit sound when the player hits the note. I downloaded a beatmap from Osu!Mania to test my game.
I found when there's too many audio clips playing simultaneously (20 audio clips or more per second), the audio output becomes stuttered, disorder, and the audio clips played earlier will temporarily be muted until the number of simultaneous audio clips playing is cut down to a certain amount...
It's common in difficult levels of rhythm games (play many audio clips simultaneously), I'm wondering how to solve this problem.
The problem exists on Windows whether on the Editor or not, and the FPS is OK when the problem happened.
Sorry for poor English.
The expected performance is playing many audio clips simultaneously fluently.
Okay... I've found the solution myself.
Open Edit->Project Settings->Audio,
and change the setting 'Max Real Voices' and 'Max Virtual Voices'.

AirPlay flickering when switching between movies

I have an app that shows list of movies in a table view. When I play them one after another on device it works just great. But when I switch to Apple TV over AirPlay it doesn't work anymore. It play's the first video on ATV ok but after a switch to the next video the screen on ATV start blinking/flickering and after a few seconds it falls back playing on a device. I am using MPMoviePlayerController for playing stream videos.
I also found out that if previous video finished playing over AirPlay it tries to start the next one over AirPlay also. Is this intended behaviour?
Is this kind a related with property allowsAirPlay?
I think I've found a solution. Before you switch playing another video you should stop the previous one:
[self.moviePlayer stop];
This is not needed if you are not playing via AirPlay cos the next video will automatically stop previous one by nature - you can not play two videos at once.
But If you do play video over AirPlay you need to stop previous one first and than play the next one.
This solution works for me.

Playing the multiple Audio files in different Views using single audio player instance in iphone,

I am new to audio playing, I am having one issue regarding Audio playing .The issue is Playing the multiple audio files , and controlling the current playing audio file from other Views.
My Requirement is. In my app i am having 4 audio files in different Views. Once the audio play button is clicked in some View, The audio playing has to be started and pause and stop and slider buttons has to be displayed , Even i navigated to the next view the audio has to be continued (I should be able to control the currently playing audio), If i pressed the navigated view's audio, The previous audio has to be stopped, Navigated page audio has to be played. After completion of Navigated page Audio, the resumed audio of Previous page has to be played.
As of my knowledge, I have take single audio instance in AppDelegate. I am referring that Audioplayer instance in all view's , Where ever i need. It is not working.(some times giving error , some times unable to stop the Previous Audio playing).
Thanks in advance.
if i am not wrong you have defined the audioplayer in appdelegate, right?
and which class are you using for this , avplayer , avaudioplayer or mpplayer ?
and by the way , if we come to answer of mine,
i have used avplayer and avaudioplayer for this kind of business and it worked without problem , have you checked that in everyview you initialize you appdelegate instance? if not please check this and
also in your plist file , you should state that app will play audio in background to get the support for that.
hope this answer will help! :)

Playing a real time video stream from iPhone camera on a 20 second delay

I am trying to see if it is possible to record a video from the iPhone's camera and write this to a file. I then want the video to start playing on the screen a set time after. This all needs to happen continuously. For example, I want the video on the screen to always be 20 seconds behind what the camera is recording.
Some background:
I have a friend who is a coach and would like for his players to be able to see their last play. This could be accomplished by a feed going to a TV from an iPad always 20 seconds behind what is recorded. This needs to continually run until practice is over. (I would connect the iPad to the TV either with a cable or AirPlay to an Apple TV). The video would never need to be saved and should just be discarded after playing.
Is this even possible with the APIs AVFoundation offers? Will the iPhone let you write to a file and read from a file at the same time to accomplish this? Any other better way to accomplish this?
Thanks for your time.
Instead of writing to a file, how about saving your frames in a circular buffer big enough to hold X seconds of video?
The way I would start to do this would be to look at what's provided in AVCaptureVideoDataOutput and its delegate methods (where you can get the frame data from).

how to get the completed and remaining times of the playing audio using streamer

i am thinking whether the avaudio player is working for audio url content playing........
i am using streamer to play this one but i am showing audioslider to show playing...
to move slider i want to get the time completed playing by streamer.....
any help appreciated...
i used audiostreamer class from github website its working now.....
https://github.com/mattgallagher/AudioStreamer