diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-11-18 15:37:42 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-11-18 15:37:42 +0100 |
| commit | d351d8dd915c5075983eaa5cac6f0d5a1b99a877 (patch) | |
| tree | 57a89011f201711a902870f7b9a23426d1d40413 /animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js | |
| parent | 50411efc89fabb77c02b472446221e6bcd9ff621 (diff) | |
staggered, cancellable preloading of all section image assets, as soon as the section loads
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js index 60ba7c9..a05789b 100644 --- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js +++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js @@ -1,29 +1,21 @@ import React from 'react' import { CURTAIN_COLOR_LOOKUP } from 'app/constants' +import { displayElementImageURL } from 'app/utils/annotation.utils' + export const FullscreenImage = ({ element, media, transitionDuration }) => { const color = element.color || CURTAIN_COLOR_LOOKUP.white - const item = media.lookup[element.settings.media_id] + const mediaItem = media.lookup[element.settings.media_id] const style = { backgroundColor: color.backgroundColor, color: color.textColor, transitionDuration, } - let url; - // console.log(element, item) - if (item.type === 'gallery') { - const index = parseInt(element.settings.frame_index) - const frame_id = item.settings.image_order[index] - const frame = item.settings.display_lookup[frame_id] - if (!frame) { - console.error("Slide not found:", element.settings.frame_index) - return <div /> - } - url = frame.url - } else { - url = item.settings.display.url + let url = displayElementImageURL(element, mediaItem) + if (!url) { + return <div /> } return ( |
