diff options
Diffstat (limited to 'frontend/site/projects/museum/views')
| -rw-r--r-- | frontend/site/projects/museum/views/text.overlay.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/frontend/site/projects/museum/views/text.overlay.js b/frontend/site/projects/museum/views/text.overlay.js index 9627901..cb141e7 100644 --- a/frontend/site/projects/museum/views/text.overlay.js +++ b/frontend/site/projects/museum/views/text.overlay.js @@ -25,10 +25,24 @@ class TextOverlay extends Component { if (this.props.location.pathname !== prevProps.location.pathname) { this.load() } + if ( + this.props.popups !== prevProps.popups + && this.state.content + && this.state.content.popup + && this.props.popups[this.state.content.popup] + && this.state.content.audio_url + ) { + this.props.audio.player.stop("text-overlay") + this.props.audio.player.playURL({ + id: "text-overlay", + url: this.state.content.audio_url, + }) + } } load() { const { page_name } = this.props.match.params + this.props.audio.player.stop("text-overlay") if (TEXT_OVERLAYS[page_name]) { this.setState({ content: TEXT_OVERLAYS[page_name], @@ -78,6 +92,7 @@ class TextOverlay extends Component { } const mapStateToProps = state => ({ + audio: state.audio, popups: state.site.popups, interactive: state.site.interactive, }) |
