diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-04-06 18:57:56 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-04-06 18:57:56 +0200 |
| commit | 3a35d6f81f4c17310baa29b0d077e8a70bf2f5dd (patch) | |
| tree | 763e2ce13d9b8e64fa07fedae383a6b2cad4d86c /frontend/site/projects/museum/views/text.overlay.js | |
| parent | 477bd86c8f1be01ec2fb2d1f99f964b78690d135 (diff) | |
nora text placement
Diffstat (limited to 'frontend/site/projects/museum/views/text.overlay.js')
| -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, }) |
