# Playback tutorial 4: Progressive streaming # Goal [Basic tutorial 12: Streaming](Basic%2Btutorial%2B12%253A%2BStreaming.html) showed how to enhance the user experience in poor network conditions, by taking buffering into account. This tutorial further expands [Basic tutorial 12: Streaming](Basic%2Btutorial%2B12%253A%2BStreaming.html) by enabling the local storage of the streamed media, and describes the advantages of this technique. In particular, it shows: - How to enable progressive downloading - How to know what has been downloaded - How to know where it has been downloaded - How to limit the amount of downloaded data that is kept # Introduction When streaming, data is fetched from the network and a small buffer of future-data is kept to ensure smooth playback (see [Basic tutorial 12: Streaming](Basic%2Btutorial%2B12%253A%2BStreaming.html)). However, data is discarded as soon as it is displayed or rendered (there is no past-data buffer). This means, that if a user wants to jump back and continue playback from a point in the past, data needs to be re-downloaded. Media players tailored for streaming, like YouTube, usually keep all downloaded data stored locally for this contingency. A graphical widget is also normally used to show how much of the file has already been downloaded. `playbin2` offers similar functionalities through the `DOWNLOAD` flag which stores the media in a local temporary file for faster playback of already-downloaded chunks. This code also shows how to use the Buffering Query, which allows knowing what parts of the file are available. # A network-resilient example with local storage Copy this code into a text file named `playback-tutorial-4.c`.
This tutorial is included in the SDK since release 2012.7. If you cannot find it in the downloaded code, please install the latest release of the GStreamer SDK. |
On Windows this file is usually created inside the |