Chapter 28. Video
Basic video playback is performed in a view owned by a MPMoviePlayerController. You’ll need to link to MediaPlayer.framework and import
<MediaPlayer/MediaPlayer.h>. There are two relevant classes supplied by the Media Player framework:
Vends and controls a view that plays a movie.
The behavior of this class has changed very greatly since it was introduced in iOS 2.0. It is difficult to use it compatibly with multiple system versions. In this chapter, I describe only its current behavior (in iOS 4.2 or later), with no attempt to discuss earlier differences or to advise you on backward compatibility.
- Owns an MPMoviePlayerController, and presents its view as a fullscreen view. Introduced in iOS 3.2.
A simple interface for trimming video (UIVideoEditorController) is also supplied. Starting in iOS 4, sophisticated video editing can be performed through AV Foundation, which this book does not discuss in depth.
A mobile device does not have unlimited power for decoding and presenting video in real time. A video that plays on your computer might not play at all on an iOS device. See the “Media Layer” chapter of Apple’s iOS Technology Overview for a list of specifications and limits within which video is eligible for playing.
A web view (Chapter 24) supports the HTML 5
<video> tag. This can be a simple lightweight way to present video and to allow the user to control playback. Starting in iOS 4.3, both web view ...