mpmovieplayercontroller

How to play multiple videos smoothly in iOS in UICollectionView?

只谈情不闲聊 提交于 2019-12-05 16:19:09
I want to play multiple videos in infinite loop in my collection view. Each Video represent a cell. I am using ALAsset. I am playing this using AVPLayer but it's not loading and playing smoothly. Any Suggestions. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath]; CGRect attachmentFrame = CGRectMake(2, 2, cell.frame.size.width-4, cell.frame.size.height-4); ALAsset *asset = self.assets[indexPath

Airplay: Playing a Movie from MPMoviePlayerController results in only audio being streamed to Apple tv

 ̄綄美尐妖づ 提交于 2019-12-05 15:37:57
Setting up Airplay was easy enough. self.moviePlayer = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease]; [self.moviePlayer setAllowsAirPlay:YES]; However, when I try to play a video, only the audio is streamed. The video continues to play on the iPad. Additionally, the Airplay control only shows the "Audio Only" icon in the source list. (see photo). This makes me think that iOS "thinks" that only audio is playing. I have several other apps with Airplay on my device and they work correctly. I have cycled both the Apple tv and the iPad on and off. Both the iPad and the

iOS Determine Number of Frames in Video

落花浮王杯 提交于 2019-12-05 15:33:36
If I have a MPMoviePlayerController in Swift: MPMoviePlayerController mp = MPMoviePlayerController(contentURL: url) Is there a way I can get the number of frames within the video located at url ? If not, is there some other way to determine the frame count? Rhythmic Fistman I don't think MPMoviePlayerController can help you. Use an AVAssetReader and count the number of CMSampleBuffer s it returns to you. You can configure it to not even decode the frames, effectively parsing the file, so it should be fast and memory efficient. Something like var asset = AVURLAsset(URL: url, options: nil) var

How to show “Loading Movie…” message with MPMoviePlayerController

老子叫甜甜 提交于 2019-12-05 14:43:37
I'm working with the MPMoviePlayerController for the iOS platform and am not sure why the "Done" and "Loading Movie..." controls are not displaying automatically when loading a new video. My original implementation of this was to use the UIWebView control to stream the videos, and when the videos are accessed, the "Done" and "Loading Movie..." controls are displayed until the video is loaded and ready to play. I would like to reproduce the same user experience with the MPMoviePlayerController. Should I get the "Done" and "Loading Movie..." control overlays for free? If not, what do I have to

app crashes after checking network reachability in iphone?

岁酱吖の 提交于 2019-12-05 13:56:56
i have a mpmovieplayercontroller to play online music and avaudiosession to play the same music at background, when the first time app launches without network access, normally i shows "no internet connection" , when i tried after connecting to internet and playing it shows the error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer' my code is here static MPMoviePlayerController *player=nil; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self =

How to get touch/click on a MPMoviePlayerController view when MPMovieControlStyle = MPMovieControlStyleNone

自作多情 提交于 2019-12-05 11:57:05
In one of my application, I don't want to show any video controllers. But I need to get the touch on the media player view. I need to do some other action on touch on the movie player. How can I implement that. Please help Thanks in advance. You can always attach a UITapGestureRecognizer to the view and handle the taps. UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; [moviePlayer.view addGestureRecognizer:tap]; [tap release]; And handle the tap in handleTap: - (void)handleTap:(UITapGestureRecognizer *)gesture { // Do some other

MPMoviePlayerController Overlay iOS 6

╄→гoц情女王★ 提交于 2019-12-05 11:19:23
Having an issue with MPMoviePLayerController with an overlay in iOS6, prior to iOS6 things were working fine. It seems I can play a movie in full screen, before I had this code: @interface MovieOverlayViewController : UIViewController { UIImageView *skiparrow; } @end @implementation MovieOverlayViewController -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; touchtoskip.frame = CGRectMake( xAdjust, yAdjust, touchtoskip.image.size.width / scale, touchtoskip.image.size.height / scale); [self.view addSubview:touchtoskip]; } Then: overlay = [[MovieOverlayViewController alloc

MPMoviePlayerViewController | Allow landscape mode

隐身守侯 提交于 2019-12-05 10:07:16
问题 I'm trying to stream a video in my app. The method I've found is : NSURL *theMovieURL = [NSURL URLWithString:self.data.trailer]; if (theMovieURL) { self.movieController = [[MPMoviePlayerViewController alloc] initWithContentURL:theMovieURL]; [self presentMoviePlayerViewControllerAnimated:self.movieController]; [self.movieController.moviePlayer play]; } I'm not sure if it's the most conventional, but it works. The problem is that I can't figure out how to allow the landscape mode, for the video

Playing Movies from ITunes using MPMoviePlayerController?

不想你离开。 提交于 2019-12-05 08:42:17
I'm trying to play a movie acquired from iTunes. The movie was placed in my sandbox via File Sharing/iTunes Transfer. The application is using MPMoviePlayerController or MPMoviePlayerViewController . I can use either, but neither have work properly on an iTunes movie. Below is what I am observing: Test Movie Acquired from Hillegass (Chapter 20) - OK [1] Acquired from Apple's sample - OK [2] Apple Video app - OK iTunes Movie No video No audio Silent failure in my application [3] Silent failure in Hillegass' sample [3] Silent failure in Apple's sample [3] Apple Video app - OK When the view is

MPMoviePlayerViewController backgrounding deal. How to continue playing after returning from background to foreground?

▼魔方 西西 提交于 2019-12-05 07:13:33
问题 I'm working on application for video streaming. It is built with ARC for iOS5. To display view I use MPMoviePlayerViewController this way: .h @interface EpisodesTableViewController : UITableViewController<EpisodeUrlResolverDelegate> { NSTimeInterval playbackTime; EpisodeUrlResolver *episodeUrlResolver; } @property (strong, nonatomic) MPMoviePlayerViewController *player; @end .m @implementation EpisodesTableViewController @synthesize episodes, player; - (void)viewDidLoad { [super viewDidLoad];