mpmovieplayercontroller

Disable Audio (and interruption) with MPMoviePlayerController using Swift

拥有回忆 提交于 2019-12-03 03:45:06
At the moment, this is how I'm playing a video on the subview of my UIViewController: override func viewDidAppear(animated: Bool) { let filePath = NSBundle.mainBundle().pathForResource("musicvideo", ofType: "mp4") self.moviePlayerController.contentURL = NSURL.fileURLWithPath(filePath) self.moviePlayerController.play() self.moviePlayerController.repeatMode = .One self.moviePlayerController.view.frame = self.view.bounds self.moviePlayerController.scalingMode = .AspectFill self.moviePlayerController.controlStyle = .None self.moviePlayerController.allowsAirPlay = false self.view.addSubview(self

MPMoviePlayerPlaybackDidFinishNotification gets called when it shouldn't

自古美人都是妖i 提交于 2019-12-03 03:39:11
According to Apple's MPMoviePlayerController doc: MPMoviePlayerPlaybackDidFinishNotification - This notification is not sent in cases where the movie player is displaying in fullscreen mode and the user taps the Done button. Seems to me this is dead wrong. Using the code below, playerPlaybackDidFinish gets called when I tap the done button. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.player]; - (void) playerPlaybackDidFinish:(NSNotification*)notification { NSLog(@"WHY?"); self

Disappearing status bar at the top after MPMoviePlayerController is closed

♀尐吖头ヾ 提交于 2019-12-03 03:05:32
Having an interesting little problem with my iPhone app. I have a view with a table and each cell, when clicked, plays a video fullscreen then when you press done, the video stops and goes back to the table view. The only problem is, when you press done within the first 2 or 3 seconds of the video loading, when the view goes back to the table view, the bar at the top of the screen that tells the time and battery strength etc is no longer there, its just a white space. But if you press done after the first few seconds, then when you go back to the table view, everything is absolutely fine! I

why does MPMovieLoadState have state 5?

☆樱花仙子☆ 提交于 2019-12-03 02:48:04
I find MPMoviePlayerController.h,there is enum { MPMovieLoadStateUnknown = 0, MPMovieLoadStatePlayable = 1 << 0, MPMovieLoadStatePlaythroughOK = 1 << 1, // Playback will be automatically started in this state when shouldAutoplay is YES MPMovieLoadStateStalled = 1 << 2, // Playback will be automatically paused in this state, if started }; typedef NSInteger MPMovieLoadState; but when i did NSLog(@"%d",player.loadState) it prints out 5 or sometimes 3,how did it happen?As i know the loadstate has value of 0,1,2,4 refer to developer documentation. Thank you! The playState is a bitmask. Any number

Pros and cons of MPMoviePlayerController versus launching UIWebView to stream movie

ぐ巨炮叔叔 提交于 2019-12-03 02:02:11
问题 I have a client who has video content for the web in Flash format. My task is to help them show the videos in an iPhone app. I realize that step one is to get these videos into the appropriate Quicktime format for the iPhone. Then I'm going to have to help the client figure out how or where to host these files. If that's tricky I assume they can be hosted at YouTube. My chief concern, though, is which approach to take to stream the video. What are the pros and cons of MPMoviePlayerController

MPMoviePlayerController starting image

强颜欢笑 提交于 2019-12-03 01:20:33
In my app the instance of MPMoviePlayerController I created starts out as a black box, looking like this (because the video starts out black and fades in): However I was envisioning something more user-friendly like this, with a thumbnail image, like the example below: That's a mockup I created but videos in the cameral roll and videos sent in the Messages app use that play arrow. What class do I need to implement to use the stock iOS play arrow? This looks like something for the thumbnailImageAtTime:timeOption: method of MPMoviePlayerController , you should pass in the time you want to

MPMoviePlayerController and local m3u8 files

醉酒当歌 提交于 2019-12-03 00:46:59
I'm trying to load an m3u8 file that's saved to the local filesystem, but the MPMoviePlayerController refuses to play it, citing "m3u8 is not a supported media type". However, the same m3u8 file plays perfectly fine when I'm accessing it on a remote media server. Is there any workaround that can be used to play local m3u8 files? Well, according the RFC they lay out for m3u8 streaming, it can only be done over HTTP. Personally, I think it's kind of silly to require HTTP when the files can be readily accessed through the file protocol, but them's the breaks. I just used a simple HTTP server to

Getting Timed Metadata in Swift ios 8 From M3U8 Streaming Video

江枫思渺然 提交于 2019-12-03 00:39:00
I'm trying to duplicate this https://jmacmullin.wordpress.com/2010/11/03/adding-meta-data-to-video-in-ios/ in swift. Here is a video of Jake's code in action... Objective C Timed Metadat in HLS stream Here is an additional link to something similar... http://cloudfields.net/blog/metadata-audiostream-mpmovieplayercontroller/ When my video is playing timed metadata should update a button to redirect to a specific youtube url in a webview when clicked. My video is roughly 15 min long and has 6 timed metadata urls. I can't find any code or documentation anywhere on how to achieve this in Swift. I

Play video from cache in iphone programmatically

二次信任 提交于 2019-12-02 23:06:10
I am developing an iPhone application in which I will store stream video from URL directly to cache in local, now I need to play video in movie-player while it was in downloading in cache. I followed this http://lists.apple.com/archives/cocoa-dev/2011/Jun/msg00844.html , but I couldn't do exact. I am able to download video in cache but I couldn't play video from cache. So how can I play while its downloading? Just change your web url to local path url... Try this code... NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"]; NSURL

Cannot get the MPMoviePlayerViewController to play my media file

左心房为你撑大大i 提交于 2019-12-02 20:56:09
问题 Having some issues getting this MPMoviePlayerViewController to work. I have two sample URLs pointing to the same Quicktime movie. The commented out URL doesn't work; the other one works fine. I've monitored both via Fiddler and I can't see any issues in headers/etc. Basically I'm trying to figure out a way to play an Azure hosted media file with some sort of security; either via pass through WCF service. Any one have this figured out? I'm pulling my hair out. //NSString *moviePath = [