@ilo-org/react 0.0.18 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/lib/cjs/AccordionCtx-fe08ff45.js +9 -0
- package/lib/cjs/Callout.args-bcd5a9f1.js +17 -0
- package/lib/cjs/DailyMotion-97d1831a.js +260 -0
- package/lib/cjs/Facebook-ccb27d1d.js +240 -0
- package/lib/cjs/FilePlayer-81b9fc3f.js +597 -0
- package/lib/cjs/GlobalCtx-97e4b433.js +9 -0
- package/lib/cjs/Kaltura-d6c19814.js +236 -0
- package/lib/cjs/ListCtx-7db7fe04.js +9 -0
- package/lib/cjs/Mixcloud-f02a460e.js +223 -0
- package/lib/cjs/Preview-8238ea6e.js +227 -0
- package/lib/cjs/SoundCloud-cd1b1590.js +250 -0
- package/lib/cjs/Streamable-f47da42a.js +235 -0
- package/lib/cjs/TagCtx-929c7753.js +7 -0
- package/lib/cjs/Twitch-c503e140.js +245 -0
- package/lib/cjs/Vidyard-d9c2f073.js +238 -0
- package/lib/cjs/Vimeo-009601ef.js +286 -0
- package/lib/cjs/Wistia-8c9f4c58.js +289 -0
- package/lib/cjs/YouTube-ec5847d4.js +378 -0
- package/lib/cjs/_commonjsHelpers-9f9f50a8.js +39 -0
- package/lib/cjs/components/Accordion/Accordion.js +47 -0
- package/lib/cjs/components/Accordion/AccordionButton.js +34 -0
- package/lib/cjs/components/Accordion/AccordionItem.js +21 -0
- package/lib/cjs/components/Accordion/AccordionPanel.js +30 -0
- package/lib/cjs/components/Accordion/index.js +22 -0
- package/lib/cjs/components/Button/Button.js +36 -0
- package/lib/cjs/components/Button/index.js +39 -0
- package/lib/cjs/components/Callout/Callout.js +47 -0
- package/lib/cjs/components/Callout/index.js +19 -0
- package/lib/cjs/components/Checkbox/Checkbox.js +34 -0
- package/lib/cjs/components/Checkbox/index.js +17 -0
- package/lib/cjs/components/ChoiceGroup/ChoiceGroup.js +34 -0
- package/lib/cjs/components/ChoiceGroup/index.js +19 -0
- package/lib/cjs/components/Collapse/Collapse.js +725 -0
- package/lib/cjs/components/Collapse/index.js +18 -0
- package/lib/cjs/components/ContextMenu/ContextMenu.js +20 -0
- package/lib/cjs/components/ContextMenu/index.js +13 -0
- package/lib/cjs/components/Credit/Credit.js +33 -0
- package/lib/cjs/components/Credit/index.js +13 -0
- package/lib/cjs/components/DatePicker/DatePicker.js +32 -0
- package/lib/cjs/components/DatePicker/index.js +17 -0
- package/lib/cjs/components/Dropdown/Dropdown.js +35 -0
- package/lib/cjs/components/Dropdown/index.js +17 -0
- package/lib/cjs/components/Empty/Empty.js +19 -0
- package/lib/cjs/components/Empty/index.js +13 -0
- package/lib/cjs/components/Fieldset/Fieldset.js +24 -0
- package/lib/cjs/components/Fieldset/index.js +15 -0
- package/lib/cjs/components/FileUpload/FileUpload.js +35 -0
- package/lib/cjs/components/FileUpload/index.js +17 -0
- package/lib/cjs/components/Form/Form.js +66 -0
- package/lib/cjs/components/Form/index.js +31 -0
- package/lib/cjs/components/FormElement/FormElement.js +19 -0
- package/lib/cjs/components/FormElement/index.js +8 -0
- package/lib/cjs/components/FormGroup/FormGroup.js +58 -0
- package/lib/cjs/components/FormGroup/index.js +26 -0
- package/lib/cjs/components/GlobalProvider/GlobalProvider.js +18 -0
- package/lib/cjs/components/GlobalProvider/index.js +11 -0
- package/lib/cjs/components/Heading/Heading.js +22 -0
- package/lib/cjs/components/Heading/index.js +13 -0
- package/lib/cjs/components/Hero/Hero.js +25 -0
- package/lib/cjs/components/Hero/HeroCard.js +25 -0
- package/lib/cjs/components/Hero/index.js +17 -0
- package/lib/cjs/components/Icon/Icon.js +43 -0
- package/lib/cjs/components/Icon/index.js +13 -0
- package/lib/cjs/components/Image/Image.js +31 -0
- package/lib/cjs/components/Image/index.js +14 -0
- package/lib/cjs/components/Input/Input.js +32 -0
- package/lib/cjs/components/Input/index.js +17 -0
- package/lib/cjs/components/Link/Link.js +23 -0
- package/lib/cjs/components/Link/index.js +13 -0
- package/lib/cjs/components/LinkList/LinkList.js +22 -0
- package/lib/cjs/components/LinkList/index.js +13 -0
- package/lib/cjs/components/List/List.js +25 -0
- package/lib/cjs/components/List/ListItem.js +21 -0
- package/lib/cjs/components/List/index.js +16 -0
- package/lib/cjs/components/Loading/Loading.js +21 -0
- package/lib/cjs/components/Loading/index.js +13 -0
- package/lib/cjs/components/Notification/Notification.js +41 -0
- package/lib/cjs/components/Notification/index.js +17 -0
- package/lib/cjs/components/NumberPicker/NumberPicker.js +32 -0
- package/lib/cjs/components/NumberPicker/index.js +17 -0
- package/lib/cjs/components/Pagination/Pagination.js +49 -0
- package/lib/cjs/components/Pagination/index.js +13 -0
- package/lib/cjs/components/Profile/Profile.js +19 -0
- package/lib/cjs/components/Profile/index.js +13 -0
- package/lib/cjs/components/Radio/Radio.js +29 -0
- package/lib/cjs/components/Radio/index.js +14 -0
- package/lib/cjs/components/ReadMore/ReadMore.js +38 -0
- package/lib/cjs/components/ReadMore/index.js +14 -0
- package/lib/cjs/components/RichText/RichText.js +19 -0
- package/lib/cjs/components/RichText/index.js +13 -0
- package/lib/cjs/components/SearchField/SearchField.js +38 -0
- package/lib/cjs/components/SearchField/index.js +18 -0
- package/lib/cjs/components/TableOfContents/TableOfContents.js +22 -0
- package/lib/cjs/components/TableOfContents/index.js +13 -0
- package/lib/cjs/components/Tag/Tag.js +54 -0
- package/lib/cjs/components/Tag/TagSet.js +46 -0
- package/lib/cjs/components/Tag/index.js +20 -0
- package/lib/cjs/components/Textarea/Textarea.js +32 -0
- package/lib/cjs/components/Textarea/index.js +17 -0
- package/lib/cjs/components/Tooltip/Tooltip.js +103 -0
- package/lib/cjs/components/Tooltip/index.js +14 -0
- package/lib/cjs/components/Video/Video.js +29 -0
- package/lib/cjs/components/Video/VideoPlayer.js +1452 -0
- package/lib/cjs/components/Video/index.js +20 -0
- package/lib/cjs/components/index.js +115 -0
- package/lib/cjs/css-9c93400b.js +81 -0
- package/lib/cjs/hooks/index.js +13 -0
- package/lib/cjs/hooks/useGlobalSettings.js +13 -0
- package/lib/cjs/hooks/useVideoPlayer.js +75 -0
- package/lib/cjs/index-1b6434f0.js +1191 -0
- package/lib/cjs/index.js +115 -0
- package/lib/cjs/patterns-b55db71f.js +579 -0
- package/lib/cjs/utils/checkArrayDuplicates.js +7 -0
- package/lib/cjs/utils/createChainedFunction.js +30 -0
- package/lib/cjs/utils/getDefaultDimensionValue.js +22 -0
- package/lib/cjs/utils/hoursMinutesSeconds.js +12 -0
- package/lib/cjs/utils/index.js +18 -0
- package/lib/cjs/utils/transitionEndListener.js +161 -0
- package/lib/cjs/utils/triggerBrowserReflow.js +8 -0
- package/lib/esm/AccordionCtx-8c051900.js +6 -0
- package/lib/esm/Callout.args-3a0e0416.js +15 -0
- package/lib/esm/DailyMotion-b35dc8bb.js +258 -0
- package/lib/esm/Facebook-c3c77787.js +238 -0
- package/lib/esm/FilePlayer-540e4c5a.js +595 -0
- package/lib/esm/GlobalCtx-7fb23cfa.js +7 -0
- package/lib/esm/Kaltura-4ac3cda3.js +234 -0
- package/lib/esm/ListCtx-da435fdf.js +6 -0
- package/lib/esm/Mixcloud-3d4e0760.js +221 -0
- package/lib/esm/Preview-6d2a6792.js +225 -0
- package/lib/esm/SoundCloud-306d6c78.js +248 -0
- package/lib/esm/Streamable-aa3d544e.js +233 -0
- package/lib/esm/TagCtx-34c545fe.js +5 -0
- package/lib/esm/Twitch-4a1a1565.js +243 -0
- package/lib/esm/Vidyard-fe74c274.js +236 -0
- package/lib/esm/Vimeo-074f2c39.js +284 -0
- package/lib/esm/Wistia-0a2b73b0.js +287 -0
- package/lib/esm/YouTube-d58f130b.js +376 -0
- package/lib/esm/_commonjsHelpers-849bcf65.js +35 -0
- package/lib/esm/components/Accordion/Accordion.js +45 -0
- package/lib/esm/components/Accordion/AccordionButton.js +32 -0
- package/lib/esm/components/Accordion/AccordionItem.js +19 -0
- package/lib/esm/components/Accordion/AccordionPanel.js +28 -0
- package/lib/esm/components/Accordion/index.js +13 -0
- package/lib/esm/components/Button/Button.js +34 -0
- package/lib/esm/components/Button/index.js +36 -0
- package/lib/esm/components/Callout/Callout.js +45 -0
- package/lib/esm/components/Callout/index.js +12 -0
- package/lib/esm/components/Checkbox/Checkbox.js +32 -0
- package/lib/esm/components/Checkbox/index.js +11 -0
- package/lib/esm/components/ChoiceGroup/ChoiceGroup.js +32 -0
- package/lib/esm/components/ChoiceGroup/index.js +13 -0
- package/lib/esm/components/Collapse/Collapse.js +723 -0
- package/lib/esm/components/Collapse/index.js +12 -0
- package/lib/esm/components/ContextMenu/ContextMenu.js +18 -0
- package/lib/esm/components/ContextMenu/index.js +7 -0
- package/lib/esm/components/Credit/Credit.js +31 -0
- package/lib/esm/components/Credit/index.js +7 -0
- package/lib/esm/components/DatePicker/DatePicker.js +30 -0
- package/lib/esm/components/DatePicker/index.js +11 -0
- package/lib/esm/components/Dropdown/Dropdown.js +33 -0
- package/lib/esm/components/Dropdown/index.js +11 -0
- package/lib/esm/components/Empty/Empty.js +17 -0
- package/lib/esm/components/Empty/index.js +7 -0
- package/lib/esm/components/Fieldset/Fieldset.js +22 -0
- package/lib/esm/components/Fieldset/index.js +9 -0
- package/lib/esm/components/FileUpload/FileUpload.js +33 -0
- package/lib/esm/components/FileUpload/index.js +11 -0
- package/lib/esm/components/Form/Form.js +64 -0
- package/lib/esm/components/Form/index.js +25 -0
- package/lib/esm/components/FormElement/FormElement.js +17 -0
- package/lib/esm/components/FormElement/index.js +2 -0
- package/lib/esm/components/FormGroup/FormGroup.js +56 -0
- package/lib/esm/components/FormGroup/index.js +20 -0
- package/lib/esm/components/GlobalProvider/GlobalProvider.js +16 -0
- package/lib/esm/components/GlobalProvider/index.js +4 -0
- package/lib/esm/components/Heading/Heading.js +20 -0
- package/lib/esm/components/Heading/index.js +7 -0
- package/lib/esm/components/Hero/Hero.js +23 -0
- package/lib/esm/components/Hero/HeroCard.js +23 -0
- package/lib/esm/components/Hero/index.js +10 -0
- package/lib/esm/components/Icon/Icon.js +22 -0
- package/lib/esm/components/Icon/index.js +7 -0
- package/lib/esm/components/Image/Image.js +29 -0
- package/lib/esm/components/Image/index.js +8 -0
- package/lib/esm/components/Input/Input.js +30 -0
- package/lib/esm/components/Input/index.js +11 -0
- package/lib/esm/components/Link/Link.js +21 -0
- package/lib/esm/components/Link/index.js +7 -0
- package/lib/esm/components/LinkList/LinkList.js +20 -0
- package/lib/esm/components/LinkList/index.js +7 -0
- package/lib/esm/components/List/List.js +23 -0
- package/lib/esm/components/List/ListItem.js +19 -0
- package/lib/esm/components/List/index.js +9 -0
- package/lib/esm/components/Loading/Loading.js +19 -0
- package/lib/esm/components/Loading/index.js +7 -0
- package/lib/esm/components/Notification/Notification.js +39 -0
- package/lib/esm/components/Notification/index.js +11 -0
- package/lib/esm/components/NumberPicker/NumberPicker.js +30 -0
- package/lib/esm/components/NumberPicker/index.js +11 -0
- package/lib/esm/components/Pagination/Pagination.js +47 -0
- package/lib/esm/components/Pagination/index.js +7 -0
- package/lib/esm/components/Profile/Profile.js +17 -0
- package/lib/esm/components/Profile/index.js +7 -0
- package/lib/esm/components/Radio/Radio.js +27 -0
- package/lib/esm/components/Radio/index.js +8 -0
- package/lib/esm/components/ReadMore/ReadMore.js +36 -0
- package/lib/esm/components/ReadMore/index.js +8 -0
- package/lib/esm/components/RichText/RichText.js +17 -0
- package/lib/esm/components/RichText/index.js +7 -0
- package/lib/esm/components/SearchField/SearchField.js +36 -0
- package/lib/esm/components/SearchField/index.js +12 -0
- package/lib/esm/components/TableOfContents/TableOfContents.js +20 -0
- package/lib/esm/components/TableOfContents/index.js +7 -0
- package/lib/esm/components/Tag/Tag.js +52 -0
- package/lib/esm/components/Tag/TagSet.js +44 -0
- package/lib/esm/components/Tag/index.js +13 -0
- package/lib/esm/components/Textarea/Textarea.js +30 -0
- package/lib/esm/components/Textarea/index.js +11 -0
- package/lib/esm/components/Tooltip/Tooltip.js +101 -0
- package/lib/esm/components/Tooltip/index.js +8 -0
- package/lib/esm/components/Video/Video.js +27 -0
- package/lib/esm/components/Video/VideoPlayer.js +1450 -0
- package/lib/esm/components/Video/index.js +14 -0
- package/lib/esm/components/index.js +68 -0
- package/lib/esm/css-7414f50b.js +79 -0
- package/lib/esm/hooks/index.js +6 -0
- package/lib/esm/hooks/useGlobalSettings.js +11 -0
- package/lib/esm/hooks/useVideoPlayer.js +73 -0
- package/lib/esm/index-8ebb2cc1.js +1191 -0
- package/lib/esm/index.js +68 -0
- package/lib/esm/patterns-3a3fa9d6.js +575 -0
- package/lib/esm/utils/checkArrayDuplicates.js +5 -0
- package/lib/esm/utils/createChainedFunction.js +28 -0
- package/lib/esm/utils/getDefaultDimensionValue.js +20 -0
- package/lib/esm/utils/hoursMinutesSeconds.js +10 -0
- package/lib/esm/utils/index.js +7 -0
- package/lib/esm/utils/transitionEndListener.js +159 -0
- package/lib/esm/utils/triggerBrowserReflow.js +6 -0
- package/lib/types/react/src/components/Accordion/Accordion.d.ts +4 -0
- package/lib/types/react/src/components/Accordion/Accordion.props.d.ts +33 -0
- package/lib/types/react/src/components/Accordion/AccordionButton.d.ts +4 -0
- package/lib/types/react/src/components/Accordion/AccordionButton.props.d.ts +11 -0
- package/lib/types/react/src/components/Accordion/AccordionCtx.d.ts +4 -0
- package/lib/types/react/src/components/Accordion/AccordionItem.d.ts +4 -0
- package/lib/types/react/src/components/Accordion/AccordionItem.props.d.ts +21 -0
- package/lib/types/react/src/components/Accordion/AccordionPanel.d.ts +4 -0
- package/lib/types/react/src/components/Accordion/AccordionPanel.props.d.ts +17 -0
- package/lib/types/react/src/components/Accordion/index.d.ts +4 -0
- package/lib/types/react/src/components/Button/Button.args.d.ts +11 -0
- package/lib/types/react/src/components/Button/Button.d.ts +4 -0
- package/lib/types/react/src/components/Button/Button.props.d.ts +64 -0
- package/lib/types/react/src/components/Button/index.d.ts +2 -0
- package/lib/types/react/src/components/Callout/Callout.args.d.ts +8 -0
- package/lib/types/react/src/components/Callout/Callout.d.ts +4 -0
- package/lib/types/react/src/components/Callout/Callout.props.d.ts +50 -0
- package/lib/types/react/src/components/Callout/index.d.ts +2 -0
- package/lib/types/react/src/components/Checkbox/Checkbox.d.ts +4 -0
- package/lib/types/react/src/components/Checkbox/Checkbox.props.d.ts +13 -0
- package/lib/types/react/src/components/Checkbox/index.d.ts +1 -0
- package/lib/types/react/src/components/ChoiceGroup/ChoiceGroup.d.ts +4 -0
- package/lib/types/react/src/components/ChoiceGroup/ChoiceGroup.props.d.ts +20 -0
- package/lib/types/react/src/components/ChoiceGroup/index.d.ts +1 -0
- package/lib/types/react/src/components/Collapse/Collapse.d.ts +3 -0
- package/lib/types/react/src/components/Collapse/Collapse.props.d.ts +76 -0
- package/lib/types/react/src/components/Collapse/index.d.ts +1 -0
- package/lib/types/react/src/components/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/types/react/src/components/ContextMenu/ContextMenu.props.d.ts +25 -0
- package/lib/types/react/src/components/ContextMenu/index.d.ts +1 -0
- package/lib/types/react/src/components/Credit/Credit.d.ts +4 -0
- package/lib/types/react/src/components/Credit/Credit.props.d.ts +10 -0
- package/lib/types/react/src/components/Credit/index.d.ts +1 -0
- package/lib/types/react/src/components/DatePicker/DatePicker.d.ts +4 -0
- package/lib/types/react/src/components/DatePicker/DatePicker.props.d.ts +54 -0
- package/lib/types/react/src/components/DatePicker/index.d.ts +1 -0
- package/lib/types/react/src/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/types/react/src/components/Dropdown/Dropdown.props.d.ts +69 -0
- package/lib/types/react/src/components/Dropdown/index.d.ts +1 -0
- package/lib/types/react/src/components/Empty/Empty.d.ts +4 -0
- package/lib/types/react/src/components/Empty/Empty.props.d.ts +11 -0
- package/lib/types/react/src/components/Empty/index.d.ts +1 -0
- package/lib/types/react/src/components/Fieldset/Fieldset.d.ts +4 -0
- package/lib/types/react/src/components/Fieldset/Fieldset.props.d.ts +35 -0
- package/lib/types/react/src/components/Fieldset/index.d.ts +1 -0
- package/lib/types/react/src/components/FileUpload/FileUpload.d.ts +4 -0
- package/lib/types/react/src/components/FileUpload/FileUpload.props.d.ts +50 -0
- package/lib/types/react/src/components/FileUpload/index.d.ts +1 -0
- package/lib/types/react/src/components/Form/Form.d.ts +4 -0
- package/lib/types/react/src/components/Form/Form.props.d.ts +114 -0
- package/lib/types/react/src/components/Form/index.d.ts +1 -0
- package/lib/types/react/src/components/FormElement/FormElement.d.ts +4 -0
- package/lib/types/react/src/components/FormElement/FormElement.props.d.ts +47 -0
- package/lib/types/react/src/components/FormElement/index.d.ts +1 -0
- package/lib/types/react/src/components/FormGroup/FormGroup.d.ts +4 -0
- package/lib/types/react/src/components/FormGroup/FormGroup.props.d.ts +81 -0
- package/lib/types/react/src/components/FormGroup/index.d.ts +1 -0
- package/lib/types/react/src/components/GlobalProvider/GlobalCtx.d.ts +2 -0
- package/lib/types/react/src/components/GlobalProvider/GlobalProvider.d.ts +4 -0
- package/lib/types/react/src/components/GlobalProvider/GlobalProvider.props.d.ts +13 -0
- package/lib/types/react/src/components/GlobalProvider/index.d.ts +2 -0
- package/lib/types/react/src/components/Heading/Heading.d.ts +4 -0
- package/lib/types/react/src/components/Heading/Heading.props.d.ts +20 -0
- package/lib/types/react/src/components/Heading/index.d.ts +1 -0
- package/lib/types/react/src/components/Hero/Hero.d.ts +4 -0
- package/lib/types/react/src/components/Hero/Hero.props.d.ts +25 -0
- package/lib/types/react/src/components/Hero/HeroCard.d.ts +4 -0
- package/lib/types/react/src/components/Hero/HeroCard.props.d.ts +54 -0
- package/lib/types/react/src/components/Hero/index.d.ts +2 -0
- package/lib/types/react/src/components/Icon/Icon.d.ts +4 -0
- package/lib/types/react/src/components/Icon/Icon.props.d.ts +14 -0
- package/lib/types/react/src/components/Icon/index.d.ts +1 -0
- package/lib/types/react/src/components/Image/Image.d.ts +4 -0
- package/lib/types/react/src/components/Image/Image.props.d.ts +33 -0
- package/lib/types/react/src/components/Image/index.d.ts +1 -0
- package/lib/types/react/src/components/Input/Input.d.ts +4 -0
- package/lib/types/react/src/components/Input/Input.props.d.ts +51 -0
- package/lib/types/react/src/components/Input/index.d.ts +1 -0
- package/lib/types/react/src/components/Link/Link.d.ts +4 -0
- package/lib/types/react/src/components/Link/Link.props.d.ts +32 -0
- package/lib/types/react/src/components/Link/index.d.ts +1 -0
- package/lib/types/react/src/components/LinkList/LinkList.d.ts +4 -0
- package/lib/types/react/src/components/LinkList/LinkList.props.d.ts +44 -0
- package/lib/types/react/src/components/LinkList/index.d.ts +1 -0
- package/lib/types/react/src/components/List/List.d.ts +4 -0
- package/lib/types/react/src/components/List/List.props.d.ts +31 -0
- package/lib/types/react/src/components/List/ListCtx.d.ts +4 -0
- package/lib/types/react/src/components/List/ListItem.d.ts +4 -0
- package/lib/types/react/src/components/List/ListItem.props.d.ts +21 -0
- package/lib/types/react/src/components/List/index.d.ts +2 -0
- package/lib/types/react/src/components/Loading/Loading.d.ts +4 -0
- package/lib/types/react/src/components/Loading/Loading.props.d.ts +19 -0
- package/lib/types/react/src/components/Loading/index.d.ts +1 -0
- package/lib/types/react/src/components/Notification/Notification.d.ts +4 -0
- package/lib/types/react/src/components/Notification/Notification.props.d.ts +56 -0
- package/lib/types/react/src/components/Notification/index.d.ts +1 -0
- package/lib/types/react/src/components/NumberPicker/NumberPicker.d.ts +4 -0
- package/lib/types/react/src/components/NumberPicker/NumberPicker.props.d.ts +46 -0
- package/lib/types/react/src/components/NumberPicker/index.d.ts +1 -0
- package/lib/types/react/src/components/Pagination/Pagination.d.ts +4 -0
- package/lib/types/react/src/components/Pagination/Pagination.props.d.ts +54 -0
- package/lib/types/react/src/components/Pagination/index.d.ts +1 -0
- package/lib/types/react/src/components/Profile/Profile.d.ts +4 -0
- package/lib/types/react/src/components/Profile/Profile.props.d.ts +37 -0
- package/lib/types/react/src/components/Profile/index.d.ts +1 -0
- package/lib/types/react/src/components/Radio/Radio.d.ts +4 -0
- package/lib/types/react/src/components/Radio/Radio.props.d.ts +14 -0
- package/lib/types/react/src/components/Radio/index.d.ts +1 -0
- package/lib/types/react/src/components/ReadMore/ReadMore.d.ts +4 -0
- package/lib/types/react/src/components/ReadMore/ReadMore.props.d.ts +32 -0
- package/lib/types/react/src/components/ReadMore/index.d.ts +1 -0
- package/lib/types/react/src/components/RichText/RichText.d.ts +4 -0
- package/lib/types/react/src/components/RichText/RichText.props.d.ts +10 -0
- package/lib/types/react/src/components/RichText/index.d.ts +1 -0
- package/lib/types/react/src/components/SearchField/SearchField.d.ts +4 -0
- package/lib/types/react/src/components/SearchField/SearchField.props.d.ts +29 -0
- package/lib/types/react/src/components/SearchField/index.d.ts +1 -0
- package/lib/types/react/src/components/TableOfContents/TableOfContents.d.ts +4 -0
- package/lib/types/react/src/components/TableOfContents/TableOfContents.props.d.ts +20 -0
- package/lib/types/react/src/components/TableOfContents/index.d.ts +1 -0
- package/lib/types/react/src/components/Tag/Tag.d.ts +4 -0
- package/lib/types/react/src/components/Tag/Tag.props.d.ts +28 -0
- package/lib/types/react/src/components/Tag/TagCtx.d.ts +2 -0
- package/lib/types/react/src/components/Tag/TagSet.d.ts +4 -0
- package/lib/types/react/src/components/Tag/TagSet.props.d.ts +30 -0
- package/lib/types/react/src/components/Tag/index.d.ts +2 -0
- package/lib/types/react/src/components/Textarea/Textarea.d.ts +4 -0
- package/lib/types/react/src/components/Textarea/Textarea.props.d.ts +59 -0
- package/lib/types/react/src/components/Textarea/index.d.ts +1 -0
- package/lib/types/react/src/components/Tooltip/Tooltip.d.ts +4 -0
- package/lib/types/react/src/components/Tooltip/Tooltip.props.d.ts +35 -0
- package/lib/types/react/src/components/Tooltip/index.d.ts +1 -0
- package/lib/types/react/src/components/Video/Video.d.ts +4 -0
- package/lib/types/react/src/components/Video/Video.props.d.ts +66 -0
- package/lib/types/react/src/components/Video/VideoPlayer.d.ts +4 -0
- package/lib/types/react/src/components/Video/VideoPlayer.props.d.ts +67 -0
- package/lib/types/react/src/components/Video/index.d.ts +1 -0
- package/lib/types/react/src/components/index.d.ts +39 -0
- package/lib/types/react/src/hooks/index.d.ts +2 -0
- package/lib/types/react/src/hooks/useGlobalSettings.d.ts +4 -0
- package/lib/types/react/src/hooks/useVideoPlayer.d.ts +12 -0
- package/lib/types/react/src/index.d.ts +1 -0
- package/lib/types/react/src/types/index.d.ts +26 -0
- package/lib/types/react/src/utils/checkArrayDuplicates.d.ts +1 -0
- package/lib/types/react/src/utils/createChainedFunction.d.ts +11 -0
- package/lib/types/react/src/utils/getDefaultDimensionValue.d.ts +3 -0
- package/lib/types/react/src/utils/hoursMinutesSeconds.d.ts +1 -0
- package/lib/types/react/src/utils/index.d.ts +6 -0
- package/lib/types/react/src/utils/transitionEndListener.d.ts +1 -0
- package/lib/types/react/src/utils/triggerBrowserReflow.d.ts +1 -0
- package/package.json +115 -77
- package/public/hero.jpg +0 -0
- package/public/ilo-dg.jpg +0 -0
- package/public/ilo-headquarters.jpg +0 -0
- package/public/large.jpg +0 -0
- package/public/media-file-poster.jpg +0 -0
- package/public/medium.jpg +0 -0
- package/public/small.jpg +0 -0
- package/public/video-example.mp4 +0 -0
- package/public/youtube-video-poster.avif +0 -0
- package/rollup.config.mjs +70 -0
- package/src/components/Accordion/Accordion.args.ts +1 -1
- package/src/components/Accordion/{Accordion.props.d.ts → Accordion.props.ts} +6 -4
- package/src/components/Accordion/Accordion.tsx +4 -12
- package/src/components/Accordion/{AccordionButton.props.d.ts → AccordionButton.props.ts} +0 -0
- package/src/components/Accordion/AccordionButton.tsx +2 -4
- package/src/components/Accordion/AccordionCtx.ts +9 -0
- package/src/components/Accordion/{AccordionItem.props.d.ts → AccordionItem.props.ts} +0 -0
- package/src/components/Accordion/AccordionItem.tsx +3 -9
- package/src/components/Accordion/{AccordionPanel.props.d.ts → AccordionPanel.props.ts} +0 -0
- package/src/components/Accordion/AccordionPanel.tsx +2 -3
- package/src/components/Accordion/index.ts +0 -0
- package/src/components/Button/Button.args.ts +12 -467
- package/src/components/Button/{Button.props.d.ts → Button.props.ts} +17 -7
- package/src/components/Button/Button.tsx +9 -1
- package/src/components/Button/index.ts +1 -0
- package/src/components/Callout/Callout.args.ts +17 -43
- package/src/components/Callout/{Callout.props.d.ts → Callout.props.ts} +2 -3
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Callout/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.args.ts +1 -3
- package/src/components/Checkbox/Checkbox.props.ts +13 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/ChoiceGroup/ChoiceGroup.args.ts +15 -12
- package/src/components/ChoiceGroup/ChoiceGroup.props.ts +25 -0
- package/src/components/ChoiceGroup/ChoiceGroup.tsx +1 -1
- package/src/components/Collapse/{Collapse.props.d.ts → Collapse.props.ts} +0 -0
- package/src/components/Collapse/Collapse.tsx +4 -4
- package/src/components/ContextMenu/ContextMenu.args.ts +10 -10
- package/src/components/ContextMenu/{ContextMenu.props.d.ts → ContextMenu.props.ts} +0 -0
- package/src/components/Credit/{Credit.props.d.ts → Credit.props.ts} +0 -0
- package/src/components/DatePicker/DatePicker.args.ts +6 -6
- package/src/components/DatePicker/{DatePicker.props.d.ts → DatePicker.props.ts} +1 -3
- package/src/components/DatePicker/DatePicker.tsx +4 -4
- package/src/components/Dropdown/Dropdown.args.ts +5 -5
- package/src/components/Dropdown/{Dropdown.props.d.ts → Dropdown.props.ts} +1 -1
- package/src/components/Dropdown/Dropdown.tsx +1 -1
- package/src/components/Empty/{Empty.props.d.ts → Empty.props.ts} +7 -0
- package/src/components/Empty/Empty.tsx +2 -2
- package/src/components/Fieldset/{Fieldset.props.d.ts → Fieldset.props.ts} +10 -3
- package/src/components/Fieldset/Fieldset.tsx +4 -4
- package/src/components/FileUpload/FileUpload.args.ts +4 -4
- package/src/components/FileUpload/{FileUpload.props.d.ts → FileUpload.props.ts} +1 -3
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/Form/Form.args.ts +4 -82
- package/src/components/Form/Form.props.ts +137 -0
- package/src/components/FormElement/{FormElement.props.d.ts → FormElement.props.ts} +12 -5
- package/src/components/FormElement/FormElement.tsx +9 -16
- package/src/components/FormGroup/FormGroup.args.ts +2 -1
- package/src/components/FormGroup/FormGroup.props.ts +102 -0
- package/src/components/GlobalProvider/GlobalCtx.ts +6 -0
- package/src/components/GlobalProvider/{GlobalProvider.props.d.ts → GlobalProvider.props.ts} +1 -1
- package/src/components/GlobalProvider/GlobalProvider.tsx +3 -9
- package/src/components/GlobalProvider/index.ts +2 -0
- package/src/components/Heading/Heading.args.ts +9 -6
- package/src/components/Heading/{Heading.props.d.ts → Heading.props.ts} +3 -3
- package/src/components/Hero/Hero.args.ts +14 -14
- package/src/components/Hero/{Hero.props.d.ts → Hero.props.ts} +7 -6
- package/src/components/Hero/Hero.tsx +1 -1
- package/src/components/Hero/{HeroCard.props.d.ts → HeroCard.props.ts} +6 -6
- package/src/components/Icon/{Icon.props.d.ts → Icon.props.ts} +1 -1
- package/src/components/Image/Image.args.ts +9 -15
- package/src/components/Image/{Image.props.d.ts → Image.props.ts} +0 -0
- package/src/components/Input/Input.args.ts +10 -10
- package/src/components/Input/{Input.props.d.ts → Input.props.ts} +3 -3
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Link/{Link.props.d.ts → Link.props.ts} +8 -3
- package/src/components/Link/Link.tsx +3 -10
- package/src/components/LinkList/{LinkList.props.d.ts → LinkList.props.ts} +2 -2
- package/src/components/List/List.args.ts +0 -4
- package/src/components/List/{List.props.d.ts → List.props.ts} +9 -8
- package/src/components/List/List.tsx +3 -4
- package/src/components/List/ListCtx.ts +7 -0
- package/src/components/List/{ListItem.props.d.ts → ListItem.props.ts} +0 -0
- package/src/components/List/ListItem.tsx +3 -4
- package/src/components/Loading/{Loading.props.d.ts → Loading.props.ts} +3 -3
- package/src/components/Notification/{Notification.props.d.ts → Notification.props.ts} +3 -3
- package/src/components/Notification/Notification.tsx +1 -1
- package/src/components/NumberPicker/NumberPicker.args.ts +4 -4
- package/src/components/NumberPicker/{NumberPicker.props.d.ts → NumberPicker.props.ts} +1 -1
- package/src/components/NumberPicker/NumberPicker.tsx +1 -1
- package/src/components/Pagination/Pagination.args.ts +2 -2
- package/src/components/Pagination/{Pagination.props.d.ts → Pagination.props.ts} +1 -1
- package/src/components/Profile/Profile.args.ts +16 -16
- package/src/components/Profile/{Profile.props.d.ts → Profile.props.ts} +0 -0
- package/src/components/Radio/Radio.args.ts +3 -4
- package/src/components/Radio/Radio.props.ts +14 -0
- package/src/components/Radio/Radio.tsx +1 -1
- package/src/components/ReadMore/ReadMore.args.ts +23 -0
- package/src/components/ReadMore/{ReadMore.props.d.ts → ReadMore.props.ts} +2 -2
- package/src/components/RichText/{RichText.props.d.ts → RichText.props.ts} +1 -1
- package/src/components/RichText/richText.args.ts +25 -2
- package/src/components/SearchField/SearchField.args.ts +8 -8
- package/src/components/SearchField/{SearchField.props.d.ts → SearchField.props.ts} +3 -3
- package/src/components/SearchField/SearchField.tsx +26 -19
- package/src/components/TableOfContents/{TableOfContents.props.d.ts → TableOfContents.props.ts} +0 -0
- package/src/components/Tag/{Tag.props.d.ts → Tag.props.ts} +4 -4
- package/src/components/Tag/Tag.tsx +8 -3
- package/src/components/Tag/TagCtx.ts +4 -0
- package/src/components/Tag/TagSet.args.ts +0 -2
- package/src/components/Tag/{TagSet.props.d.ts → TagSet.props.ts} +5 -4
- package/src/components/Tag/TagSet.tsx +3 -13
- package/src/components/Textarea/Textarea.args.ts +0 -10
- package/src/components/Textarea/{Textarea.props.d.ts → Textarea.props.ts} +5 -3
- package/src/components/Textarea/Textarea.tsx +1 -1
- package/src/components/Tooltip/Tooltip.args.ts +4 -8
- package/src/components/Tooltip/{Tooltip.props.d.ts → Tooltip.props.ts} +4 -9
- package/src/components/Tooltip/Tooltip.tsx +3 -2
- package/src/components/Video/Video.args.ts +16 -44
- package/src/components/Video/{Video.props.d.ts → Video.props.ts} +8 -13
- package/src/components/Video/Video.tsx +2 -2
- package/src/components/Video/{VideoPlayer.props.d.ts → VideoPlayer.props.ts} +7 -5
- package/src/components/Video/VideoPlayer.tsx +2 -2
- package/src/components/Video/media-file-poster.jpg +0 -0
- package/src/components/index.ts +44 -0
- package/src/hooks/index.ts +2 -0
- package/src/index.ts +1 -19
- package/src/types/index.ts +27 -26
- package/src/utils/index.ts +6 -0
- package/tsconfig.build.json +7 -3
- package/.eslintrc.js +0 -36
- package/.storybook/main.js +0 -28
- package/.storybook/manager-head.html +0 -2
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.tsx +0 -40
- package/.storybook/styles.scss +0 -1
- package/.storybook/theme.js +0 -11
- package/.turbo/turbo-build.log +0 -525
- package/.turbo/turbo-check.log +0 -4
- package/.turbo/turbo-test.log +0 -889
- package/=6.4.0 +0 -115
- package/=7.21.4 +0 -21
- package/lib/index.esm.js +0 -24
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -24
- package/lib/index.js.map +0 -1
- package/rollup.config.js +0 -40
- package/src/__tests__/Accordion.test.tsx +0 -52
- package/src/__tests__/Button.test.tsx +0 -60
- package/src/__tests__/Callout.test.tsx +0 -41
- package/src/__tests__/ContextMenu.test.tsx +0 -19
- package/src/__tests__/Dropdown.test.tsx +0 -38
- package/src/__tests__/Form.test.tsx +0 -34
- package/src/__tests__/Heading.test.tsx +0 -51
- package/src/__tests__/Hero.test.tsx +0 -22
- package/src/__tests__/Image.test.tsx +0 -21
- package/src/__tests__/LinkList.test.tsx +0 -17
- package/src/__tests__/List.test.tsx +0 -37
- package/src/__tests__/Loading.text.tsx +0 -33
- package/src/__tests__/Notification.test.tsx +0 -39
- package/src/__tests__/Pagination.test.tsx +0 -58
- package/src/__tests__/Profile.test.tsx +0 -48
- package/src/__tests__/ReadMore.test.tsx +0 -42
- package/src/__tests__/RichText.test.tsx +0 -16
- package/src/__tests__/SearchField.test.tsx +0 -35
- package/src/__tests__/TableOfContents.test.tsx +0 -12
- package/src/__tests__/Tag.test.tsx +0 -10
- package/src/components/Checkbox/Checkbox.props.d.ts +0 -61
- package/src/components/ChoiceGroup/ChoiceGroup.props.d.ts +0 -57
- package/src/components/Empty/Empty.args.ts +0 -14
- package/src/components/Form/Form.props.d.ts +0 -84
- package/src/components/FormGroup/FormGroup.props.d.ts +0 -71
- package/src/components/GlobalProvider/index.js +0 -4
- package/src/components/Link/Link.args.ts +0 -36
- package/src/components/Radio/Radio.props.d.ts +0 -66
- package/src/components/ReadMore/readMore.args.ts +0 -35
- package/src/setup.ts +0 -6
- package/src/stories/Accordion.stories.tsx +0 -99
- package/src/stories/Button.stories.tsx +0 -375
- package/src/stories/Callout.stories.tsx +0 -195
- package/src/stories/ContextMenu.stories.tsx +0 -80
- package/src/stories/Dropdown.stories.tsx +0 -91
- package/src/stories/Empty.stories.tsx +0 -48
- package/src/stories/Form.stories.tsx +0 -67
- package/src/stories/Heading.stories.tsx +0 -191
- package/src/stories/Hero.stories.tsx +0 -194
- package/src/stories/Image.stories.tsx +0 -71
- package/src/stories/Introduction.stories.mdx +0 -258
- package/src/stories/Link.stories.tsx +0 -104
- package/src/stories/LinkList.stories.tsx +0 -74
- package/src/stories/List.stories.tsx +0 -255
- package/src/stories/Loading.stories.tsx +0 -103
- package/src/stories/Notification.stories.tsx +0 -176
- package/src/stories/Pagination.stories.tsx +0 -63
- package/src/stories/Profile.stories.tsx +0 -84
- package/src/stories/ReadMore.stories.tsx +0 -80
- package/src/stories/RichText.stories.tsx +0 -59
- package/src/stories/SearchField.stories.tsx +0 -87
- package/src/stories/TableOfContents.stories.tsx +0 -50
- package/src/stories/Tag.stories.tsx +0 -226
- package/src/stories/Tooltip.stories.tsx +0 -92
- package/src/stories/Video.stories.tsx +0 -69
- package/src/stories/Welcome.stories.mdx +0 -63
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/storybook-static/01daf23af61cc99e9d75.woff2 +0 -0
- package/storybook-static/06a2da828c8b6497ba7a.woff +0 -0
- package/storybook-static/0fa24adac56865ac7e5f.ttf +0 -0
- package/storybook-static/160.a21381a2.iframe.bundle.js +0 -1
- package/storybook-static/1dbed2ef5cef8fcb4cbe.ttf +0 -0
- package/storybook-static/1fa1c16a4a45d13f0df8.ttf +0 -0
- package/storybook-static/212.faba6ad0.iframe.bundle.js +0 -7
- package/storybook-static/212.faba6ad0.iframe.bundle.js.LICENSE.txt +0 -108
- package/storybook-static/212.faba6ad0.iframe.bundle.js.map +0 -1
- package/storybook-static/23cdaa8575b5e003dcde.eot +0 -0
- package/storybook-static/247.21581a11a07ce2f03d0c.manager.bundle.js +0 -2
- package/storybook-static/247.21581a11a07ce2f03d0c.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/247.271b628d.iframe.bundle.js +0 -2
- package/storybook-static/247.271b628d.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/259.03b8a6d8.iframe.bundle.js +0 -1
- package/storybook-static/27d33755a2b827666dc5.woff +0 -0
- package/storybook-static/294.491cce4d5ae7b9c2ffce.manager.bundle.js +0 -1
- package/storybook-static/294.549e3f8d.iframe.bundle.js +0 -1
- package/storybook-static/409a9c398a28ee4d74ff.eot +0 -0
- package/storybook-static/444.6156221a84c3a87f5c02.manager.bundle.js +0 -2
- package/storybook-static/444.6156221a84c3a87f5c02.manager.bundle.js.LICENSE.txt +0 -94
- package/storybook-static/4bf5fc6f93ba10519c82.eot +0 -0
- package/storybook-static/504.f9ef513c.iframe.bundle.js +0 -2
- package/storybook-static/504.f9ef513c.iframe.bundle.js.LICENSE.txt +0 -11
- package/storybook-static/639.044e85595b528d3f28da.manager.bundle.js +0 -2
- package/storybook-static/639.044e85595b528d3f28da.manager.bundle.js.LICENSE.txt +0 -31
- package/storybook-static/639.c568c669.iframe.bundle.js +0 -2
- package/storybook-static/639.c568c669.iframe.bundle.js.LICENSE.txt +0 -31
- package/storybook-static/642.1f308c6d963e823cc20e.manager.bundle.js +0 -2
- package/storybook-static/642.1f308c6d963e823cc20e.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/642.d92dc22b.iframe.bundle.js +0 -2
- package/storybook-static/642.d92dc22b.iframe.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/6a159f0a2005668f1f78.woff +0 -0
- package/storybook-static/720.f44d4e1f5203b6083ae4.manager.bundle.js +0 -1
- package/storybook-static/73ba1c910e0f7bfc6b18.woff2 +0 -0
- package/storybook-static/837.1b65801453b1ce7ef7d1.manager.bundle.js +0 -1
- package/storybook-static/837.95523cc4.iframe.bundle.js +0 -1
- package/storybook-static/8a142c29a318c432117a.woff +0 -0
- package/storybook-static/914.d1f142bbe477c1136f06.manager.bundle.js +0 -1
- package/storybook-static/914.feb1fea5.iframe.bundle.js +0 -1
- package/storybook-static/9db5d05810cb98f2831f.ttf +0 -0
- package/storybook-static/9ff97e342523931a4992.eot +0 -0
- package/storybook-static/a40d436619020fb67db5.woff +0 -0
- package/storybook-static/a46b8d4aa3504103cdde.ttf +0 -0
- package/storybook-static/b53d0e74edc5a5fbef0a.ttf +0 -0
- package/storybook-static/c12a83f816844ff94375.ttf +0 -0
- package/storybook-static/c807e115c00aaffbac11.woff2 +0 -0
- package/storybook-static/cadb6b94d6b0ecc3a86a.woff2 +0 -0
- package/storybook-static/d0cff1b064bcd84324fe.eot +0 -0
- package/storybook-static/d3434771ad7e9030387e.ttf +0 -0
- package/storybook-static/d8610c2a4fe5c177f4f6.woff +0 -0
- package/storybook-static/d970f426740b938f39e1.woff +0 -0
- package/storybook-static/d9c7eba773ff1c8df5bb.eot +0 -0
- package/storybook-static/dd4645bdb2f1e1a47ed7.woff2 +0 -0
- package/storybook-static/e0a63577ac642885f067.eot +0 -0
- package/storybook-static/f632ebfa0d7b7085d542.woff2 +0 -0
- package/storybook-static/f93e2252d7112c3bcca5.woff2 +0 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +0 -364
- package/storybook-static/index.html +0 -59
- package/storybook-static/main.28d30a3024752e90423a.manager.bundle.js +0 -1
- package/storybook-static/main.3ae24e12.iframe.bundle.js +0 -1
- package/storybook-static/project.json +0 -1
- package/storybook-static/reactPlayerDailyMotion.469cc00f.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerFacebook.1423bb15.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerFilePlayer.e19e24a0.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerKaltura.d1eb0868.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerMixcloud.9f1b1691.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerPreview.9295696b.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerSoundCloud.d420395c.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerStreamable.9b655bf3.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerTwitch.e90e6dea.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerVidyard.a37ae6b3.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerVimeo.a7f367ee.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerWistia.fb351944.iframe.bundle.js +0 -1
- package/storybook-static/reactPlayerYouTube.3514e11a.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.3bae6a4f.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.e45b096081911dbee3c7.manager.bundle.js +0 -1
- package/storybook-static/static/css/main.19ed5330.css +0 -3
- package/storybook-static/static/css/main.19ed5330.css.map +0 -1
|
@@ -0,0 +1,1450 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import require$$0, { useState, createRef } from 'react';
|
|
3
|
+
import { g as getAugmentedNamespace, c as commonjsGlobal, a as getDefaultExportFromCjs } from '../../_commonjsHelpers-849bcf65.js';
|
|
4
|
+
import { u as utils, p as patterns, c as cjs } from '../../patterns-3a3fa9d6.js';
|
|
5
|
+
import { p as propTypesExports } from '../../index-8ebb2cc1.js';
|
|
6
|
+
import { findDOMNode } from 'react-dom';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
9
|
+
import hoursMinutesSeconds from '../../utils/hoursMinutesSeconds.js';
|
|
10
|
+
import screenfull from 'screenfull';
|
|
11
|
+
import 'tslib';
|
|
12
|
+
import '../../GlobalCtx-7fb23cfa.js';
|
|
13
|
+
|
|
14
|
+
var lazy = {};
|
|
15
|
+
|
|
16
|
+
var players = {};
|
|
17
|
+
|
|
18
|
+
(function (exports) {
|
|
19
|
+
|
|
20
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
exports["default"] = void 0;
|
|
24
|
+
|
|
25
|
+
var _react = require$$0;
|
|
26
|
+
|
|
27
|
+
var _utils = utils;
|
|
28
|
+
|
|
29
|
+
var _patterns = patterns;
|
|
30
|
+
|
|
31
|
+
var _default = [{
|
|
32
|
+
key: 'youtube',
|
|
33
|
+
name: 'YouTube',
|
|
34
|
+
canPlay: _patterns.canPlay.youtube,
|
|
35
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
36
|
+
return import(
|
|
37
|
+
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
38
|
+
'../../YouTube-d58f130b.js').then(function (n) { return n.Y; });
|
|
39
|
+
})
|
|
40
|
+
}, {
|
|
41
|
+
key: 'soundcloud',
|
|
42
|
+
name: 'SoundCloud',
|
|
43
|
+
canPlay: _patterns.canPlay.soundcloud,
|
|
44
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
45
|
+
return import(
|
|
46
|
+
/* webpackChunkName: 'reactPlayerSoundCloud' */
|
|
47
|
+
'../../SoundCloud-306d6c78.js').then(function (n) { return n.S; });
|
|
48
|
+
})
|
|
49
|
+
}, {
|
|
50
|
+
key: 'vimeo',
|
|
51
|
+
name: 'Vimeo',
|
|
52
|
+
canPlay: _patterns.canPlay.vimeo,
|
|
53
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
54
|
+
return import(
|
|
55
|
+
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
56
|
+
'../../Vimeo-074f2c39.js').then(function (n) { return n.V; });
|
|
57
|
+
})
|
|
58
|
+
}, {
|
|
59
|
+
key: 'facebook',
|
|
60
|
+
name: 'Facebook',
|
|
61
|
+
canPlay: _patterns.canPlay.facebook,
|
|
62
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
63
|
+
return import(
|
|
64
|
+
/* webpackChunkName: 'reactPlayerFacebook' */
|
|
65
|
+
'../../Facebook-c3c77787.js').then(function (n) { return n.F; });
|
|
66
|
+
})
|
|
67
|
+
}, {
|
|
68
|
+
key: 'streamable',
|
|
69
|
+
name: 'Streamable',
|
|
70
|
+
canPlay: _patterns.canPlay.streamable,
|
|
71
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
72
|
+
return import(
|
|
73
|
+
/* webpackChunkName: 'reactPlayerStreamable' */
|
|
74
|
+
'../../Streamable-aa3d544e.js').then(function (n) { return n.S; });
|
|
75
|
+
})
|
|
76
|
+
}, {
|
|
77
|
+
key: 'wistia',
|
|
78
|
+
name: 'Wistia',
|
|
79
|
+
canPlay: _patterns.canPlay.wistia,
|
|
80
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
81
|
+
return import(
|
|
82
|
+
/* webpackChunkName: 'reactPlayerWistia' */
|
|
83
|
+
'../../Wistia-0a2b73b0.js').then(function (n) { return n.W; });
|
|
84
|
+
})
|
|
85
|
+
}, {
|
|
86
|
+
key: 'twitch',
|
|
87
|
+
name: 'Twitch',
|
|
88
|
+
canPlay: _patterns.canPlay.twitch,
|
|
89
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
90
|
+
return import(
|
|
91
|
+
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
92
|
+
'../../Twitch-4a1a1565.js').then(function (n) { return n.T; });
|
|
93
|
+
})
|
|
94
|
+
}, {
|
|
95
|
+
key: 'dailymotion',
|
|
96
|
+
name: 'DailyMotion',
|
|
97
|
+
canPlay: _patterns.canPlay.dailymotion,
|
|
98
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
99
|
+
return import(
|
|
100
|
+
/* webpackChunkName: 'reactPlayerDailyMotion' */
|
|
101
|
+
'../../DailyMotion-b35dc8bb.js').then(function (n) { return n.D; });
|
|
102
|
+
})
|
|
103
|
+
}, {
|
|
104
|
+
key: 'mixcloud',
|
|
105
|
+
name: 'Mixcloud',
|
|
106
|
+
canPlay: _patterns.canPlay.mixcloud,
|
|
107
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
108
|
+
return import(
|
|
109
|
+
/* webpackChunkName: 'reactPlayerMixcloud' */
|
|
110
|
+
'../../Mixcloud-3d4e0760.js').then(function (n) { return n.M; });
|
|
111
|
+
})
|
|
112
|
+
}, {
|
|
113
|
+
key: 'vidyard',
|
|
114
|
+
name: 'Vidyard',
|
|
115
|
+
canPlay: _patterns.canPlay.vidyard,
|
|
116
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
117
|
+
return import(
|
|
118
|
+
/* webpackChunkName: 'reactPlayerVidyard' */
|
|
119
|
+
'../../Vidyard-fe74c274.js').then(function (n) { return n.V; });
|
|
120
|
+
})
|
|
121
|
+
}, {
|
|
122
|
+
key: 'kaltura',
|
|
123
|
+
name: 'Kaltura',
|
|
124
|
+
canPlay: _patterns.canPlay.kaltura,
|
|
125
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
126
|
+
return import(
|
|
127
|
+
/* webpackChunkName: 'reactPlayerKaltura' */
|
|
128
|
+
'../../Kaltura-4ac3cda3.js').then(function (n) { return n.K; });
|
|
129
|
+
})
|
|
130
|
+
}, {
|
|
131
|
+
key: 'file',
|
|
132
|
+
name: 'FilePlayer',
|
|
133
|
+
canPlay: _patterns.canPlay.file,
|
|
134
|
+
canEnablePIP: function canEnablePIP(url) {
|
|
135
|
+
return _patterns.canPlay.file(url) && (document.pictureInPictureEnabled || (0, _utils.supportsWebKitPresentationMode)()) && !_patterns.AUDIO_EXTENSIONS.test(url);
|
|
136
|
+
},
|
|
137
|
+
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
138
|
+
return import(
|
|
139
|
+
/* webpackChunkName: 'reactPlayerFilePlayer' */
|
|
140
|
+
'../../FilePlayer-540e4c5a.js').then(function (n) { return n.F; });
|
|
141
|
+
})
|
|
142
|
+
}];
|
|
143
|
+
exports["default"] = _default;
|
|
144
|
+
} (players));
|
|
145
|
+
|
|
146
|
+
var ReactPlayer$1 = {};
|
|
147
|
+
|
|
148
|
+
var safeIsNaN = Number.isNaN ||
|
|
149
|
+
function ponyfill(value) {
|
|
150
|
+
return typeof value === 'number' && value !== value;
|
|
151
|
+
};
|
|
152
|
+
function isEqual(first, second) {
|
|
153
|
+
if (first === second) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
function areInputsEqual(newInputs, lastInputs) {
|
|
162
|
+
if (newInputs.length !== lastInputs.length) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
for (var i = 0; i < newInputs.length; i++) {
|
|
166
|
+
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function memoizeOne(resultFn, isEqual) {
|
|
174
|
+
if (isEqual === void 0) { isEqual = areInputsEqual; }
|
|
175
|
+
var lastThis;
|
|
176
|
+
var lastArgs = [];
|
|
177
|
+
var lastResult;
|
|
178
|
+
var calledOnce = false;
|
|
179
|
+
function memoized() {
|
|
180
|
+
var newArgs = [];
|
|
181
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
182
|
+
newArgs[_i] = arguments[_i];
|
|
183
|
+
}
|
|
184
|
+
if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
|
|
185
|
+
return lastResult;
|
|
186
|
+
}
|
|
187
|
+
lastResult = resultFn.apply(this, newArgs);
|
|
188
|
+
calledOnce = true;
|
|
189
|
+
lastThis = this;
|
|
190
|
+
lastArgs = newArgs;
|
|
191
|
+
return lastResult;
|
|
192
|
+
}
|
|
193
|
+
return memoized;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var memoizeOne_esm = /*#__PURE__*/Object.freeze({
|
|
197
|
+
__proto__: null,
|
|
198
|
+
default: memoizeOne
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
var require$$2 = /*@__PURE__*/getAugmentedNamespace(memoizeOne_esm);
|
|
202
|
+
|
|
203
|
+
/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
|
|
204
|
+
|
|
205
|
+
var hasElementType = typeof Element !== 'undefined';
|
|
206
|
+
var hasMap = typeof Map === 'function';
|
|
207
|
+
var hasSet = typeof Set === 'function';
|
|
208
|
+
var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;
|
|
209
|
+
|
|
210
|
+
// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
|
|
211
|
+
|
|
212
|
+
function equal(a, b) {
|
|
213
|
+
// START: fast-deep-equal es6/index.js 3.1.1
|
|
214
|
+
if (a === b) return true;
|
|
215
|
+
|
|
216
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
217
|
+
if (a.constructor !== b.constructor) return false;
|
|
218
|
+
|
|
219
|
+
var length, i, keys;
|
|
220
|
+
if (Array.isArray(a)) {
|
|
221
|
+
length = a.length;
|
|
222
|
+
if (length != b.length) return false;
|
|
223
|
+
for (i = length; i-- !== 0;)
|
|
224
|
+
if (!equal(a[i], b[i])) return false;
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// START: Modifications:
|
|
229
|
+
// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
|
|
230
|
+
// to co-exist with es5.
|
|
231
|
+
// 2. Replace `for of` with es5 compliant iteration using `for`.
|
|
232
|
+
// Basically, take:
|
|
233
|
+
//
|
|
234
|
+
// ```js
|
|
235
|
+
// for (i of a.entries())
|
|
236
|
+
// if (!b.has(i[0])) return false;
|
|
237
|
+
// ```
|
|
238
|
+
//
|
|
239
|
+
// ... and convert to:
|
|
240
|
+
//
|
|
241
|
+
// ```js
|
|
242
|
+
// it = a.entries();
|
|
243
|
+
// while (!(i = it.next()).done)
|
|
244
|
+
// if (!b.has(i.value[0])) return false;
|
|
245
|
+
// ```
|
|
246
|
+
//
|
|
247
|
+
// **Note**: `i` access switches to `i.value`.
|
|
248
|
+
var it;
|
|
249
|
+
if (hasMap && (a instanceof Map) && (b instanceof Map)) {
|
|
250
|
+
if (a.size !== b.size) return false;
|
|
251
|
+
it = a.entries();
|
|
252
|
+
while (!(i = it.next()).done)
|
|
253
|
+
if (!b.has(i.value[0])) return false;
|
|
254
|
+
it = a.entries();
|
|
255
|
+
while (!(i = it.next()).done)
|
|
256
|
+
if (!equal(i.value[1], b.get(i.value[0]))) return false;
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (hasSet && (a instanceof Set) && (b instanceof Set)) {
|
|
261
|
+
if (a.size !== b.size) return false;
|
|
262
|
+
it = a.entries();
|
|
263
|
+
while (!(i = it.next()).done)
|
|
264
|
+
if (!b.has(i.value[0])) return false;
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
// END: Modifications
|
|
268
|
+
|
|
269
|
+
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
270
|
+
length = a.length;
|
|
271
|
+
if (length != b.length) return false;
|
|
272
|
+
for (i = length; i-- !== 0;)
|
|
273
|
+
if (a[i] !== b[i]) return false;
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
278
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
279
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
280
|
+
|
|
281
|
+
keys = Object.keys(a);
|
|
282
|
+
length = keys.length;
|
|
283
|
+
if (length !== Object.keys(b).length) return false;
|
|
284
|
+
|
|
285
|
+
for (i = length; i-- !== 0;)
|
|
286
|
+
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
287
|
+
// END: fast-deep-equal
|
|
288
|
+
|
|
289
|
+
// START: react-fast-compare
|
|
290
|
+
// custom handling for DOM elements
|
|
291
|
+
if (hasElementType && a instanceof Element) return false;
|
|
292
|
+
|
|
293
|
+
// custom handling for React/Preact
|
|
294
|
+
for (i = length; i-- !== 0;) {
|
|
295
|
+
if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
|
|
296
|
+
// React-specific: avoid traversing React elements' _owner
|
|
297
|
+
// Preact-specific: avoid traversing Preact elements' __v and __o
|
|
298
|
+
// __v = $_original / $_vnode
|
|
299
|
+
// __o = $_owner
|
|
300
|
+
// These properties contain circular references and are not needed when
|
|
301
|
+
// comparing the actual elements (and not their owners)
|
|
302
|
+
// .$$typeof and ._store on just reasonable markers of elements
|
|
303
|
+
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// all other properties should be traversed as usual
|
|
308
|
+
if (!equal(a[keys[i]], b[keys[i]])) return false;
|
|
309
|
+
}
|
|
310
|
+
// END: react-fast-compare
|
|
311
|
+
|
|
312
|
+
// START: fast-deep-equal
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return a !== a && b !== b;
|
|
317
|
+
}
|
|
318
|
+
// end fast-deep-equal
|
|
319
|
+
|
|
320
|
+
var reactFastCompare = function isEqual(a, b) {
|
|
321
|
+
try {
|
|
322
|
+
return equal(a, b);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
if (((error.message || '').match(/stack|recursion/i))) {
|
|
325
|
+
// warn on circular references, don't crash
|
|
326
|
+
// browsers give this different errors name and messages:
|
|
327
|
+
// chrome/safari: "RangeError", "Maximum call stack size exceeded"
|
|
328
|
+
// firefox: "InternalError", too much recursion"
|
|
329
|
+
// edge: "Error", "Out of stack space"
|
|
330
|
+
console.warn('react-fast-compare cannot handle circular refs');
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
// some other error. we should definitely know about these
|
|
334
|
+
throw error;
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
var props = {};
|
|
339
|
+
|
|
340
|
+
Object.defineProperty(props, "__esModule", {
|
|
341
|
+
value: true
|
|
342
|
+
});
|
|
343
|
+
props.defaultProps = props.propTypes = void 0;
|
|
344
|
+
|
|
345
|
+
var _propTypes = _interopRequireDefault$1(propTypesExports);
|
|
346
|
+
|
|
347
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
348
|
+
|
|
349
|
+
var string = _propTypes["default"].string,
|
|
350
|
+
bool = _propTypes["default"].bool,
|
|
351
|
+
number = _propTypes["default"].number,
|
|
352
|
+
array = _propTypes["default"].array,
|
|
353
|
+
oneOfType = _propTypes["default"].oneOfType,
|
|
354
|
+
shape = _propTypes["default"].shape,
|
|
355
|
+
object = _propTypes["default"].object,
|
|
356
|
+
func = _propTypes["default"].func,
|
|
357
|
+
node = _propTypes["default"].node;
|
|
358
|
+
var propTypes = {
|
|
359
|
+
url: oneOfType([string, array, object]),
|
|
360
|
+
playing: bool,
|
|
361
|
+
loop: bool,
|
|
362
|
+
controls: bool,
|
|
363
|
+
volume: number,
|
|
364
|
+
muted: bool,
|
|
365
|
+
playbackRate: number,
|
|
366
|
+
width: oneOfType([string, number]),
|
|
367
|
+
height: oneOfType([string, number]),
|
|
368
|
+
style: object,
|
|
369
|
+
progressInterval: number,
|
|
370
|
+
playsinline: bool,
|
|
371
|
+
pip: bool,
|
|
372
|
+
stopOnUnmount: bool,
|
|
373
|
+
light: oneOfType([bool, string]),
|
|
374
|
+
playIcon: node,
|
|
375
|
+
previewTabIndex: number,
|
|
376
|
+
fallback: node,
|
|
377
|
+
oEmbedUrl: string,
|
|
378
|
+
wrapper: oneOfType([string, func, shape({
|
|
379
|
+
render: func.isRequired
|
|
380
|
+
})]),
|
|
381
|
+
config: shape({
|
|
382
|
+
soundcloud: shape({
|
|
383
|
+
options: object
|
|
384
|
+
}),
|
|
385
|
+
youtube: shape({
|
|
386
|
+
playerVars: object,
|
|
387
|
+
embedOptions: object,
|
|
388
|
+
onUnstarted: func
|
|
389
|
+
}),
|
|
390
|
+
facebook: shape({
|
|
391
|
+
appId: string,
|
|
392
|
+
version: string,
|
|
393
|
+
playerId: string,
|
|
394
|
+
attributes: object
|
|
395
|
+
}),
|
|
396
|
+
dailymotion: shape({
|
|
397
|
+
params: object
|
|
398
|
+
}),
|
|
399
|
+
vimeo: shape({
|
|
400
|
+
playerOptions: object,
|
|
401
|
+
title: string
|
|
402
|
+
}),
|
|
403
|
+
file: shape({
|
|
404
|
+
attributes: object,
|
|
405
|
+
tracks: array,
|
|
406
|
+
forceVideo: bool,
|
|
407
|
+
forceAudio: bool,
|
|
408
|
+
forceHLS: bool,
|
|
409
|
+
forceDASH: bool,
|
|
410
|
+
forceFLV: bool,
|
|
411
|
+
hlsOptions: object,
|
|
412
|
+
hlsVersion: string,
|
|
413
|
+
dashVersion: string,
|
|
414
|
+
flvVersion: string
|
|
415
|
+
}),
|
|
416
|
+
wistia: shape({
|
|
417
|
+
options: object,
|
|
418
|
+
playerId: string,
|
|
419
|
+
customControls: array
|
|
420
|
+
}),
|
|
421
|
+
mixcloud: shape({
|
|
422
|
+
options: object
|
|
423
|
+
}),
|
|
424
|
+
twitch: shape({
|
|
425
|
+
options: object,
|
|
426
|
+
playerId: string
|
|
427
|
+
}),
|
|
428
|
+
vidyard: shape({
|
|
429
|
+
options: object
|
|
430
|
+
})
|
|
431
|
+
}),
|
|
432
|
+
onReady: func,
|
|
433
|
+
onStart: func,
|
|
434
|
+
onPlay: func,
|
|
435
|
+
onPause: func,
|
|
436
|
+
onBuffer: func,
|
|
437
|
+
onBufferEnd: func,
|
|
438
|
+
onEnded: func,
|
|
439
|
+
onError: func,
|
|
440
|
+
onDuration: func,
|
|
441
|
+
onSeek: func,
|
|
442
|
+
onPlaybackRateChange: func,
|
|
443
|
+
onProgress: func,
|
|
444
|
+
onClickPreview: func,
|
|
445
|
+
onEnablePIP: func,
|
|
446
|
+
onDisablePIP: func
|
|
447
|
+
};
|
|
448
|
+
props.propTypes = propTypes;
|
|
449
|
+
|
|
450
|
+
var noop = function noop() {};
|
|
451
|
+
|
|
452
|
+
var defaultProps = {
|
|
453
|
+
playing: false,
|
|
454
|
+
loop: false,
|
|
455
|
+
controls: false,
|
|
456
|
+
volume: null,
|
|
457
|
+
muted: false,
|
|
458
|
+
playbackRate: 1,
|
|
459
|
+
width: '640px',
|
|
460
|
+
height: '360px',
|
|
461
|
+
style: {},
|
|
462
|
+
progressInterval: 1000,
|
|
463
|
+
playsinline: false,
|
|
464
|
+
pip: false,
|
|
465
|
+
stopOnUnmount: true,
|
|
466
|
+
light: false,
|
|
467
|
+
fallback: null,
|
|
468
|
+
wrapper: 'div',
|
|
469
|
+
previewTabIndex: 0,
|
|
470
|
+
oEmbedUrl: 'https://noembed.com/embed?url={url}',
|
|
471
|
+
config: {
|
|
472
|
+
soundcloud: {
|
|
473
|
+
options: {
|
|
474
|
+
visual: true,
|
|
475
|
+
// Undocumented, but makes player fill container and look better
|
|
476
|
+
buying: false,
|
|
477
|
+
liking: false,
|
|
478
|
+
download: false,
|
|
479
|
+
sharing: false,
|
|
480
|
+
show_comments: false,
|
|
481
|
+
show_playcount: false
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
youtube: {
|
|
485
|
+
playerVars: {
|
|
486
|
+
playsinline: 1,
|
|
487
|
+
showinfo: 0,
|
|
488
|
+
rel: 0,
|
|
489
|
+
iv_load_policy: 3,
|
|
490
|
+
modestbranding: 1
|
|
491
|
+
},
|
|
492
|
+
embedOptions: {},
|
|
493
|
+
onUnstarted: noop
|
|
494
|
+
},
|
|
495
|
+
facebook: {
|
|
496
|
+
appId: '1309697205772819',
|
|
497
|
+
version: 'v3.3',
|
|
498
|
+
playerId: null,
|
|
499
|
+
attributes: {}
|
|
500
|
+
},
|
|
501
|
+
dailymotion: {
|
|
502
|
+
params: {
|
|
503
|
+
api: 1,
|
|
504
|
+
'endscreen-enable': false
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
vimeo: {
|
|
508
|
+
playerOptions: {
|
|
509
|
+
autopause: false,
|
|
510
|
+
byline: false,
|
|
511
|
+
portrait: false,
|
|
512
|
+
title: false
|
|
513
|
+
},
|
|
514
|
+
title: null
|
|
515
|
+
},
|
|
516
|
+
file: {
|
|
517
|
+
attributes: {},
|
|
518
|
+
tracks: [],
|
|
519
|
+
forceVideo: false,
|
|
520
|
+
forceAudio: false,
|
|
521
|
+
forceHLS: false,
|
|
522
|
+
forceDASH: false,
|
|
523
|
+
forceFLV: false,
|
|
524
|
+
hlsOptions: {},
|
|
525
|
+
hlsVersion: '1.1.4',
|
|
526
|
+
dashVersion: '3.1.3',
|
|
527
|
+
flvVersion: '1.5.0'
|
|
528
|
+
},
|
|
529
|
+
wistia: {
|
|
530
|
+
options: {},
|
|
531
|
+
playerId: null,
|
|
532
|
+
customControls: null
|
|
533
|
+
},
|
|
534
|
+
mixcloud: {
|
|
535
|
+
options: {
|
|
536
|
+
hide_cover: 1
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
twitch: {
|
|
540
|
+
options: {},
|
|
541
|
+
playerId: null
|
|
542
|
+
},
|
|
543
|
+
vidyard: {
|
|
544
|
+
options: {}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
onReady: noop,
|
|
548
|
+
onStart: noop,
|
|
549
|
+
onPlay: noop,
|
|
550
|
+
onPause: noop,
|
|
551
|
+
onBuffer: noop,
|
|
552
|
+
onBufferEnd: noop,
|
|
553
|
+
onEnded: noop,
|
|
554
|
+
onError: noop,
|
|
555
|
+
onDuration: noop,
|
|
556
|
+
onSeek: noop,
|
|
557
|
+
onPlaybackRateChange: noop,
|
|
558
|
+
onProgress: noop,
|
|
559
|
+
onClickPreview: noop,
|
|
560
|
+
onEnablePIP: noop,
|
|
561
|
+
onDisablePIP: noop
|
|
562
|
+
};
|
|
563
|
+
props.defaultProps = defaultProps;
|
|
564
|
+
|
|
565
|
+
var Player = {};
|
|
566
|
+
|
|
567
|
+
(function (exports) {
|
|
568
|
+
|
|
569
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
570
|
+
|
|
571
|
+
Object.defineProperty(exports, "__esModule", {
|
|
572
|
+
value: true
|
|
573
|
+
});
|
|
574
|
+
exports["default"] = void 0;
|
|
575
|
+
|
|
576
|
+
var _react = _interopRequireWildcard(require$$0);
|
|
577
|
+
|
|
578
|
+
var _reactFastCompare = _interopRequireDefault(reactFastCompare);
|
|
579
|
+
|
|
580
|
+
var _props = props;
|
|
581
|
+
|
|
582
|
+
var _utils = utils;
|
|
583
|
+
|
|
584
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
585
|
+
|
|
586
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
587
|
+
|
|
588
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
589
|
+
|
|
590
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
591
|
+
|
|
592
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
593
|
+
|
|
594
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
595
|
+
|
|
596
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
597
|
+
|
|
598
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
599
|
+
|
|
600
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
601
|
+
|
|
602
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
603
|
+
|
|
604
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
605
|
+
|
|
606
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
607
|
+
|
|
608
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
609
|
+
|
|
610
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
611
|
+
|
|
612
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
613
|
+
|
|
614
|
+
var SEEK_ON_PLAY_EXPIRY = 5000;
|
|
615
|
+
|
|
616
|
+
var Player = /*#__PURE__*/function (_Component) {
|
|
617
|
+
_inherits(Player, _Component);
|
|
618
|
+
|
|
619
|
+
var _super = _createSuper(Player);
|
|
620
|
+
|
|
621
|
+
function Player() {
|
|
622
|
+
var _this;
|
|
623
|
+
|
|
624
|
+
_classCallCheck(this, Player);
|
|
625
|
+
|
|
626
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
627
|
+
_args[_key] = arguments[_key];
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
_this = _super.call.apply(_super, [this].concat(_args));
|
|
631
|
+
|
|
632
|
+
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
633
|
+
|
|
634
|
+
_defineProperty(_assertThisInitialized(_this), "isReady", false);
|
|
635
|
+
|
|
636
|
+
_defineProperty(_assertThisInitialized(_this), "isPlaying", false);
|
|
637
|
+
|
|
638
|
+
_defineProperty(_assertThisInitialized(_this), "isLoading", true);
|
|
639
|
+
|
|
640
|
+
_defineProperty(_assertThisInitialized(_this), "loadOnReady", null);
|
|
641
|
+
|
|
642
|
+
_defineProperty(_assertThisInitialized(_this), "startOnPlay", true);
|
|
643
|
+
|
|
644
|
+
_defineProperty(_assertThisInitialized(_this), "seekOnPlay", null);
|
|
645
|
+
|
|
646
|
+
_defineProperty(_assertThisInitialized(_this), "onDurationCalled", false);
|
|
647
|
+
|
|
648
|
+
_defineProperty(_assertThisInitialized(_this), "handlePlayerMount", function (player) {
|
|
649
|
+
if (_this.player) return; // Prevent loading twice in strict mode
|
|
650
|
+
|
|
651
|
+
_this.player = player;
|
|
652
|
+
|
|
653
|
+
_this.player.load(_this.props.url);
|
|
654
|
+
|
|
655
|
+
_this.progress();
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {
|
|
659
|
+
if (!_this.player) return null;
|
|
660
|
+
return _this.player[key];
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
_defineProperty(_assertThisInitialized(_this), "progress", function () {
|
|
664
|
+
if (_this.props.url && _this.player && _this.isReady) {
|
|
665
|
+
var playedSeconds = _this.getCurrentTime() || 0;
|
|
666
|
+
|
|
667
|
+
var loadedSeconds = _this.getSecondsLoaded();
|
|
668
|
+
|
|
669
|
+
var duration = _this.getDuration();
|
|
670
|
+
|
|
671
|
+
if (duration) {
|
|
672
|
+
var progress = {
|
|
673
|
+
playedSeconds: playedSeconds,
|
|
674
|
+
played: playedSeconds / duration
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
if (loadedSeconds !== null) {
|
|
678
|
+
progress.loadedSeconds = loadedSeconds;
|
|
679
|
+
progress.loaded = loadedSeconds / duration;
|
|
680
|
+
} // Only call onProgress if values have changed
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {
|
|
684
|
+
_this.props.onProgress(progress);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
_this.prevPlayed = progress.playedSeconds;
|
|
688
|
+
_this.prevLoaded = progress.loadedSeconds;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
_this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
_defineProperty(_assertThisInitialized(_this), "handleReady", function () {
|
|
696
|
+
if (!_this.mounted) return;
|
|
697
|
+
_this.isReady = true;
|
|
698
|
+
_this.isLoading = false;
|
|
699
|
+
var _this$props = _this.props,
|
|
700
|
+
onReady = _this$props.onReady,
|
|
701
|
+
playing = _this$props.playing,
|
|
702
|
+
volume = _this$props.volume,
|
|
703
|
+
muted = _this$props.muted;
|
|
704
|
+
onReady();
|
|
705
|
+
|
|
706
|
+
if (!muted && volume !== null) {
|
|
707
|
+
_this.player.setVolume(volume);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
if (_this.loadOnReady) {
|
|
711
|
+
_this.player.load(_this.loadOnReady, true);
|
|
712
|
+
|
|
713
|
+
_this.loadOnReady = null;
|
|
714
|
+
} else if (playing) {
|
|
715
|
+
_this.player.play();
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
_this.handleDurationCheck();
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
_defineProperty(_assertThisInitialized(_this), "handlePlay", function () {
|
|
722
|
+
_this.isPlaying = true;
|
|
723
|
+
_this.isLoading = false;
|
|
724
|
+
var _this$props2 = _this.props,
|
|
725
|
+
onStart = _this$props2.onStart,
|
|
726
|
+
onPlay = _this$props2.onPlay,
|
|
727
|
+
playbackRate = _this$props2.playbackRate;
|
|
728
|
+
|
|
729
|
+
if (_this.startOnPlay) {
|
|
730
|
+
if (_this.player.setPlaybackRate && playbackRate !== 1) {
|
|
731
|
+
_this.player.setPlaybackRate(playbackRate);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
onStart();
|
|
735
|
+
_this.startOnPlay = false;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
onPlay();
|
|
739
|
+
|
|
740
|
+
if (_this.seekOnPlay) {
|
|
741
|
+
_this.seekTo(_this.seekOnPlay);
|
|
742
|
+
|
|
743
|
+
_this.seekOnPlay = null;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
_this.handleDurationCheck();
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
_defineProperty(_assertThisInitialized(_this), "handlePause", function (e) {
|
|
750
|
+
_this.isPlaying = false;
|
|
751
|
+
|
|
752
|
+
if (!_this.isLoading) {
|
|
753
|
+
_this.props.onPause(e);
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
_defineProperty(_assertThisInitialized(_this), "handleEnded", function () {
|
|
758
|
+
var _this$props3 = _this.props,
|
|
759
|
+
activePlayer = _this$props3.activePlayer,
|
|
760
|
+
loop = _this$props3.loop,
|
|
761
|
+
onEnded = _this$props3.onEnded;
|
|
762
|
+
|
|
763
|
+
if (activePlayer.loopOnEnded && loop) {
|
|
764
|
+
_this.seekTo(0);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
if (!loop) {
|
|
768
|
+
_this.isPlaying = false;
|
|
769
|
+
onEnded();
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
_defineProperty(_assertThisInitialized(_this), "handleError", function () {
|
|
774
|
+
var _this$props4;
|
|
775
|
+
|
|
776
|
+
_this.isLoading = false;
|
|
777
|
+
|
|
778
|
+
(_this$props4 = _this.props).onError.apply(_this$props4, arguments);
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
_defineProperty(_assertThisInitialized(_this), "handleDurationCheck", function () {
|
|
782
|
+
clearTimeout(_this.durationCheckTimeout);
|
|
783
|
+
|
|
784
|
+
var duration = _this.getDuration();
|
|
785
|
+
|
|
786
|
+
if (duration) {
|
|
787
|
+
if (!_this.onDurationCalled) {
|
|
788
|
+
_this.props.onDuration(duration);
|
|
789
|
+
|
|
790
|
+
_this.onDurationCalled = true;
|
|
791
|
+
}
|
|
792
|
+
} else {
|
|
793
|
+
_this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
_defineProperty(_assertThisInitialized(_this), "handleLoaded", function () {
|
|
798
|
+
// Sometimes we know loading has stopped but onReady/onPlay are never called
|
|
799
|
+
// so this provides a way for players to avoid getting stuck
|
|
800
|
+
_this.isLoading = false;
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
return _this;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
_createClass(Player, [{
|
|
807
|
+
key: "componentDidMount",
|
|
808
|
+
value: function componentDidMount() {
|
|
809
|
+
this.mounted = true;
|
|
810
|
+
}
|
|
811
|
+
}, {
|
|
812
|
+
key: "componentWillUnmount",
|
|
813
|
+
value: function componentWillUnmount() {
|
|
814
|
+
clearTimeout(this.progressTimeout);
|
|
815
|
+
clearTimeout(this.durationCheckTimeout);
|
|
816
|
+
|
|
817
|
+
if (this.isReady && this.props.stopOnUnmount) {
|
|
818
|
+
this.player.stop();
|
|
819
|
+
|
|
820
|
+
if (this.player.disablePIP) {
|
|
821
|
+
this.player.disablePIP();
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
this.mounted = false;
|
|
826
|
+
}
|
|
827
|
+
}, {
|
|
828
|
+
key: "componentDidUpdate",
|
|
829
|
+
value: function componentDidUpdate(prevProps) {
|
|
830
|
+
var _this2 = this;
|
|
831
|
+
|
|
832
|
+
// If there isn’t a player available, don’t do anything
|
|
833
|
+
if (!this.player) {
|
|
834
|
+
return;
|
|
835
|
+
} // Invoke player methods based on changed props
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
var _this$props5 = this.props,
|
|
839
|
+
url = _this$props5.url,
|
|
840
|
+
playing = _this$props5.playing,
|
|
841
|
+
volume = _this$props5.volume,
|
|
842
|
+
muted = _this$props5.muted,
|
|
843
|
+
playbackRate = _this$props5.playbackRate,
|
|
844
|
+
pip = _this$props5.pip,
|
|
845
|
+
loop = _this$props5.loop,
|
|
846
|
+
activePlayer = _this$props5.activePlayer,
|
|
847
|
+
disableDeferredLoading = _this$props5.disableDeferredLoading;
|
|
848
|
+
|
|
849
|
+
if (!(0, _reactFastCompare["default"])(prevProps.url, url)) {
|
|
850
|
+
if (this.isLoading && !activePlayer.forceLoad && !disableDeferredLoading && !(0, _utils.isMediaStream)(url)) {
|
|
851
|
+
console.warn("ReactPlayer: the attempt to load ".concat(url, " is being deferred until the player has loaded"));
|
|
852
|
+
this.loadOnReady = url;
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
this.isLoading = true;
|
|
857
|
+
this.startOnPlay = true;
|
|
858
|
+
this.onDurationCalled = false;
|
|
859
|
+
this.player.load(url, this.isReady);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
if (!prevProps.playing && playing && !this.isPlaying) {
|
|
863
|
+
this.player.play();
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
if (prevProps.playing && !playing && this.isPlaying) {
|
|
867
|
+
this.player.pause();
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
if (!prevProps.pip && pip && this.player.enablePIP) {
|
|
871
|
+
this.player.enablePIP();
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
if (prevProps.pip && !pip && this.player.disablePIP) {
|
|
875
|
+
this.player.disablePIP();
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
if (prevProps.volume !== volume && volume !== null) {
|
|
879
|
+
this.player.setVolume(volume);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
if (prevProps.muted !== muted) {
|
|
883
|
+
if (muted) {
|
|
884
|
+
this.player.mute();
|
|
885
|
+
} else {
|
|
886
|
+
this.player.unmute();
|
|
887
|
+
|
|
888
|
+
if (volume !== null) {
|
|
889
|
+
// Set volume next tick to fix a bug with DailyMotion
|
|
890
|
+
setTimeout(function () {
|
|
891
|
+
return _this2.player.setVolume(volume);
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
|
|
898
|
+
this.player.setPlaybackRate(playbackRate);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
if (prevProps.loop !== loop && this.player.setLoop) {
|
|
902
|
+
this.player.setLoop(loop);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}, {
|
|
906
|
+
key: "getDuration",
|
|
907
|
+
value: function getDuration() {
|
|
908
|
+
if (!this.isReady) return null;
|
|
909
|
+
return this.player.getDuration();
|
|
910
|
+
}
|
|
911
|
+
}, {
|
|
912
|
+
key: "getCurrentTime",
|
|
913
|
+
value: function getCurrentTime() {
|
|
914
|
+
if (!this.isReady) return null;
|
|
915
|
+
return this.player.getCurrentTime();
|
|
916
|
+
}
|
|
917
|
+
}, {
|
|
918
|
+
key: "getSecondsLoaded",
|
|
919
|
+
value: function getSecondsLoaded() {
|
|
920
|
+
if (!this.isReady) return null;
|
|
921
|
+
return this.player.getSecondsLoaded();
|
|
922
|
+
}
|
|
923
|
+
}, {
|
|
924
|
+
key: "seekTo",
|
|
925
|
+
value: function seekTo(amount, type) {
|
|
926
|
+
var _this3 = this;
|
|
927
|
+
|
|
928
|
+
// When seeking before player is ready, store value and seek later
|
|
929
|
+
if (!this.isReady) {
|
|
930
|
+
if (amount !== 0) {
|
|
931
|
+
this.seekOnPlay = amount;
|
|
932
|
+
setTimeout(function () {
|
|
933
|
+
_this3.seekOnPlay = null;
|
|
934
|
+
}, SEEK_ON_PLAY_EXPIRY);
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';
|
|
941
|
+
|
|
942
|
+
if (isFraction) {
|
|
943
|
+
// Convert fraction to seconds based on duration
|
|
944
|
+
var duration = this.player.getDuration();
|
|
945
|
+
|
|
946
|
+
if (!duration) {
|
|
947
|
+
console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
this.player.seekTo(duration * amount);
|
|
952
|
+
return;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
this.player.seekTo(amount);
|
|
956
|
+
}
|
|
957
|
+
}, {
|
|
958
|
+
key: "render",
|
|
959
|
+
value: function render() {
|
|
960
|
+
var Player = this.props.activePlayer;
|
|
961
|
+
|
|
962
|
+
if (!Player) {
|
|
963
|
+
return null;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
return /*#__PURE__*/_react["default"].createElement(Player, _extends({}, this.props, {
|
|
967
|
+
onMount: this.handlePlayerMount,
|
|
968
|
+
onReady: this.handleReady,
|
|
969
|
+
onPlay: this.handlePlay,
|
|
970
|
+
onPause: this.handlePause,
|
|
971
|
+
onEnded: this.handleEnded,
|
|
972
|
+
onLoaded: this.handleLoaded,
|
|
973
|
+
onError: this.handleError
|
|
974
|
+
}));
|
|
975
|
+
}
|
|
976
|
+
}]);
|
|
977
|
+
|
|
978
|
+
return Player;
|
|
979
|
+
}(_react.Component);
|
|
980
|
+
|
|
981
|
+
exports["default"] = Player;
|
|
982
|
+
|
|
983
|
+
_defineProperty(Player, "displayName", 'Player');
|
|
984
|
+
|
|
985
|
+
_defineProperty(Player, "propTypes", _props.propTypes);
|
|
986
|
+
|
|
987
|
+
_defineProperty(Player, "defaultProps", _props.defaultProps);
|
|
988
|
+
} (Player));
|
|
989
|
+
|
|
990
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
991
|
+
|
|
992
|
+
Object.defineProperty(ReactPlayer$1, "__esModule", {
|
|
993
|
+
value: true
|
|
994
|
+
});
|
|
995
|
+
ReactPlayer$1.createReactPlayer = void 0;
|
|
996
|
+
|
|
997
|
+
var _react = _interopRequireWildcard(require$$0);
|
|
998
|
+
|
|
999
|
+
var _deepmerge = _interopRequireDefault(cjs);
|
|
1000
|
+
|
|
1001
|
+
var _memoizeOne = _interopRequireDefault(require$$2);
|
|
1002
|
+
|
|
1003
|
+
var _reactFastCompare = _interopRequireDefault(reactFastCompare);
|
|
1004
|
+
|
|
1005
|
+
var _props = props;
|
|
1006
|
+
|
|
1007
|
+
var _utils = utils;
|
|
1008
|
+
|
|
1009
|
+
var _Player3 = _interopRequireDefault(Player);
|
|
1010
|
+
|
|
1011
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1012
|
+
|
|
1013
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
1014
|
+
|
|
1015
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1016
|
+
|
|
1017
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1018
|
+
|
|
1019
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1020
|
+
|
|
1021
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1022
|
+
|
|
1023
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
1024
|
+
|
|
1025
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
1026
|
+
|
|
1027
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1028
|
+
|
|
1029
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
1030
|
+
|
|
1031
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1032
|
+
|
|
1033
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
1034
|
+
|
|
1035
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1036
|
+
|
|
1037
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1038
|
+
|
|
1039
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
1040
|
+
|
|
1041
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1042
|
+
|
|
1043
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1044
|
+
|
|
1045
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1046
|
+
|
|
1047
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
1048
|
+
|
|
1049
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1050
|
+
|
|
1051
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
1052
|
+
|
|
1053
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1054
|
+
|
|
1055
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1056
|
+
|
|
1057
|
+
var Preview = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1058
|
+
return import(
|
|
1059
|
+
/* webpackChunkName: 'reactPlayerPreview' */
|
|
1060
|
+
'../../Preview-6d2a6792.js').then(function (n) { return n.P; });
|
|
1061
|
+
});
|
|
1062
|
+
var IS_BROWSER = typeof window !== 'undefined' && window.document;
|
|
1063
|
+
var IS_GLOBAL = typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window && commonjsGlobal.window.document;
|
|
1064
|
+
var SUPPORTED_PROPS = Object.keys(_props.propTypes); // Return null when rendering on the server
|
|
1065
|
+
// as Suspense is not supported yet
|
|
1066
|
+
|
|
1067
|
+
var UniversalSuspense = IS_BROWSER || IS_GLOBAL ? _react.Suspense : function () {
|
|
1068
|
+
return null;
|
|
1069
|
+
};
|
|
1070
|
+
var customPlayers = [];
|
|
1071
|
+
|
|
1072
|
+
var createReactPlayer = function createReactPlayer(players, fallback) {
|
|
1073
|
+
var _class, _temp;
|
|
1074
|
+
|
|
1075
|
+
return _temp = _class = /*#__PURE__*/function (_Component) {
|
|
1076
|
+
_inherits(ReactPlayer, _Component);
|
|
1077
|
+
|
|
1078
|
+
var _super = _createSuper(ReactPlayer);
|
|
1079
|
+
|
|
1080
|
+
function ReactPlayer() {
|
|
1081
|
+
var _this;
|
|
1082
|
+
|
|
1083
|
+
_classCallCheck(this, ReactPlayer);
|
|
1084
|
+
|
|
1085
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1086
|
+
args[_key] = arguments[_key];
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1090
|
+
|
|
1091
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
1092
|
+
showPreview: !!_this.props.light
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
_defineProperty(_assertThisInitialized(_this), "references", {
|
|
1096
|
+
wrapper: function wrapper(_wrapper) {
|
|
1097
|
+
_this.wrapper = _wrapper;
|
|
1098
|
+
},
|
|
1099
|
+
player: function player(_player) {
|
|
1100
|
+
_this.player = _player;
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
_defineProperty(_assertThisInitialized(_this), "handleClickPreview", function (e) {
|
|
1105
|
+
_this.setState({
|
|
1106
|
+
showPreview: false
|
|
1107
|
+
});
|
|
1108
|
+
|
|
1109
|
+
_this.props.onClickPreview(e);
|
|
1110
|
+
});
|
|
1111
|
+
|
|
1112
|
+
_defineProperty(_assertThisInitialized(_this), "showPreview", function () {
|
|
1113
|
+
_this.setState({
|
|
1114
|
+
showPreview: true
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
_defineProperty(_assertThisInitialized(_this), "getDuration", function () {
|
|
1119
|
+
if (!_this.player) return null;
|
|
1120
|
+
return _this.player.getDuration();
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
_defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
|
|
1124
|
+
if (!_this.player) return null;
|
|
1125
|
+
return _this.player.getCurrentTime();
|
|
1126
|
+
});
|
|
1127
|
+
|
|
1128
|
+
_defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
|
|
1129
|
+
if (!_this.player) return null;
|
|
1130
|
+
return _this.player.getSecondsLoaded();
|
|
1131
|
+
});
|
|
1132
|
+
|
|
1133
|
+
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
|
|
1134
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
|
|
1135
|
+
if (!_this.player) return null;
|
|
1136
|
+
return _this.player.getInternalPlayer(key);
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
_defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
|
|
1140
|
+
if (!_this.player) return null;
|
|
1141
|
+
|
|
1142
|
+
_this.player.seekTo(fraction, type);
|
|
1143
|
+
});
|
|
1144
|
+
|
|
1145
|
+
_defineProperty(_assertThisInitialized(_this), "handleReady", function () {
|
|
1146
|
+
_this.props.onReady(_assertThisInitialized(_this));
|
|
1147
|
+
});
|
|
1148
|
+
|
|
1149
|
+
_defineProperty(_assertThisInitialized(_this), "getActivePlayer", (0, _memoizeOne["default"])(function (url) {
|
|
1150
|
+
for (var _i = 0, _arr = [].concat(customPlayers, _toConsumableArray(players)); _i < _arr.length; _i++) {
|
|
1151
|
+
var player = _arr[_i];
|
|
1152
|
+
|
|
1153
|
+
if (player.canPlay(url)) {
|
|
1154
|
+
return player;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
if (fallback) {
|
|
1159
|
+
return fallback;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
return null;
|
|
1163
|
+
}));
|
|
1164
|
+
|
|
1165
|
+
_defineProperty(_assertThisInitialized(_this), "getConfig", (0, _memoizeOne["default"])(function (url, key) {
|
|
1166
|
+
var config = _this.props.config;
|
|
1167
|
+
return _deepmerge["default"].all([_props.defaultProps.config, _props.defaultProps.config[key] || {}, config, config[key] || {}]);
|
|
1168
|
+
}));
|
|
1169
|
+
|
|
1170
|
+
_defineProperty(_assertThisInitialized(_this), "getAttributes", (0, _memoizeOne["default"])(function (url) {
|
|
1171
|
+
return (0, _utils.omit)(_this.props, SUPPORTED_PROPS);
|
|
1172
|
+
}));
|
|
1173
|
+
|
|
1174
|
+
_defineProperty(_assertThisInitialized(_this), "renderActivePlayer", function (url) {
|
|
1175
|
+
if (!url) return null;
|
|
1176
|
+
|
|
1177
|
+
var player = _this.getActivePlayer(url);
|
|
1178
|
+
|
|
1179
|
+
if (!player) return null;
|
|
1180
|
+
|
|
1181
|
+
var config = _this.getConfig(url, player.key);
|
|
1182
|
+
|
|
1183
|
+
return /*#__PURE__*/_react["default"].createElement(_Player3["default"], _extends({}, _this.props, {
|
|
1184
|
+
key: player.key,
|
|
1185
|
+
ref: _this.references.player,
|
|
1186
|
+
config: config,
|
|
1187
|
+
activePlayer: player.lazyPlayer || player,
|
|
1188
|
+
onReady: _this.handleReady
|
|
1189
|
+
}));
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1192
|
+
return _this;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
_createClass(ReactPlayer, [{
|
|
1196
|
+
key: "shouldComponentUpdate",
|
|
1197
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
1198
|
+
return !(0, _reactFastCompare["default"])(this.props, nextProps) || !(0, _reactFastCompare["default"])(this.state, nextState);
|
|
1199
|
+
}
|
|
1200
|
+
}, {
|
|
1201
|
+
key: "componentDidUpdate",
|
|
1202
|
+
value: function componentDidUpdate(prevProps) {
|
|
1203
|
+
var light = this.props.light;
|
|
1204
|
+
|
|
1205
|
+
if (!prevProps.light && light) {
|
|
1206
|
+
this.setState({
|
|
1207
|
+
showPreview: true
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
if (prevProps.light && !light) {
|
|
1212
|
+
this.setState({
|
|
1213
|
+
showPreview: false
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
}, {
|
|
1218
|
+
key: "renderPreview",
|
|
1219
|
+
value: function renderPreview(url) {
|
|
1220
|
+
if (!url) return null;
|
|
1221
|
+
var _this$props = this.props,
|
|
1222
|
+
light = _this$props.light,
|
|
1223
|
+
playIcon = _this$props.playIcon,
|
|
1224
|
+
previewTabIndex = _this$props.previewTabIndex,
|
|
1225
|
+
oEmbedUrl = _this$props.oEmbedUrl;
|
|
1226
|
+
return /*#__PURE__*/_react["default"].createElement(Preview, {
|
|
1227
|
+
url: url,
|
|
1228
|
+
light: light,
|
|
1229
|
+
playIcon: playIcon,
|
|
1230
|
+
previewTabIndex: previewTabIndex,
|
|
1231
|
+
oEmbedUrl: oEmbedUrl,
|
|
1232
|
+
onClick: this.handleClickPreview
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
}, {
|
|
1236
|
+
key: "render",
|
|
1237
|
+
value: function render() {
|
|
1238
|
+
var _this$props2 = this.props,
|
|
1239
|
+
url = _this$props2.url,
|
|
1240
|
+
style = _this$props2.style,
|
|
1241
|
+
width = _this$props2.width,
|
|
1242
|
+
height = _this$props2.height,
|
|
1243
|
+
fallback = _this$props2.fallback,
|
|
1244
|
+
Wrapper = _this$props2.wrapper;
|
|
1245
|
+
var showPreview = this.state.showPreview;
|
|
1246
|
+
var attributes = this.getAttributes(url);
|
|
1247
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
1248
|
+
ref: this.references.wrapper,
|
|
1249
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
1250
|
+
width: width,
|
|
1251
|
+
height: height
|
|
1252
|
+
})
|
|
1253
|
+
}, attributes), /*#__PURE__*/_react["default"].createElement(UniversalSuspense, {
|
|
1254
|
+
fallback: fallback
|
|
1255
|
+
}, showPreview ? this.renderPreview(url) : this.renderActivePlayer(url)));
|
|
1256
|
+
}
|
|
1257
|
+
}]);
|
|
1258
|
+
|
|
1259
|
+
return ReactPlayer;
|
|
1260
|
+
}(_react.Component), _defineProperty(_class, "displayName", 'ReactPlayer'), _defineProperty(_class, "propTypes", _props.propTypes), _defineProperty(_class, "defaultProps", _props.defaultProps), _defineProperty(_class, "addCustomPlayer", function (player) {
|
|
1261
|
+
customPlayers.push(player);
|
|
1262
|
+
}), _defineProperty(_class, "removeCustomPlayers", function () {
|
|
1263
|
+
customPlayers.length = 0;
|
|
1264
|
+
}), _defineProperty(_class, "canPlay", function (url) {
|
|
1265
|
+
for (var _i2 = 0, _arr2 = [].concat(customPlayers, _toConsumableArray(players)); _i2 < _arr2.length; _i2++) {
|
|
1266
|
+
var _Player = _arr2[_i2];
|
|
1267
|
+
|
|
1268
|
+
if (_Player.canPlay(url)) {
|
|
1269
|
+
return true;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
return false;
|
|
1274
|
+
}), _defineProperty(_class, "canEnablePIP", function (url) {
|
|
1275
|
+
for (var _i3 = 0, _arr3 = [].concat(customPlayers, _toConsumableArray(players)); _i3 < _arr3.length; _i3++) {
|
|
1276
|
+
var _Player2 = _arr3[_i3];
|
|
1277
|
+
|
|
1278
|
+
if (_Player2.canEnablePIP && _Player2.canEnablePIP(url)) {
|
|
1279
|
+
return true;
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
return false;
|
|
1284
|
+
}), _temp;
|
|
1285
|
+
};
|
|
1286
|
+
|
|
1287
|
+
ReactPlayer$1.createReactPlayer = createReactPlayer;
|
|
1288
|
+
|
|
1289
|
+
(function (exports) {
|
|
1290
|
+
|
|
1291
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1292
|
+
value: true
|
|
1293
|
+
});
|
|
1294
|
+
exports["default"] = void 0;
|
|
1295
|
+
|
|
1296
|
+
var _players = _interopRequireDefault(players);
|
|
1297
|
+
|
|
1298
|
+
var _ReactPlayer = ReactPlayer$1;
|
|
1299
|
+
|
|
1300
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1301
|
+
|
|
1302
|
+
// Fall back to FilePlayer if nothing else can play the URL
|
|
1303
|
+
var fallback = _players["default"][_players["default"].length - 1];
|
|
1304
|
+
|
|
1305
|
+
var _default = (0, _ReactPlayer.createReactPlayer)(_players["default"], fallback);
|
|
1306
|
+
|
|
1307
|
+
exports["default"] = _default;
|
|
1308
|
+
} (lazy));
|
|
1309
|
+
|
|
1310
|
+
var RP = /*@__PURE__*/getDefaultExportFromCjs(lazy);
|
|
1311
|
+
|
|
1312
|
+
const ReactPlayer = RP;
|
|
1313
|
+
const VideoPlayer = ({ controls, src, poster, youtube, tracks, }) => {
|
|
1314
|
+
var _a;
|
|
1315
|
+
const { prefix } = useGlobalSettings();
|
|
1316
|
+
const baseClass = `${prefix}--video`;
|
|
1317
|
+
const playerClasses = classNames("", {
|
|
1318
|
+
[`${baseClass}--player`]: true,
|
|
1319
|
+
[`youtube`]: youtube,
|
|
1320
|
+
});
|
|
1321
|
+
const controlsClasses = classNames("", {
|
|
1322
|
+
[`${baseClass}--controls`]: true,
|
|
1323
|
+
});
|
|
1324
|
+
/**
|
|
1325
|
+
* State hooks for our player controls
|
|
1326
|
+
*/
|
|
1327
|
+
const [duration, setDuration] = useState("0:00");
|
|
1328
|
+
const [playedtime, setPlayedtime] = useState("0:00");
|
|
1329
|
+
const [buffer, setBuffer] = useState(0);
|
|
1330
|
+
const [playing, setPlaying] = useState(false);
|
|
1331
|
+
const [playhead, setPlayhead] = useState(0);
|
|
1332
|
+
const [volume, setVolume] = useState(0.8);
|
|
1333
|
+
const [muted, setMute] = useState(false);
|
|
1334
|
+
const [showposter, showPoster] = useState(true);
|
|
1335
|
+
const [showvolume, showVolume] = useState(false);
|
|
1336
|
+
const [seeking, setSeeking] = useState(false);
|
|
1337
|
+
/**
|
|
1338
|
+
* Ref for the video element
|
|
1339
|
+
*/
|
|
1340
|
+
const videoElement = createRef();
|
|
1341
|
+
/**
|
|
1342
|
+
* Ref for the video container
|
|
1343
|
+
*/
|
|
1344
|
+
const videoContainer = createRef();
|
|
1345
|
+
const youtubeparams = {
|
|
1346
|
+
controls: 0,
|
|
1347
|
+
modestbranding: 1,
|
|
1348
|
+
};
|
|
1349
|
+
const playerconfig = {
|
|
1350
|
+
file: {
|
|
1351
|
+
tracks: tracks || [],
|
|
1352
|
+
},
|
|
1353
|
+
youtube: youtube ? { playerVars: youtubeparams } : {},
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* Fullscreen functionality
|
|
1357
|
+
*/
|
|
1358
|
+
const toggleFullscreen = () => {
|
|
1359
|
+
/* This is a known issue with ReactPlayer */
|
|
1360
|
+
/* @ts-ignore */
|
|
1361
|
+
screenfull.request(findDOMNode(videoContainer.current));
|
|
1362
|
+
};
|
|
1363
|
+
/**
|
|
1364
|
+
* Play/pause functionality
|
|
1365
|
+
*/
|
|
1366
|
+
const togglePlay = () => {
|
|
1367
|
+
setPlaying(!playing);
|
|
1368
|
+
showPoster(false);
|
|
1369
|
+
};
|
|
1370
|
+
/**
|
|
1371
|
+
* Show volume slider
|
|
1372
|
+
*/
|
|
1373
|
+
const showVolumeSlider = () => {
|
|
1374
|
+
showVolume(true);
|
|
1375
|
+
};
|
|
1376
|
+
/**
|
|
1377
|
+
* Hide volume slider
|
|
1378
|
+
*/
|
|
1379
|
+
const hideVolumeSlider = () => {
|
|
1380
|
+
setTimeout(() => {
|
|
1381
|
+
showVolume(false);
|
|
1382
|
+
}, 2000);
|
|
1383
|
+
};
|
|
1384
|
+
/**
|
|
1385
|
+
* Mute/unmute
|
|
1386
|
+
*/
|
|
1387
|
+
const toggleMute = () => {
|
|
1388
|
+
setMute(!muted);
|
|
1389
|
+
hideVolumeSlider();
|
|
1390
|
+
};
|
|
1391
|
+
/**
|
|
1392
|
+
* Volume change
|
|
1393
|
+
*/
|
|
1394
|
+
const handleVolumeChange = (event) => {
|
|
1395
|
+
console.log("handleVolumeChange", event.target.value);
|
|
1396
|
+
setVolume(event.target.value * 0.1);
|
|
1397
|
+
};
|
|
1398
|
+
/**
|
|
1399
|
+
* Begin seek
|
|
1400
|
+
*/
|
|
1401
|
+
const handleSeekMouseDown = () => {
|
|
1402
|
+
setSeeking(true);
|
|
1403
|
+
};
|
|
1404
|
+
/**
|
|
1405
|
+
* Seek
|
|
1406
|
+
*/
|
|
1407
|
+
const handleSeekChange = (event) => {
|
|
1408
|
+
setPlayhead(parseFloat(event.target.value));
|
|
1409
|
+
};
|
|
1410
|
+
/**
|
|
1411
|
+
* End seek
|
|
1412
|
+
*/
|
|
1413
|
+
const handleSeekMouseUp = (event) => {
|
|
1414
|
+
setSeeking(false);
|
|
1415
|
+
/* This is a known issue with ReactPlayer */
|
|
1416
|
+
/* @ts-ignore */
|
|
1417
|
+
videoElement.current.seekTo(parseFloat(event.target.value));
|
|
1418
|
+
};
|
|
1419
|
+
/**
|
|
1420
|
+
* handle display of progress
|
|
1421
|
+
*/
|
|
1422
|
+
const handleProgress = (state) => {
|
|
1423
|
+
if (!seeking) {
|
|
1424
|
+
setPlayhead(state.played);
|
|
1425
|
+
setBuffer(state.loaded);
|
|
1426
|
+
setPlayedtime(hoursMinutesSeconds(state.playedSeconds));
|
|
1427
|
+
}
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* get the duration to display
|
|
1431
|
+
*/
|
|
1432
|
+
const handleDuration = (duration) => {
|
|
1433
|
+
setDuration(hoursMinutesSeconds(duration));
|
|
1434
|
+
};
|
|
1435
|
+
/**
|
|
1436
|
+
* on video end
|
|
1437
|
+
*/
|
|
1438
|
+
const handleEnded = () => {
|
|
1439
|
+
setPlaying(false);
|
|
1440
|
+
setSeeking(false);
|
|
1441
|
+
};
|
|
1442
|
+
return (jsxs("div", Object.assign({ className: `${baseClass}--container`, ref: videoContainer }, { children: [jsx(ReactPlayer, { className: playerClasses, config: playerconfig, loop: false, muted: muted, playing: playing, ref: videoElement, url: src, width: "100%", height: "100%", progressInterval: 30, volume: volume, onProgress: handleProgress, onDuration: handleDuration, onEnded: handleEnded }), jsxs("picture", Object.assign({ className: `${baseClass}--poster ${showposter ? "show" : ""}` }, { children: [(poster === null || poster === void 0 ? void 0 : poster.url) &&
|
|
1443
|
+
poster.url
|
|
1444
|
+
.sort((a, b) => parseFloat(a.breakpoint) - parseFloat(b.breakpoint))
|
|
1445
|
+
.slice(1)
|
|
1446
|
+
.reverse()
|
|
1447
|
+
.map((item, index) => (jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay }, { children: jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsx("span", { children: controls && controls.volume }) })), jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
export { VideoPlayer as default };
|