
# Listening music

<!--wodoc:aside class="concepts"-->**Concepts**

Persistence of the client application<!--wodoc:end-->

We will add an audio player to the page that will stay when page changes. This emphasises the fact that browsing inside an application does not stop the client side code: the music keeps playing when the content of the page and the url change.

We first create the player node at toplevel.

```ocaml
let player =
  Eliom_content.Html.Id.create_global_elt
    (audio
       ~srcs:(make_uri (Eliom_service.static_dir ())
                  ["music.ogg"],
              [])
       ~a:[a_autoplay (`Autoplay);a_controls (`Controls)]
       [txt "Your browser does not support audio element" ])
```
And we insert the player in the page.

And that's all\! Since the `player` node is declared unique, no new player is created when the page changed: this is exact same node.

<!--wodoc:aside class="wip"-->**Work in progress**

In fact browsers stop the player as soon as the dom element is manipulated. That happens when we change the page: to continue playing the player should not be present as an element of the page<!--wodoc:end-->

To run this example, you will need to add an ogg file in the static directory. If you can't find one, there is one here: [http://www.gnu.org/music/free-software-song.html](http://www.gnu.org/music/free-software-song.html).
