mpmovieplayercontroller

MPMoviePlayerController playing YouTube video

对着背影说爱祢 提交于 2019-12-07 22:39:32
问题 How can I play a YouTube video in an MPMoviePlayerController on the iPhone while avoiding going into fullscreen mode? This question has been raised here: MPMoviePlayerController is playing YouTube video? and here: Play Youtube video in MPMoviePlayerController or play RTSP - 3GP link with answers claiming such functionality was impossible. Yet this app, Deja, has exactly the functionality I would like: a seamless MPMoviePlayerController whose frame I have explicit control over. http://itunes

Set ContentURL of MPMoviePlayerController twice

丶灬走出姿态 提交于 2019-12-07 17:04:09
问题 I create an embedded MPMoviePlayerController thusly inside my loadView method: self.moviePlayerController = [[[MPMoviePlayerController alloc] init] autorelease]; // add to view, setup moviePlayerController's view frame, etc And I can later load a movie the user chooses thusly: NSURL *fileUrl = ... self.moviePlayerController.contentURL = fileUrl; and everything works great. However, if I set the contentURL again: NSURL *fileUrl2 = ... self.moviePlayerController.contentURL = fileUrl2; This does

MPMoviePlayerController not showing controls until video is loaded

爷,独闯天下 提交于 2019-12-07 15:07:13
问题 I've an application based on iOS4, with a: MPMoviePlayerController and this settings: moviePlayerController.movieSourceType = MPMovieSourceTypeStreaming; moviePlayerController.controlStyle = MPMovieControlStyleDefault; Everything is working good, except that, when I present the MPMoviePlayerController view, it doesn't display controls until the video is pre-loaded. I know in previous version of iOS (3.x), controls are displayed as soon as MPMoviePlayer is presented. Any chance to have this

MPMoviePlayerController fullscreen in landscape mode in a portrait project

六眼飞鱼酱① 提交于 2019-12-07 14:35:47
问题 in my app i have selected only the portrait mode in the project setting: and i use it in this way: player = [[MPMoviePlayerController alloc] init]; [player setContentURL:videoURL]; [player play]; but when i display a video using MPMoviePlayerController in full screen and i try to rotate it, doens't rotate, and stay in portrait , there is a simple way without enable the landscape mode in the project setting, to active the landscape in fullscreen? 回答1: You have 2 options: Enable landscape mode

How to check whether a video or audio file format is playable in iPhone programmatically?

随声附和 提交于 2019-12-07 13:29:21
I have some audio and video files stored in a server. I need to play them, but I do not know the files stored in server supported by iphone to play, How can I check whether the file is supported by IPhone before start playing, I am using MPMoviePlayerController to play the files. Satyam Before playing them, its not possible to identify. Movie player will throw error when incorrect format of file is passed to it. For that, first you have to observe for noticiation: MPMoviePlayerLoadStateDidChangeNotification as following: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector

MPMoviePlayerController play video starting from 30th sec (from mid of the video)

拈花ヽ惹草 提交于 2019-12-07 12:24:47
问题 I am creating a simple media player using MPMoviePlayerController , here I want to play the videos from particular point like from 30th sec or 50th second onwards and also want to move the video player head to any particular point and start playing it from that point. I tried with initialPlaybackTime and MPMoviePlaybackStateSeekingForward but no luck. video is not from local, its from server. Please help me to do the same. 回答1: MPMoviePlayerController *mp; mp.initialPlaybackTime = 84; mp

How to play multiple videos smoothly in iOS in UICollectionView?

元气小坏坏 提交于 2019-12-07 10:48: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 =

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

ε祈祈猫儿з 提交于 2019-12-07 10:12:38
问题 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. 回答1: 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

MPMoviePlayerController autoplays when streaming - how do I stop it?

孤人 提交于 2019-12-07 08:55:27
问题 I'm streaming a movie on the iPad. If I just load a mp4 file, the player doesn't autostart - but with the example m3u8, it insists on autostarting. Has anyone encountered this? Am I doing something wrong? - (id)initWithVideo:(VideoDO*)video frame:(CGRect)rect { NSURL* videoURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]; // With this URL, player starts automatically self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];

How to show “Loading Movie…” message with MPMoviePlayerController

老子叫甜甜 提交于 2019-12-07 08:45:52
问题 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