Update theme submodule
[platform/upstream/gstreamer.git] / tutorial-ios-a-complete-media-player.md
1 # iOS tutorial 5: A Complete media player
2
3 ## Goal
4
5 ![screenshot0]
6 ![screenshot1]
7
8 This tutorial wants to be the “demo application” that showcases what can
9 be done with GStreamer on the iOS platform.
10
11 It is intended to be built and run, rather than analyzed for its
12 pedagogical value, since it adds very little GStreamer knowledge over
13 what has already been shown in [](tutorial-ios-a-basic-media-player.md).
14
15 It demonstrates the main functionality that a conventional media player
16 has, but it is not a complete application yet, therefore it has not been
17 uploaded to the AppStore.
18
19 ## Introduction
20
21 The previous tutorial already implemented a basic media player. This one
22 simply adds a few finishing touches. In particular, it adds the
23 capability to choose the media to play, and disables the screensaver
24 during media playback.
25
26 These are not features directly related to GStreamer, and are therefore
27 outside the scope of these tutorials. Only a few implementation pointers
28 are given here.
29
30 ## Selecting the media to play
31
32 A new `UIView` has been added, derived from `UITableViewController`
33 which shows a list of clips. When one is selected, the
34 `VideoViewController` from [](tutorial-ios-a-basic-media-player.md) appears
35 and its URI property is set to the URI of the selected clip.
36
37 The list of clips is populated from three sources: Media from the
38 device’s Photo library, Media from the application’s Documents folder
39 (accessible through iTunes file sharing) and a list of hardcoded
40 Internet addresses, selected to showcase different container and codec
41 formats, and a couple of bogus ones, to illustrate error reporting.
42
43 ## Preventing the screen from turning off
44
45 While watching a movie, there is typically no user activity. After a
46 short period of such inactivity, iOS will dim the screen, and then turn
47 it off completely. To prevent this, the `idleTimerDisabled` property of
48 the `UIApplication` class is used. The application sets it to YES
49 (screen locking disabled) when the Play button is pressed, so the screen
50 is never turned off, and sets it back to NO when the Pause button is
51 pressed.
52
53 ## Conclusion
54
55 This finishes the series of iOS tutorials. Each one of the preceding
56 tutorials has evolved on top of the previous one, showing how to
57 implement a particular set of features, and concluding in this Tutorial
58 5. The goal of Tutorial 5 is to build a complete media player which can
59 already be used to showcase the integration of GStreamer and iOS.
60
61 It has been a pleasure having you here, and see you soon!
62
63   [screenshot0]: images/tutorial-ios-a-complete-media-player-screenshot-0.png
64   [screenshot1]: images/tutorial-ios-a-complete-media-player-screenshot-1.png