Questions tagged [mpmovieplayercontroller]

A movie player (of type MPMoviePlayerController) manages the playback of a movie from a file or a network stream. Playback occurs in a view owned by the movie player and takes place either fullscreen or inline. You can incorporate a movie player’s view into a view hierarchy owned by your app, or use an MPMoviePlayerViewController object to manage the presentation for you.

This class plays movie or audio file supported in iOS. This includes both streamed content and fixed-length files.

This class supports programmatic control of movie playback, and user-based control via buttons supplied by the movie player.

The MPMoviePlayerController class generates numerous notifications to keep your application informed about the state of movie playback.

The MPMoviePlayerController class is formally deprecated since iOS 9.

Supported format for MPMoviePlayerController class are below:

Apple documentation: Supported format for video/audio

2218 questions
89
votes
8 answers

Play YouTube videos with MPMoviePlayerController instead of UIWebView

I'm trying to stream some youTube videos using the MPMoviePlayerController but I'm having some problems. The code I'm using is pretty simple and I can play .m4v videos by passing a URL to initWithContentURL. When I launch the movie player the…
jmurphy
  • 1,891
  • 3
  • 22
  • 28
87
votes
1 answer

AVPlayer and MPMoviePlayerController differences

I am developing an iPhone application that needs to play videos. So far, I learned that there are at least two API's for achieving this; AVPlayer and MPMoviePlayerController. What are the main differences?
suse
  • 10,503
  • 23
  • 79
  • 113
51
votes
9 answers

How to receive NSNotifications from UIWebView embedded YouTube video playback

I didn't received any notifications for MPMoviePlayerController. What am I doing wrong? I use following logic. I'm begining to play youtube video in UIWebView. UIWebView calls a standard MPMoviePlayerController. I don't control…
41
votes
4 answers

Playing a video file from a server in Swift

I'm trying to play a video from a server using Swift. I have imported MediaPlayer framework, here is my code: import UIKit import MediaPlayer class VideoViewController: UIViewController { override func viewDidLoad() { …
Mate Hegedus
  • 2,887
  • 1
  • 19
  • 30
37
votes
2 answers

An AVPlayerItem cannot be associated with more than one instance of AVPlayer in iOS 8.4

After updating to iOS 8.4 I am getting the infamous exception with MPMoviePlayerController that says: An AVPlayerItem cannot be associated with more than one instance of AVPlayer I have seen several workarounds that mainly consist of reinitialising…
pajevic
  • 4,607
  • 4
  • 39
  • 73
31
votes
5 answers

Play YouTube videos in iPhone app without using UIWebView?

I want to play YouTube videos from my iPhone app. I have to tried play YouTube videos in my iPhone app with the following codes, [self playVideo:@"http://www.youtube.com/watch?v=WL2l_Q1AR_Q" frame:CGRectMake(20, 70, 280, 250)]; -…
Yuvaraj.M
  • 9,741
  • 16
  • 71
  • 100
31
votes
8 answers

How to play movie files with no file extension on iOS with MPMoviePlayerController or AVPlayer?

I want to play a movie in iOS 4.3 on the iPad. I've successfully used MPMoviePlayerController and AVPlayer to load files from a remote URL when the filename has a file extension. However, when I use a CDN that doesn't return the filename (just an…
Michael
  • 1,355
  • 2
  • 12
  • 15
30
votes
2 answers

AVPlayerItem replaceCurrentItemWithPlayerItem Blocking

First a little context about the application... - There's a lot of heavy UI operation's involving video players (mostly scrolling) - The videos are dynamic and change based on our current page . - so the video's have to be dynamic and keep…
Aatish Molasi
  • 2,138
  • 3
  • 20
  • 43
30
votes
4 answers

iOS: How to use MPMoviePlayerController

I've created a blank project (iOS) and put this in my viewDidLoad: NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"]; MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc]…
Zoltán Matók
  • 3,923
  • 2
  • 33
  • 64
29
votes
7 answers

Done button event MPMoviePlayerController

On my iPhone i'm playing video/audio files in fullscreen mode. When the video/audio file reached its end then the following method is triggered: - (void) movieFinishedCallback:(NSNotification*) aNotification { MPMoviePlayerController *player =…
w00
  • 26,172
  • 30
  • 101
  • 147
28
votes
2 answers

MPNowPlayingInfoCenter defaultCenter will not update or retrieve information

I'm working to update the MPNowPlayingInfoCenter and having a bit of trouble. I've tried quite a bit to the point where I'm at a loss. The following is my code: self.audioPlayer.allowsAirPlay = NO; Class playingInfoCenter =…
Jayson Lane
  • 2,828
  • 1
  • 24
  • 39
28
votes
7 answers

Autorotate in iOS 6 has strange behaviour

I have UITabBarController app which plays video and shows other information in other UITabBar tabs. In iOS 6 UIView rotation methods have been deprecated, and now I need to use shouldAutoRotate and supportedInterfaceOrientations methods. For video…
Timur Mustafaev
  • 4,869
  • 9
  • 63
  • 109
26
votes
6 answers

How to release MPMoviePlayerController?

I have a couple of views that access the movie player. I've put the following code in a method in AppDelegate for these views. They send in the filename to play. The code works fine but I know a release is required somewhere. If I add the last…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
26
votes
11 answers

MPMoviePlayerController breaks/stops after going to fullscreen in iOS6

I have a MPMoviewPlayerViewController embedded into an UIView object. When I start the player in the embedded mode everything works fine and as expected. If the user then taps onto the fullscreen toggle (or if I change to fullscreen programmatically…
snod
  • 2,442
  • 3
  • 20
  • 22
25
votes
13 answers

MPMoviePlayerController showing black empty screen

I use MPMoviePlayerController to play a local file in my Application Document folder which have I have downloaded for a server URL: itemMoviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; [self.view…
Ritika
  • 593
  • 1
  • 8
  • 21
1
2 3
99 100