How can i do streaming of video files using AVPlayerlayer?
You could try using Matt Gallagher's AudioStreamer to stream the songs.
https://github.com/mattgallagher/AudioStreamer
For videos you could use MPMoviePlayerController:
http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:streamURL];
[player play];
Related
I am using MPMoviePlayerController to play .mp4 file, while I'm testing .mp4 recorded in windows platform its working fine, however .mp4 recorded using Android is not playing in my iOS device(iPod touch), Player keeps on buffering it.. Any Idea what could be the problem? And please help me, how to debug the issue in MPMoviePlayerController.
NSURL *file_url = [NSURL fileURLWithPath:filepath];
moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:file_url];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
// moviePlayer.useApplicationAudioSession = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
thanks
I have found the problem, iOS not supporting the audio format, which is recorded in Android. Now I recorded using AAC it is playing fine.
I have a requirement to split a 5 sec video to images /frames from my iphone.
Is it possible using objective C.Any libraries available for this?
Help is highly appreciable.
Thanks,
there are many ways by which you can get images from a video. Some of them are :-
NSURL *videoURL = [NSURL fileURLWithPath:url];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
//Player autoplays audio on init
[player stop];
[player release];
You can also check these links:-
Is there any way other than thumbnail method to take a screenshot of an video in Iphone?
How to take a screenshot from an video playing through MPMediaPlayerController in iPhone?
It may help you :)
Thanks :)
I am creating video based ios application.I am using MPMoviePlayerController for playing video. It is working correctly for local video files but I am not able to play the video for the server link please give me some idea
Here is my code
MPMoviePlayerController * player = [[MPMoviePlayerController alloc] init];
NSURL *url = [NSURL URLWithString:imageName];
player.scalingMode = MPMovieScalingModeFill;
[player setContentURL:url];
[player prepareToPlay];
[player play];
if you want using a MPMoviePlayerController implement that server links or streaming.
refer a this sample code. Will help you a lot: MoviePlayer
i want to create a Live Video Player.. can any one suggest how to make or any SDk available for live Streaming Video Player
Try this...
Live Streaming to iPhone
http://geobray.com/2010/03/26/live-tv-streaming-to-iphone-with-http/
or this
http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=live+streaming+to+iphone
The native iOS MPMoviePlayerController also supports streaming.
There's plenty of information about it on Google and particularly on Apple's Multimedia Programming Guide
As Hagai said,
You can play the lie streaming using MPMoviePlayerController
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"LIVE STREAM LINK"]];
// video player
MPMoviePlayerController *playerViewController = [[MPMoviePlayerController alloc] init];
playerViewController.contentURL = url;
playerViewController.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:playerViewController.view];
[playerViewController play];
Thats all you need to perform
I have an iPhone application which requires me to play a looping mp3 sound during the entire lifetime of app.
But based on some actions performed by user this mp3 should stop/pause for while & another mp3 should play & then this mp3 should resume playing again.
I havent really used any audio API on iPhone yet, I've just used AudioToolbox for playing sounds on button taps thats all.
So what do you guys recommend I should do.
Any pointers...? suggestions....?
just as I wrote in this post, you can use AVAudioPlayer
code extract:
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:#"mySound" ofType:#"mp3"];
NSURL *soundFileURL = [NSURL URLForString:soundFilePath];
AVAudioPlayer *player = [[AVAudioPlayer alloc]initWithContentsOfURL:soundFileURL];
player.numberOfLoops = -1; //infinite
[player play];
and you can pause it with:
[player pause];