Problem/Motivation
Just doing a little investigation for a possible project for a small community radio station. They have a live audio stream. I made a custom code component in Drupal Canvas of an audio player with start/stop buttons, but when you click a link, the component gets recreated, and the stream stops.
So I thought of this module and the view transition API as a solution -- turn the site into a SPA and let the player continue playing!
But... it doesn't solve the problem. When you click a link, the entire body gets replaced, including the audio component, interrupting the stream.
Steps to reproduce
Place some component anywhere on the page that you want to persist through page navigation. Navigate to a new page -- the component loses its state.
Proposed resolution
Create an option to specify a container on the page to swap, instead of the entire page -- e.g. the Main Content region -- is this feasible?
Remaining tasks
Create POC/code.
User interface changes
New config option to swap the entire page, or just the main content area.
API changes
Data model changes
Issue fork view_transitions-3558681
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
freelockThis seems to work fine!
Comment #6
brianperryThanks for the contribution @freelock!