mpmovieplayercontroller

MPMoviePlayerController and local m3u8 files

怎甘沉沦 提交于 2019-12-03 10:17:43
问题 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? 回答1: 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

iPhone App :How to play Youtube video in app using MPMoviePlayerController

China☆狼群 提交于 2019-12-03 10:04:08
iPhone App :How to play Youtube video in app using MPMoviePlayerController for that i write the code: NSString *urlAddress = @"http://www.youtube.com/xyz"; NSLog(@"URL ADDress : %@",urlAddress); //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; movie = [[MPMoviePlayerController alloc] initWithContentURL:url]; movie.scalingMode=MPMovieScalingModeAspectFill; movie.view.frame = CGRectMake(0.0, 0.0, 320.0, 460.0); [self.view addSubview:movie.view]; [movie play]; if i pass the url of local directory it is playing video NSString* filePath = [[[NSBundle mainBundle] bundlePath]

MPMoviePlayerController fullscreen mode issue

强颜欢笑 提交于 2019-12-03 09:54:37
I have a problem with my code that plays a video file. Whenever I play the file in fullscreen mode the playback doesn't occupy all of my screen. Here is the relevant code: NSURL *url = [NSURL fileURLWithPath:@"Somefile.mov"]; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [moviePlayer setControlStyle:MPMovieControlStyleFullscreen]; [moviePlayer setFullscreen:YES]; moviePlayer.view.frame = self.switchView.frame; [self.switchView addSubview:moviePlayer.view]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name

MPMoviePlayerController starting image

只愿长相守 提交于 2019-12-03 09:47:21
问题 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? 回答1: This looks like something for the

Playing a video stream on iOS7

大憨熊 提交于 2019-12-03 09:05:30
I'm trying to play a simple live stream link on iOS. There's one view controller with a button with a play action defined as below. - (IBAction)play:(id)sender { NSString *path = @"http://asish.flashmediacast.com:2135/live/International/playlist.m3u8"; MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:path]]; [mp.view setFrame:[self.view bounds]]; [mp prepareToPlay]; [mp play]; } Well nothing happens when the button's pressed. I've checked the link, it works fine. Where'm I going wrong? I found a solution that tells you to create a

MPMoviePlayerController: How can I make my video loop?

↘锁芯ラ 提交于 2019-12-03 05:55:25
Thank you in advance for any help, I am a newbie and would appreciate any help here.. I have this code to play a movie and it works great. Can somebody PLEASE tell me how to make this movie loop and replay from the beginning non stop ( any code would help). Also I would like to know how to play 2 movies, one after the other, preferably with a fade or smooth transition. Thank you for any help #import "MyAppViewController.h" @implementation MyAppViewController -(IBAction)button:(id)sender{ NSString *path = [[NSBundle mainBundle] pathForResource:@"mymovie" ofType:@"mp4"]; player = [

How to make MPMoviePlayerController ignore the mute switch

落爺英雄遲暮 提交于 2019-12-03 05:43:01
I want to play a video using MPMoviePlayerController but I want it to ignore the mute switch, similar to the behavior of Youtube's video player. Any ideas? Carl Veazey Use the AVAudioSession category AVAudioSessionCategoryPlayback and your app will ignore the mute switch like the Youtube app. For example (inspired by Ken Pletzer in the comments): #import <AVFoundation/AVFoundation.h> // note: you also need to add AVfoundation.framework to your project's // list of linked frameworks NSError *error = nil; BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback

Get Notification when a video starts or stops in UIWebView

元气小坏坏 提交于 2019-12-03 05:20:18
问题 Hello i am new to objective - c I'm having a problem with the UIWebView and MPMoviePlayerController : My UIWebView has a movie inside the html (it's a local html file), I'm using html5 and a video tag for the video. I want a notification when video starts or stops in UIWebView .... I have tried using MPMoviePlayerPlaybackDidFinishNotification , but it doesnt fire ... I have also tried to make the my main UIViewController 's view a view of my own, and intercept -didAddSubview: and

NSURLConnection finished with error - code -1002

喜你入骨 提交于 2019-12-03 04:57:51
Friends i have simple audio player (MPMoviePlayerController) which can play audio stream. On iOS 11 i have very interessing trouble, thousand time i have error and my stream was stopped: NSURLConnection finished with error - code -1002 I paste this code (this code i saw on stackowerflow) but it's not help to me: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key>cast.mysite.com</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict> Maybe you know

MPMoviePlayerController with a Custom Button on its toolbar

半世苍凉 提交于 2019-12-03 03:51:12
You might have seen video through you tube in iPhone. Normal MPMoviePlayerController has previous, next & play/pause buttons. You tube - player has additional two buttons on it. => Add to favorites on the left side. => Email this video on right side. I want to implement the same for my application. But I am failed to find out the property or methods regarding - implementing this. How do I need buttons on it? When User is watching video there should no buttons on screen. When user taps on video - a toolbar comes on top & at center A center tool bar has generally three buttons on it ,Previous -