mpmovieplayercontroller

how to resolve when MPMediaItem assetURL is nil?

拈花ヽ惹草 提交于 2019-12-10 13:45:17
问题 I'm working on code that looks at the user's videos and passes them along to AVPlayer by way of an AVPlayerItem which takes a URL. To get all the videos on an iOS device, you can do: let videoNumber = MPMediaType.anyVideo.rawValue let predicate = MPMediaPropertyPredicate.init(value: videoNumber, forProperty: MPMediaItemPropertyMediaType) let query = MPMediaQuery.init() query.addFilterPredicate(predicate) if let items = query.items { mediaCollection = MPMediaItemCollection(items: items) // -1

MPMoviePlayerController stops working in full screen mode // portrait orientation // iOS 7

♀尐吖头ヾ 提交于 2019-12-10 13:38:39
问题 In my project I use embeded view, which has MPMoviePlayerController inside. This movie player stops working after tapping full screen toggle - it plays 1 more second in full screen mode and then stops and turns back to the inline mode. It happens only in portrait mode and only for iOS 7 - if I switch on full screen mode with landscape orientation and then rotate the device, it works alright. I've found the reason - somehow navigation bar is involved. I use ECSlidingViewController in the

How to play video using MPMoviePlayerController?

你说的曾经没有我的故事 提交于 2019-12-10 12:58:47
问题 I am using the following code to play the video using the MPMoviePlayerController , but the video is not played. Can anyone tell me why ? NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"/one.mp4"]; NSString *mediaPath = [[[NSBundle mainBundle]resourcePath] stringByAppendingPathComponent:filePath];

[AVPlaybackItem fpItem]: message sent to deallocated instance

拈花ヽ惹草 提交于 2019-12-10 12:16:49
问题 I play a movie with MPMoviePlayerController. Later, the app is "restarted" (meaning a pseudo-reset, where all viewControllers are removed and the user returns to the home screen), and the same movie is played again. This leads to a crash in iOS 3.2.2 on the iPad: [AVPlaybackItem fpItem]: message sent to deallocated instance I have no idea where that comes from. Seems to be something private. Has anyone experienced and possibly solved the same problem? The stack trace for that particular

How to play the next youtube video in a playlist using XCDYouTubeKit for Swift?

て烟熏妆下的殇ゞ 提交于 2019-12-10 11:52:34
问题 I'm using XCDYouTubeKit, written as a subclass of MPMoviePlayerViewController . I'm having an issue playing the next video in my playlist. When I tap the forward button, the state of the player is stopped, and I'm not sure how to resume it? Here's my code: override func viewDidLoad() { super.viewDidLoad() youtubeVideoPlayer = XCDYouTubeVideoPlayerViewController(videoIdentifier: videoID) self.view.addSubview( (youtubeVideoPlayer?.view)! ) NSNotificationCenter.defaultCenter().addObserver( self,

MPMoviePlayerController dismissing full screen mode not working in iOS 6

∥☆過路亽.° 提交于 2019-12-10 10:21:58
问题 The MPMoviePlayerController working fine in iPad with iOS 5, initially the video starts by adding MPMoviePlayerController to subview of self at certain frame .Pressing full screen button on MPMoviePlayerController embedded controls displaying the movie in full screen,again tapping the button will bring the video back to the initial frame in iOS 5. But in iOS 6, the when I press full screen button to bring the video to initial frame, the video just gone out of screen. Looks like Apple has made

player.duration shows always zero in MPMoviePlayerController for video file

故事扮演 提交于 2019-12-10 02:28:41
问题 I am playing a small video in mpmediaplayer controller using this code MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:videostr]]; where videostr is path of that video file. Now i need to get length of that video file for that i am using this code. length = player.duration; But it always shows 0.000. But the video is playing well. I am checking by googling every where code to get video duration is player.duration only. And i try

iOS 7 MPMoviePlayerController seek forward button brings the video to the End and displays Black screen

谁都会走 提交于 2019-12-10 01:50:16
问题 I am facing an issue with MPMoviePlayerController in iOS 7. I enter the fullscreen and then click (just a single tap) on seek forward button (>>|) , and the video playback ends and gives a black screen with a text "Loading" on the header. I registered notification for " MPMoviePlayerPlaybackStateDidChangeNotification ". **[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerPlaybackStateDidChange:) name:MPMoviePlayerPlaybackStateDidChangeNotification object

Cache Progressive downloaded content in MPMoviePlayerController

我的未来我决定 提交于 2019-12-10 01:37:07
问题 I have a music player implemented in iphone (sdk 4) and it works both with streaming of Mp3 (Transcoded on the fly) or raw progressive download. Is there anyway to make the progressivedownloaded content (which I dont directly control) to be cached so it doesn redownload the whole content? Or Is there a global cache setting to control? (On a side note, I used ASIHTTP APIs to contact my HTTP server and access data that does allow caching). Thanks in advance. 回答1: You can use NSURLConnection to

how to add text on video in iPhone

 ̄綄美尐妖づ 提交于 2019-12-10 00:25:30
问题 I want to add a text or string ON the video being played by MPMoviePlayerViewController in a way that it becomes part of the video being played. So that, when I post that video on Facebook or Twitter the text must be shown above the video. For this I have tried getting all the frames of the video and then write text on each of those frames and then again make a video of all those frames. But this way, I am getting memory issues and it crashes on the device. - (NSArray*