Prevent resuming atmo of other section #1591
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PlayerSourceIDMapto return aNullplayer if no sourcescan 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 previouslyused 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
SectionAtmoto update the sources mapping alsowhen 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