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

Command icon 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

freelock created an issue. See original summary.

freelock’s picture

Status: Active » Needs review

This seems to work fine!

brianperry made their first commit to this issue’s fork.

  • brianperry committed 8ddf004b on 1.0.x authored by freelock
    Issue #3558681: Add configurable transition target option (body or main...
brianperry’s picture

Status: Needs review » Fixed

Thanks for the contribution @freelock!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.