mpmovieplayercontroller

MPMoviePlayerController - catching network errors when loading a movie

时光毁灭记忆、已成空白 提交于 2019-12-05 07:12:35
Is there a way of catching exceptions (particularly for network errors / no connection available) when using a MPMoviePlayerController? I am particularly concerned that once an instance of the player is initialised with initWithURL: you have no way of knowing whether the movie load has failed for some reason. I have reviewed the available documentation and realise I can get a notification for loadState changes through moviePlayerLoadStateChanged:(NSNotification*)notification. Problem is the loadState constants available don't cater for error handling: MPMovieLoadStateUnknown

iOS Mirroring MPMoviePlayerController to TV with TV screen playback in fullscreen

浪子不回头ぞ 提交于 2019-12-05 06:55:34
问题 I have an App with video (locally stored) playback using MPMoviePlayerController NSString *deviceDir = [[NSUserDefaults standardUserDefaults] stringForKey:WZLDEVICEPATH]; NSString *videopath = [deviceDir stringByAppendingPathComponent:video] NSURL *url = [NSURL fileURLWithPath:videopath]; player = [[MPMoviePlayerController alloc] initWithContentURL:url]; CGRect viewInsetRect = CGRectInset (playerframe, 0.0, 0.0 ); /* Inset the movie frame in the parent view frame. */ [[player view] setFrame

MPMoviePlayerController does not remove view when clicking done

删除回忆录丶 提交于 2019-12-05 05:33:28
I am creating a MPMoviePlayerController object and streaming a video in full screen mode. I am using a UIViewController to display the movie view. - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //http://www.youtube.com/watch?feature=player_detailpage&v=ebeQaznNcmE NSURL *url = [NSURL URLWithString:@"http://a1408.g.akamai.net/5/1408/1388/2005110405/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_mpeg4.mp4"]; MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc]initWithContentURL:url]; mPlayer.view.frame = gMainView.frame; [[NSNotificationCenter

How do I replace MPMoviePlayer notifications?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:28:30
In iOS 9 MPMoviePlayer and all his components are deprecated. We used MPMoviePlayerController notifications, like MPMoviePlayerLoadStateDidChangeNotification, MPMovieDurationAvailableNotification, MPMoviePlayerPlaybackStateDidChangeNotification, MPMoviePlayerReadyForDisplayDidChangeNotification , to track video service quality. But now with AVPlayerViewController I can't find properly replacement for these notifications. How do I replace these notifications now? AVPlayerViewController is a lot different in its usage from the MPMoviePlayerViewController . Instead of using notifications you use

MPMoviePlayerController can exit fullscreen but topbar is gone

左心房为你撑大大i 提交于 2019-12-05 02:47:07
问题 I am streaming a movie on the iPad using MPMoviePlayerController . When the user rotates the device to landscape, I animate it to fullscreen . If the user then taps ' exit fullscreen ' or 'done', the movie animates back to its small frame (native behavior), BUT-- the top bar (navigation bar) is gone . Also, the visible views have moved upwards, behind and beyond the status bar. Note that I haven't touched the top bar whatsoever. I have not manually hidden it. I have tried regaining the

Why MPMoviePlayerController fullscreen button icon change to caption icon in iOS 10?

三世轮回 提交于 2019-12-05 02:37:42
I try to use MPMoviePlayerController as embedded video player but I spot a problem where the fullscreen icon were changed in iOS 10? Is there any solution to change it back to original fullscreen button ? Thank you, This is what it look like in iOS 8 and iOS 9: This is what it look like in iOS 10: Here is some code to workaround that iOS 10 bug that you can write in a WorkaroundInlinePlayerFullScreenButtonBug.m file: @import MediaPlayer; @import ObjectiveC; static void (*configureAuxiliaryButtonsIMP)(id, SEL, BOOL); static void ConfigureAuxiliaryButtons(id self, SEL _cmd, BOOL flag) {

MPMoviePlayerController doesn't play from Documents folder

Deadly 提交于 2019-12-05 02:00:07
问题 Desperated. Hello everybody! I am having some issues with MPMoviePlayerController. I've made it working with videos from NSBundle. But that's not what I need. I need to play it from Documents directory, because that is the place I store the recorded videos, wich URLs are stored in CoreData. but lets leave this aside, and simplify the code to its minimum needed. This code actually WORKS if using the contentURL, wich leads to NSBundle. After it, what I do to get to the docs place. What I do:

How do you get an iphone MPMoviePlayer video's total time?

我怕爱的太早我们不能终老 提交于 2019-12-05 01:41:55
问题 I just want to figure out how to get a video's total time in seconds. Is there video metadata that loads or something? 回答1: MPMoviePlayerController has a property duration (iOS 3.2+): The duration of the movie, measured in seconds. (read-only) @property (nonatomic, readonly) NSTimeInterval duration If the duration of the movie is not known, the value in this property is 0.0. If the duration is subsequently determined, this property is updated and a MPMovieDurationAvailableNotification

MPMoviePlayerViewController, remove quicktime symbol/add background image?

时间秒杀一切 提交于 2019-12-05 01:35:50
问题 I have an MPMoviePlayerViewController that plays audio. I would like to remove the Quicktime logo and/or add a custom background image to the player but keep the playback controls. I swear I have done this before prior to iOS 5 but I can't re-figure it out! Things I have tried: -Adding a subview to MPMoviePlayerViewController. Puts the subview OVER the playback controls, not good. -setBackgroundColor of the moviePlayer with a patternimage. Doesn't do anything. -setView on the entire

MPMoviePlayerController Audio show “Done” Button

☆樱花仙子☆ 提交于 2019-12-05 01:30:03
问题 I use the MPMoviePlayerController to Play an Audio Stream. My code follows the example at: http://iosdevelopertips.com/video/getting-mpmovieplayercontroller-to-cooperate-with-ios4-3-2-ipad-and-earlier-versions-of-iphone-sdk.html Everything works fine, but while the stream is playing there is no "done" button to close the Player. I tested it first with a normal .mp3 file. With the file the only possibility I found is to skip to the end, so the player gets the