mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
tutorials: ios: basic: fix missing markup
This commit is contained in:
parent
46932561bf
commit
27860cb090
1 changed files with 13 additions and 16 deletions
|
@ -5,8 +5,8 @@
|
|||
![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
|
||||
|
@ -91,7 +91,7 @@ Also note that the class has been renamed from `ViewController` to
|
|||
|
||||
## 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:
|
||||
|
||||
|
@ -390,7 +390,7 @@ To the left of the Seek Bar (refer to the screenshot at the top of this
|
|||
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:
|
||||
|
||||
|
@ -446,8 +446,7 @@ the Slider.
|
|||
`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
|
||||
|
@ -910,16 +909,15 @@ one):
|
|||
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 */
|
||||
|
@ -978,8 +976,7 @@ right before entering the main loop:
|
|||
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
|
||||
|
@ -1021,7 +1018,7 @@ need to honor the calls to `setPosition` and instruct the pipeline to
|
|||
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
|
||||
|
@ -1060,7 +1057,7 @@ the `state_changed_cb()` callback:
|
|||
}
|
||||
```
|
||||
|
||||
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()`.
|
||||
|
||||
|
@ -1185,7 +1182,7 @@ static void buffering_cb (GstBus *bus, GstMessage *msg, GStreamerBackend *self)
|
|||
|
||||
`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
|
||||
|
@ -1207,4 +1204,4 @@ The next tutorial adds the missing bits to turn the application built
|
|||
here into an acceptable iOS media player.
|
||||
|
||||
[information]: images/icons/emoticons/information.png
|
||||
[screenshot]: images/tutorials/ios-a-basic-media-player-screenshot.png
|
||||
[screenshot]: images/tutorials/ios-a-basic-media-player-screenshot.png
|
||||
|
|
Loading…
Reference in a new issue