Skip to content

Conversation

@tf
Copy link
Member

@tf tf commented Oct 23, 2020

Before, changing to a section without atmo only paused the atmo multi
player without changing its current file id. When a media content
element in a section without atmo was then set to turn down atmo
during playback, pausing the media element resumed the atmo that had
been playing for a previous section.

To work around this issue, we always fade the multiplayer on section
change - even to an undefined audio file perma id if non is given. We
change the PlayerSourceIDMap to return a Null player if no sources
can be found for the passed id. When moving back and forth between a
section with atmo and an adjacent section without atmo, this will now
cause players for the same audio file to be requested whenever we
enter the section with atmo. To prevent creating multiple players in
this case, we change the map to return the current player if it
matches the passed audio file id.

Now that undefined sources are a handled case, we can also fix another
issue. So far, sources were only ever added to the
PlayerSourceIDMap. When deleting an audio file that was previously
used as atmo, the sources would remain in the map, causing the atmo to
contnue playing every time the section is encountered, even though the
file is no longer visible in the atmo input view. After reloading the
entry, players for undefined sources were requested.

We therefore update SectionAtmo to update the sources mapping also
when no sources are found. That way atmo continues playing, when the
file is deleted. But once the section is left and entered again the
mapping will be updated and no atmo will be played.

REDMINE-18017

Before, changing to a section without atmo only paused the atmo multi
player without changing its current file id. When a media content
element in a section without atmo was then set to turn down atmo
during playback, pausing the media element resumed the atmo that had
been playing for a previous section.

To work around this issue, we always fade the multiplayer on section
change - even to an undefined audio file perma id if non is given. We
change the `PlayerSourceIDMap` to return a `Null` player if no sources
can be found for the passed id. When moving back and forth between a
section with atmo and an adjacent section without atmo, this will now
cause players for the same audio file to be requested whenever we
enter the section with atmo. To prevent creating multiple players in
this case, we change the map to return the current player if it
matches the passed audio file id.

Now that undefined sources are a handled case, we can also fix another
issue. So far, sources were only ever added to the
`PlayerSourceIDMap`. When deleting an audio file that was previously
used as atmo, the sources would remain in the map, causing the atmo to
contnue playing every time the section is encountered, even though the
file is no longer visible in the atmo input view.  After reloading the
entry, players for undefined sources were requested.

We therefore update `SectionAtmo` to update the sources mapping also
when no sources are found. That way atmo continues playing, when the
file is deleted. But once the section is left and entered again the
mapping will be updated and no atmo will be played.

REDMINE-18017
@tf tf added this to the v15.4 milestone Oct 23, 2020
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.193% when pulling 62c8b55 on tf:atmo-fixes into 58ab46c on codevise:master.

@tf tf merged commit 67d1546 into codevise:master Oct 26, 2020
@tf tf deleted the atmo-fixes branch October 26, 2020 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants