B
B
bodan66662012-02-05 17:57:25
css
bodan6666, 2012-02-05 17:57:25

Music without breaks on the site when switching between pages

Good day to all.
TK was given: to accompany the site with background music on all pages so that it does not break when clicked.

Options: New HTML 5 audio tag
Use script.
The first option led to breaks: you click on a new page and the music starts again. There is no unity.
The second option was more difficult. Personally, I don’t really know java script, so I used a ready-made script, which was found in a simple way by googling. But the music still cut off.

The question is already obvious: How to make a non-cutting background sound? What ideas? Is it possible?
If anyone has experienced this, please share information and resources.
On flash sites, the principle of operation is clear, but with html I don’t understand the principle of action.

Thanks in advance to anyone who can comment on the situation.

Answer the question

In order to leave comments, you need to log in

9 answer(s)
S
ShpuntiK, 2012-02-05
@ShpuntiK

Implemented this recently. You will need ajax (you can use jquery, you can use pure js) and history api (here I just used pure js).
In short, the algorithm is as follows: the user clicks on the transition to another page of the site, the event is caught and sent to the server via ajax, where the script will give the code of the page to which you want to go. History api should change the address in the address bar of the browser, and if the user presses the back button, then hang an event on it (everything is well described in the article, the link to which I gave above).

A
ainu, 2012-02-05
@ainu

In the right way, you need to do PJAX pjax.heroku.com/
This is done on github and it seems like in contact too.

G
Grigory Peretyaka, 2012-02-05
@Peretyaka

This can't be done with a page reload. Use AJAX technology (example vk.com) or frames, at worst.

K
Konstantin Kitmanov, 2012-02-05
@k12th

Sobsno than to play music in this case - it does not matter. The important thing is that you need to make a transition to another page (or the illusion of a transition) while actually staying on the previous one.
As mentioned above, AJAX/frames and the History API will help you .

N
nertz, 2012-02-05
@nertz

The most bug-free option is to make a frame.
In which you can even show the necessary controls.
JS, Ajax and so on will be an extra hassle.

V
Vitaly Zheltyakov, 2012-02-05
@VitaZheltyakov

This is not possible directly, because there is no means to control rewind in the browser and the playback of sounds is tied to the DOM model.
As a solution, you can abandon the page model of the project in the direction of FullAjax - there are no transitions between pages, no breaks.

K
KeNNy_aKa_MaX, 2012-02-05
@KeNNy_aKa_MaX

Well, apparently you will have to do AJAX transitions between pages, for this it is best to use the jQuery Java-Script library, I think there will be plenty of plugins for it.

B
bodan6666, 2012-02-05
@bodan6666

Thank you. All of these things will need to be explored.
But you showed me the direction of movement

E
edogs, 2012-02-05
@edogs

Of the unmentioned, albeit somewhat dull options
1) frames themselves
2) popunder with a player

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question