![screenshot]
Enough testing with synthetic images and audio tones! This tutorial
-finally plays actual media, streamed directly from the Internet, in your
-iOS device. It shows:
+finally shows how to play actual media in your iOS device; media streamed
+directly from the Internet!. We will review:
- How to keep the User Interface regularly updated with the current
playback position and duration
## The Video View Controller
-The `ViewController `class manages the UI, instantiates
+The `ViewController` class manages the UI, instantiates
the `GStreamerBackend` and also performs some UI-related tasks on its
behalf:
page), there is
a [TextField](https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITextField_Class/Reference/UITextField.html) widget
which we will use to display the current position and duration in
-"`HH:mm:ss / HH:mm:ss"` textual format. The `updateTimeWidget` method
+"`HH:mm:ss / HH:mm:ss`" textual format. The `updateTimeWidget` method
takes care of it, and must be called every time the Seek Bar is
updated:
`sliderTouchDown` is called when the user starts dragging. Here we pause
the pipeline because if the user is searching for a particular scene, we
do not want it to keep moving. We also mark that a drag operation is in
-progress in the
-`dragging_slider` variable.
+progress in the `dragging_slider` variable.
```
/* Called when the time slider position has changed, either because the user dragged it or
We first need to obtain a plain `char *` from within the `NSString *` we
get, using the `UTF8String` method.
-`playbin`’s URI is exposed as a common GObject property, so we simply
+`playbin`’s URI is exposed as a common `GObject` property, so we simply
set it with `g_object_set()`.
### Reporting media size
Some codecs allow the media size (width and height of the video) to
change during playback. For simplicity, this tutorial assumes that they
-do not. Therefore, in the READY to PAUSED state change, once the Caps of
-the decoded media are known, we inspect them
-in `check_media_size()`:
+do not. Therefore, in the `READY` to `PAUSED` state change, once the Caps of
+the decoded media are known, we inspect them in `check_media_size()`:
```
/* Retrieve the video sink's Caps and tell the application about the media size */
g_source_unref (timeout_source);
```
-Then, in the refresh\_ui
-method:
+Then, in the refresh_ui method:
```
/* If we have pipeline and it is running, query the current position and clip duration and inform
jump to the indicated position.
There are, though, a couple of caveats. Firstly, seeks are only possible
-when the pipeline is in the PAUSED or PLAYING state, and we might
+when the pipeline is in the `PAUSED` or `PLAYING` state, and we might
receive seek requests before that happens. Secondly, dragging the Seek
Bar can generate a very high number of seek requests in a short period
of time, which is visually useless and will impair responsiveness. Let’s
}
```
-Once the pipeline moves from the READY to the PAUSED state, we check if
+Once the pipeline moves from the `READY` to the `PAUSED` state, we check if
there is a pending seek operation and execute it.
The `desired_position` variable is reset inside `execute_seek()`.
`target_state` is the state in which we have been instructed to set the
pipeline, which might be different to the current state, because
-buffering forces us to go to PAUSED. Once buffering is complete we set
+buffering forces us to go to `PAUSED`. Once buffering is complete we set
the pipeline to the `target_state`.
## Conclusion
here into an acceptable iOS media player.
[information]: images/icons/emoticons/information.png
- [screenshot]: images/tutorials/ios-a-basic-media-player-screenshot.png
\ No newline at end of file
+ [screenshot]: images/tutorials/ios-a-basic-media-player-screenshot.png