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pC5B,EAAAA,EAAAA,KAAAoC,EAAAA,SAAA,KACKV,GACG1B,EAAAA,EAAAA,KAACV,EAAmB,CAACE,IAAKA,EAAKC,QAASA,IAAMgC,GAAW,GAAO/B,UAAQ,KAExEM,EAAAA,EAAAA,KAACqC,IAAW,CACR5C,QAASA,IAAMgC,GAAW,GAC1BjC,IAAKA,EACLG,MAAM,OACNG,OAAO,OACPJ,UAAQ,KAOpC,CAOA,MAAMa,GAAiBD,EAAAA,EAAAA,KAAG,2CAGFgC,EAAAA,GAAUC,MAAK,uBAIjCJ,EAAa,CAAAlB,KAAA,UAAAC,OAAA,+D","sources":["components/VideoPlayerFacebook.js","components/VideoPlayer.js"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { css } from '@emotion/core';\n\nexport default function VideoPlayerFacebook({ url, onReady = () => {}, controls = false }) {\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n\n function setDimension(elem) {\n setWidth(elem.offsetWidth);\n setHeight(elem.offsetHeight);\n }\n\n return (\n {\n if (node) {\n setDimension(node);\n }\n }}\n css={containerStyle}\n >\n \n \n );\n}\n\nVideoPlayerFacebook.propTypes = {\n url: PropTypes.string,\n onReady: PropTypes.func,\n controls: PropTypes.bool\n};\n\nconst containerStyle = css`\n width: 100%;\n height: 100%;\n position: relative;\n`;\n\nconst iframeStyle = css`\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n`;\n","import React, { useState } from 'react';\nimport ReactPlayer from 'react-player/lazy';\nimport PropTypes from 'prop-types';\nimport { css } from '@emotion/core';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { useInView } from 'react-intersection-observer';\n\nimport { system100 } from 'Mui/styles/color';\nimport { stylePropType } from 'utils/propTypes';\n\nimport VideoPlayerFacebook from 'components/VideoPlayerFacebook';\n\nconst fbUrlRegexp = /facebook\\.com|fb\\.watch/i;\n\nexport default function VideoPlayer({ canStartLoading = true, enableLazyLoad, url, style }) {\n const [isReady, setIsReady] = useState(false);\n const isFbTypeUrl = fbUrlRegexp.test(url);\n const { ref, inView } = useInView({\n triggerOnce: true,\n rootMargin: '100px 0%',\n skip: !enableLazyLoad\n });\n\n return (\n
\n {!isReady && }\n {canStartLoading && (!enableLazyLoad || inView) && (\n <>\n {isFbTypeUrl ? (\n setIsReady(true)} controls />\n ) : (\n setIsReady(true)}\n url={url}\n width=\"100%\"\n height=\"100%\"\n controls\n />\n )}\n \n )}\n
\n );\n}\n\nVideoPlayer.propTypes = {\n url: PropTypes.string,\n style: stylePropType\n};\n\nconst containerStyle = css`\n width: 100%;\n height: 100%;\n background-color: ${system100.color};\n position: relative;\n`;\n\nconst progressStyle = css`\n position: absolute;\n margin: auto;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n`;\n"],"names":["VideoPlayerFacebook","_ref","url","onReady","controls","width","setWidth","useState","height","setHeight","___EmotionJSX","ref","node","elem","offsetWidth","offsetHeight","css","containerStyle","src","concat","title","iframeStyle","onLoad","scrolling","frameBorder","allowFullScreen","allow","name","styles","fbUrlRegexp","VideoPlayer","canStartLoading","enableLazyLoad","style","isReady","setIsReady","isFbTypeUrl","test","inView","useInView","triggerOnce","rootMargin","skip","_css","CircularProgress","progressStyle","React","ReactPlayer","system100","color"],"sourceRoot":""}