Not real partial
confact opened this issue · 4 comments
Turbolinks 3.0 announced partial loading so i changed to that to make my mp3 player to work when browsing around. This trigger some event though so it get paused on every browse visit.
This is the steps:
- Navigated to http://localhost:3000/
- click play, music starts
- click on menu link
- turbolinks start load (nbprogress)
- Music stops.
- new page loaded (player still showing, indicating that it really was not touched by turbolinks)
Looking on the event triggered, pause/stop on jplayer is getting triggered on the load.
Anyway to fix this?
I have this issue on production so: https://dirble.com/ <-- drag mouse over station logo, click play, click on any link to trigger turbolinks, turbolinks fetch page, music stops.
Okay, sorry for spamming, but i made a workaround with calling
$('#player').jPlayer("play");
on page:change, bit ugly but works.
Is not this related to jPlayer
? Maybe it has code to trigger pause/stop events on the load.
Reproduced using standard <audio>
/ <video>
elements and data-turbolinks-permanent
. Unfortunately it appears browsers always stop playback of those elements when they're transferred from one document to another, so we can't fix this in Turbolinks.
I'll add a list of know issues like this and #511 to the README soon.