@streamscloud/embeddable 1.1.2
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/README.md +1 -0
- package/dist/advertising/ad-view/cmp.ad-view.svelte +82 -0
- package/dist/advertising/ad-view/cmp.ad-view.svelte.d.ts +8 -0
- package/dist/advertising/ad-view/index.d.ts +2 -0
- package/dist/advertising/ad-view/index.js +1 -0
- package/dist/advertising/ad-view/mapper.d.ts +3 -0
- package/dist/advertising/ad-view/mapper.js +16 -0
- package/dist/advertising/ad-view/operations.generated.d.ts +17 -0
- package/dist/advertising/ad-view/operations.generated.js +46 -0
- package/dist/advertising/ad-view/operations.graphql +14 -0
- package/dist/advertising/ad-view/types.d.ts +10 -0
- package/dist/advertising/ad-view/types.js +1 -0
- package/dist/advertising/index.d.ts +1 -0
- package/dist/advertising/index.js +1 -0
- package/dist/advertising/types.d.ts +5 -0
- package/dist/advertising/types.js +6 -0
- package/dist/core/continuation-token.d.ts +10 -0
- package/dist/core/continuation-token.js +32 -0
- package/dist/core/cursor-result.d.ts +9 -0
- package/dist/core/cursor-result.js +1 -0
- package/dist/core/data-loaders/cursor-data-loader.svelte.d.ts +14 -0
- package/dist/core/data-loaders/cursor-data-loader.svelte.js +35 -0
- package/dist/core/data-loaders/data-loader.d.ts +4 -0
- package/dist/core/data-loaders/data-loader.js +1 -0
- package/dist/core/data-loaders/index.d.ts +2 -0
- package/dist/core/data-loaders/index.js +1 -0
- package/dist/core/deferred.d.ts +6 -0
- package/dist/core/deferred.js +13 -0
- package/dist/core/graphql.d.ts +1 -0
- package/dist/core/graphql.js +10 -0
- package/dist/core/media/image-helper.d.ts +10 -0
- package/dist/core/media/image-helper.js +30 -0
- package/dist/core/media/images-size-detector.service.d.ts +6 -0
- package/dist/core/media/images-size-detector.service.js +15 -0
- package/dist/core/media/index.d.ts +4 -0
- package/dist/core/media/index.js +4 -0
- package/dist/core/media/media-item-url.service.d.ts +2 -0
- package/dist/core/media/media-item-url.service.js +2 -0
- package/dist/core/media/types.d.ts +28 -0
- package/dist/core/media/types.js +19 -0
- package/dist/core/toastr.d.ts +1 -0
- package/dist/core/toastr.js +26 -0
- package/dist/core/transitions/index.d.ts +1 -0
- package/dist/core/transitions/index.js +1 -0
- package/dist/core/transitions/slide-horizontally.d.ts +7 -0
- package/dist/core/transitions/slide-horizontally.js +55 -0
- package/dist/core/utils/array-helper.d.ts +23 -0
- package/dist/core/utils/array-helper.js +148 -0
- package/dist/core/utils/date-helper.d.ts +29 -0
- package/dist/core/utils/date-helper.js +146 -0
- package/dist/core/utils/dom-helper.d.ts +12 -0
- package/dist/core/utils/dom-helper.js +76 -0
- package/dist/core/utils/html-helper.d.ts +40 -0
- package/dist/core/utils/html-helper.js +97 -0
- package/dist/core/utils/index.d.ts +3 -0
- package/dist/core/utils/index.js +3 -0
- package/dist/core/utils/number-helper.d.ts +6 -0
- package/dist/core/utils/number-helper.js +28 -0
- package/dist/core/utils/string-generator.d.ts +2 -0
- package/dist/core/utils/string-generator.js +15 -0
- package/dist/core/utils/string-helper.d.ts +10 -0
- package/dist/core/utils/string-helper.js +53 -0
- package/dist/core/utils/url-helper.d.ts +3 -0
- package/dist/core/utils/url-helper.js +13 -0
- package/dist/core/utils/utils.d.ts +28 -0
- package/dist/core/utils/utils.js +100 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/products/index.d.ts +1 -0
- package/dist/products/index.js +1 -0
- package/dist/products/price-helper.d.ts +4 -0
- package/dist/products/price-helper.js +36 -0
- package/dist/products/product-card/cmp.product-card.svelte +121 -0
- package/dist/products/product-card/cmp.product-card.svelte.d.ts +10 -0
- package/dist/products/product-card/index.d.ts +3 -0
- package/dist/products/product-card/index.js +3 -0
- package/dist/products/product-card/mapper.d.ts +3 -0
- package/dist/products/product-card/mapper.js +14 -0
- package/dist/products/product-card/operations.generated.d.ts +22 -0
- package/dist/products/product-card/operations.generated.js +65 -0
- package/dist/products/product-card/operations.graphql +19 -0
- package/dist/products/product-card/product-card-localization.svelte.d.ts +7 -0
- package/dist/products/product-card/product-card-localization.svelte.js +11 -0
- package/dist/products/product-card/types.d.ts +10 -0
- package/dist/products/product-card/types.js +1 -0
- package/dist/products/types.d.ts +5 -0
- package/dist/products/types.js +6 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte +71 -0
- package/dist/short-videos/short-video-viewer/cmp.attachments.svelte.d.ts +7 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte +145 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-details.svelte.d.ts +10 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte +86 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-heading.svelte.d.ts +9 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte +133 -0
- package/dist/short-videos/short-video-viewer/cmp.short-video-viewer.svelte.d.ts +12 -0
- package/dist/short-videos/short-video-viewer/description.svelte +46 -0
- package/dist/short-videos/short-video-viewer/description.svelte.d.ts +9 -0
- package/dist/short-videos/short-video-viewer/index.d.ts +6 -0
- package/dist/short-videos/short-video-viewer/index.js +4 -0
- package/dist/short-videos/short-video-viewer/mapper.d.ts +3 -0
- package/dist/short-videos/short-video-viewer/mapper.js +28 -0
- package/dist/short-videos/short-video-viewer/operations.generated.d.ts +56 -0
- package/dist/short-videos/short-video-viewer/operations.generated.js +187 -0
- package/dist/short-videos/short-video-viewer/operations.graphql +26 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.d.ts +14 -0
- package/dist/short-videos/short-video-viewer/short-video-details-localization.svelte.js +21 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.d.ts +10 -0
- package/dist/short-videos/short-video-viewer/short-video-viewer-localization.svelte.js +13 -0
- package/dist/short-videos/short-video-viewer/types.d.ts +17 -0
- package/dist/short-videos/short-video-viewer/types.js +1 -0
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.d.ts +12 -0
- package/dist/short-videos/short-video-viewer/ui-manager.svelte.js +26 -0
- package/dist/short-videos/short-videos-player/action-button.svelte +38 -0
- package/dist/short-videos/short-videos-player/action-button.svelte.d.ts +10 -0
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +91 -0
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte.d.ts +13 -0
- package/dist/short-videos/short-videos-player/controls.svelte +215 -0
- package/dist/short-videos/short-videos-player/controls.svelte.d.ts +15 -0
- package/dist/short-videos/short-videos-player/index.d.ts +2 -0
- package/dist/short-videos/short-videos-player/index.js +1 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.d.ts +14 -0
- package/dist/short-videos/short-videos-player/short-videos-player-localization.svelte.js +21 -0
- package/dist/short-videos/short-videos-player/ui-manager.svelte.d.ts +16 -0
- package/dist/short-videos/short-videos-player/ui-manager.svelte.js +25 -0
- package/dist/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte +485 -0
- package/dist/short-videos/short-videos-player-modal/cmp.short-videos-player-modal.svelte.d.ts +3 -0
- package/dist/short-videos/short-videos-player-modal/index.d.ts +79 -0
- package/dist/short-videos/short-videos-player-modal/index.js +78 -0
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.d.ts +16 -0
- package/dist/short-videos/short-videos-player-modal/short-videos-player-modal-state.svelte.js +13 -0
- package/dist/streams/components/cmp.stream-page-component.svelte +16 -0
- package/dist/streams/components/cmp.stream-page-component.svelte.d.ts +10 -0
- package/dist/streams/components/components.factory.d.ts +22 -0
- package/dist/streams/components/components.factory.js +34 -0
- package/dist/streams/components/images/cmp.images-component.svelte +7 -0
- package/dist/streams/components/images/cmp.images-component.svelte.d.ts +7 -0
- package/dist/streams/components/images/index.d.ts +2 -0
- package/dist/streams/components/images/index.js +1 -0
- package/dist/streams/components/images/types.d.ts +8 -0
- package/dist/streams/components/images/types.js +5 -0
- package/dist/streams/components/index.d.ts +7 -0
- package/dist/streams/components/index.js +6 -0
- package/dist/streams/components/mapper.d.ts +3 -0
- package/dist/streams/components/mapper.js +43 -0
- package/dist/streams/components/operations.generated.d.ts +178 -0
- package/dist/streams/components/operations.generated.js +653 -0
- package/dist/streams/components/operations.graphql +35 -0
- package/dist/streams/components/product/cmp.product-component.svelte +148 -0
- package/dist/streams/components/product/cmp.product-component.svelte.d.ts +8 -0
- package/dist/streams/components/product/index.d.ts +3 -0
- package/dist/streams/components/product/index.js +2 -0
- package/dist/streams/components/product/mapper.d.ts +3 -0
- package/dist/streams/components/product/mapper.js +14 -0
- package/dist/streams/components/product/operations.generated.d.ts +22 -0
- package/dist/streams/components/product/operations.generated.js +53 -0
- package/dist/streams/components/product/operations.graphql +19 -0
- package/dist/streams/components/product/types.d.ts +10 -0
- package/dist/streams/components/product/types.js +1 -0
- package/dist/streams/components/short-video/cmp.short-video-component.svelte +9 -0
- package/dist/streams/components/short-video/cmp.short-video-component.svelte.d.ts +10 -0
- package/dist/streams/components/short-video/index.d.ts +3 -0
- package/dist/streams/components/short-video/index.js +2 -0
- package/dist/streams/components/short-video/mapper.d.ts +3 -0
- package/dist/streams/components/short-video/mapper.js +4 -0
- package/dist/streams/components/short-video/operations.generated.d.ts +56 -0
- package/dist/streams/components/short-video/operations.generated.js +193 -0
- package/dist/streams/components/short-video/operations.graphql +3 -0
- package/dist/streams/components/short-video/types.d.ts +2 -0
- package/dist/streams/components/short-video/types.js +1 -0
- package/dist/streams/components/stream-components-localization.svelte.d.ts +10 -0
- package/dist/streams/components/stream-components-localization.svelte.js +13 -0
- package/dist/streams/components/types.d.ts +27 -0
- package/dist/streams/components/types.js +6 -0
- package/dist/streams/slots/cmp.stream-component-slot.svelte +35 -0
- package/dist/streams/slots/cmp.stream-component-slot.svelte.d.ts +9 -0
- package/dist/streams/slots/index.d.ts +3 -0
- package/dist/streams/slots/index.js +2 -0
- package/dist/streams/slots/mapper.d.ts +3 -0
- package/dist/streams/slots/mapper.js +18 -0
- package/dist/streams/slots/operations.generated.d.ts +17 -0
- package/dist/streams/slots/operations.generated.js +34 -0
- package/dist/streams/slots/operations.graphql +14 -0
- package/dist/streams/slots/styles-transformer.d.ts +6 -0
- package/dist/streams/slots/styles-transformer.js +12 -0
- package/dist/streams/slots/types.d.ts +16 -0
- package/dist/streams/slots/types.js +1 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte +47 -0
- package/dist/streams/stream-page-viewer/cmp.stream-page-viewer.svelte.d.ts +9 -0
- package/dist/streams/stream-page-viewer/index.d.ts +2 -0
- package/dist/streams/stream-page-viewer/index.js +1 -0
- package/dist/streams/stream-page-viewer/mapper.d.ts +3 -0
- package/dist/streams/stream-page-viewer/mapper.js +23 -0
- package/dist/streams/stream-page-viewer/operations.generated.d.ts +113 -0
- package/dist/streams/stream-page-viewer/operations.generated.js +400 -0
- package/dist/streams/stream-page-viewer/operations.graphql +13 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.d.ts +10 -0
- package/dist/streams/stream-page-viewer/stream-page-viewer-localization.svelte.js +13 -0
- package/dist/streams/stream-page-viewer/types.d.ts +18 -0
- package/dist/streams/stream-page-viewer/types.js +1 -0
- package/dist/streams/stream-player/action-button.svelte +38 -0
- package/dist/streams/stream-player/action-button.svelte.d.ts +10 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +141 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +16 -0
- package/dist/streams/stream-player/controls.svelte +222 -0
- package/dist/streams/stream-player/controls.svelte.d.ts +14 -0
- package/dist/streams/stream-player/index.d.ts +2 -0
- package/dist/streams/stream-player/index.js +1 -0
- package/dist/streams/stream-player/mapper.d.ts +3 -0
- package/dist/streams/stream-player/mapper.js +15 -0
- package/dist/streams/stream-player/operations.generated.d.ts +161 -0
- package/dist/streams/stream-player/operations.generated.js +559 -0
- package/dist/streams/stream-player/operations.graphql +32 -0
- package/dist/streams/stream-player/stream-overview.svelte +239 -0
- package/dist/streams/stream-player/stream-overview.svelte.d.ts +17 -0
- package/dist/streams/stream-player/stream-player-buffer.svelte.d.ts +25 -0
- package/dist/streams/stream-player/stream-player-buffer.svelte.js +84 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.d.ts +18 -0
- package/dist/streams/stream-player/stream-player-localization.svelte.js +29 -0
- package/dist/streams/stream-player/types.d.ts +12 -0
- package/dist/streams/stream-player/types.js +1 -0
- package/dist/streams/stream-player/ui-manager.svelte.d.ts +17 -0
- package/dist/streams/stream-player/ui-manager.svelte.js +26 -0
- package/dist/streams/stream-player-modal/cmp.stream-player-modal.svelte +486 -0
- package/dist/streams/stream-player-modal/cmp.stream-player-modal.svelte.d.ts +3 -0
- package/dist/streams/stream-player-modal/index.d.ts +79 -0
- package/dist/streams/stream-player-modal/index.js +78 -0
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.d.ts +17 -0
- package/dist/streams/stream-player-modal/stream-player-modal-state.svelte.js +14 -0
- package/dist/ui/button/cmp.button.svelte +10 -0
- package/dist/ui/button/cmp.button.svelte.d.ts +16 -0
- package/dist/ui/button/index.d.ts +2 -0
- package/dist/ui/button/index.js +2 -0
- package/dist/ui/button/resources/button-base.svelte +84 -0
- package/dist/ui/button/resources/button-base.svelte.d.ts +13 -0
- package/dist/ui/button/resources/button-theme.svelte +204 -0
- package/dist/ui/button/resources/button-theme.svelte.d.ts +10 -0
- package/dist/ui/button/resources/button-types.d.ts +21 -0
- package/dist/ui/button/resources/button-types.js +23 -0
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte +5 -0
- package/dist/ui/dynamic-component/cmp.dynamic-component.svelte.d.ts +7 -0
- package/dist/ui/dynamic-component/index.d.ts +2 -0
- package/dist/ui/dynamic-component/index.js +2 -0
- package/dist/ui/dynamic-component/types.svelte.d.ts +11 -0
- package/dist/ui/dynamic-component/types.svelte.js +13 -0
- package/dist/ui/icon/cmp.icon.svelte +113 -0
- package/dist/ui/icon/cmp.icon.svelte.d.ts +8 -0
- package/dist/ui/icon/index.d.ts +2 -0
- package/dist/ui/icon/index.js +2 -0
- package/dist/ui/icon/types.d.ts +9 -0
- package/dist/ui/icon/types.js +10 -0
- package/dist/ui/image/cmp.image-round.svelte +41 -0
- package/dist/ui/image/cmp.image-round.svelte.d.ts +11 -0
- package/dist/ui/image/cmp.image-rounded.svelte +71 -0
- package/dist/ui/image/cmp.image-rounded.svelte.d.ts +11 -0
- package/dist/ui/image/cmp.image-stub.svelte +34 -0
- package/dist/ui/image/cmp.image-stub.svelte.d.ts +18 -0
- package/dist/ui/image/cmp.image.svelte +82 -0
- package/dist/ui/image/cmp.image.svelte.d.ts +13 -0
- package/dist/ui/image/image-state.d.ts +6 -0
- package/dist/ui/image/image-state.js +17 -0
- package/dist/ui/image/index.d.ts +4 -0
- package/dist/ui/image/index.js +4 -0
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte +84 -0
- package/dist/ui/infinite-scrolling/cmp.infinite-scrolling.svelte.d.ts +11 -0
- package/dist/ui/infinite-scrolling/index.d.ts +1 -0
- package/dist/ui/infinite-scrolling/index.js +1 -0
- package/dist/ui/line-clamp/cmp.line-clamp.svelte +89 -0
- package/dist/ui/line-clamp/cmp.line-clamp.svelte.d.ts +12 -0
- package/dist/ui/line-clamp/index.d.ts +2 -0
- package/dist/ui/line-clamp/index.js +2 -0
- package/dist/ui/line-clamp/line-clamp-localization.svelte.d.ts +9 -0
- package/dist/ui/line-clamp/line-clamp-localization.svelte.js +15 -0
- package/dist/ui/line-clamp/line-clamp-types.d.ts +3 -0
- package/dist/ui/line-clamp/line-clamp-types.js +1 -0
- package/dist/ui/line-clamp/line-clamp-utils.d.ts +8 -0
- package/dist/ui/line-clamp/line-clamp-utils.js +33 -0
- package/dist/ui/loading/cmp.loading.svelte +97 -0
- package/dist/ui/loading/cmp.loading.svelte.d.ts +9 -0
- package/dist/ui/loading/index.d.ts +1 -0
- package/dist/ui/loading/index.js +1 -0
- package/dist/ui/media-item-view/cmp.media-item-view.svelte +90 -0
- package/dist/ui/media-item-view/cmp.media-item-view.svelte.d.ts +12 -0
- package/dist/ui/media-item-view/index.d.ts +1 -0
- package/dist/ui/media-item-view/index.js +1 -0
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte +277 -0
- package/dist/ui/media-items-gallery/cmp.media-items-gallery.svelte.d.ts +12 -0
- package/dist/ui/media-items-gallery/index.d.ts +1 -0
- package/dist/ui/media-items-gallery/index.js +1 -0
- package/dist/ui/media-items-gallery/types.d.ts +12 -0
- package/dist/ui/media-items-gallery/types.js +35 -0
- package/dist/ui/media-playback/index.d.ts +2 -0
- package/dist/ui/media-playback/index.js +2 -0
- package/dist/ui/media-playback/playback-manager.svelte.d.ts +25 -0
- package/dist/ui/media-playback/playback-manager.svelte.js +62 -0
- package/dist/ui/media-playback/volume-manager.svelte.d.ts +10 -0
- package/dist/ui/media-playback/volume-manager.svelte.js +27 -0
- package/dist/ui/player/cmp.player-slider.svelte +161 -0
- package/dist/ui/player/cmp.player-slider.svelte.d.ts +33 -0
- package/dist/ui/player/index.d.ts +4 -0
- package/dist/ui/player/index.js +3 -0
- package/dist/ui/player/player-buffer.svelte.d.ts +28 -0
- package/dist/ui/player/player-buffer.svelte.js +64 -0
- package/dist/ui/player/prevent-slider-scroll.d.ts +5 -0
- package/dist/ui/player/prevent-slider-scroll.js +11 -0
- package/dist/ui/player/types.d.ts +14 -0
- package/dist/ui/player/types.js +1 -0
- package/dist/ui/progress/cmp.progress.svelte +37 -0
- package/dist/ui/progress/cmp.progress.svelte.d.ts +6 -0
- package/dist/ui/progress/index.d.ts +1 -0
- package/dist/ui/progress/index.js +1 -0
- package/dist/ui/proportional-container/cmp.proportional-container.svelte +39 -0
- package/dist/ui/proportional-container/cmp.proportional-container.svelte.d.ts +8 -0
- package/dist/ui/proportional-container/index.d.ts +1 -0
- package/dist/ui/proportional-container/index.js +1 -0
- package/dist/ui/seek-bar/cmp.seek-bar.svelte +63 -0
- package/dist/ui/seek-bar/cmp.seek-bar.svelte.d.ts +12 -0
- package/dist/ui/seek-bar/index.d.ts +1 -0
- package/dist/ui/seek-bar/index.js +1 -0
- package/dist/ui/shadow-dom/cmp.shadow-dom.svelte +26 -0
- package/dist/ui/shadow-dom/cmp.shadow-dom.svelte.d.ts +7 -0
- package/dist/ui/shadow-dom/index.d.ts +1 -0
- package/dist/ui/shadow-dom/index.js +1 -0
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte +120 -0
- package/dist/ui/spotlight-layout/cmp.spotlight-layout.svelte.d.ts +18 -0
- package/dist/ui/spotlight-layout/index.d.ts +1 -0
- package/dist/ui/spotlight-layout/index.js +1 -0
- package/dist/ui/time-ago/cmp.time-ago.svelte +69 -0
- package/dist/ui/time-ago/cmp.time-ago.svelte.d.ts +9 -0
- package/dist/ui/time-ago/index.d.ts +2 -0
- package/dist/ui/time-ago/index.js +1 -0
- package/dist/ui/time-ago/time-ago-localization.svelte.d.ts +21 -0
- package/dist/ui/time-ago/time-ago-localization.svelte.js +39 -0
- package/dist/ui/video/cmp.video.svelte +377 -0
- package/dist/ui/video/cmp.video.svelte.d.ts +24 -0
- package/dist/ui/video/index.d.ts +1 -0
- package/dist/ui/video/index.js +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
<svelte:options customElement="stream-player" />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">import { StreamPlayer } from '../stream-player';
|
|
4
|
+
import { StreamPlayerModalState } from './stream-player-modal-state.svelte';
|
|
5
|
+
$effect(() => {
|
|
6
|
+
document.getElementsByTagName('html')[0].style.overflow = StreamPlayerModalState.playerData ? 'hidden' : '';
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
{#if StreamPlayerModalState.playerData}
|
|
11
|
+
<div class="stream-player-modal">
|
|
12
|
+
<StreamPlayer
|
|
13
|
+
streamId={StreamPlayerModalState.playerData.streamId}
|
|
14
|
+
graphql={StreamPlayerModalState.playerData.graphql}
|
|
15
|
+
localization={StreamPlayerModalState.playerData.localization}
|
|
16
|
+
on={{ closePlayer: StreamPlayerModalState.close }} />
|
|
17
|
+
</div>
|
|
18
|
+
{/if}
|
|
19
|
+
|
|
20
|
+
<style>@keyframes fadeIn {
|
|
21
|
+
0% {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
50% {
|
|
25
|
+
opacity: 0.4;
|
|
26
|
+
}
|
|
27
|
+
100% {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/* Reset browser styles */
|
|
32
|
+
/*Default margins and paddings are removed*/
|
|
33
|
+
:global(a),
|
|
34
|
+
:global(article),
|
|
35
|
+
:global(aside),
|
|
36
|
+
:global(blockquote),
|
|
37
|
+
:global(body),
|
|
38
|
+
:global(dd),
|
|
39
|
+
:global(div),
|
|
40
|
+
:global(dl),
|
|
41
|
+
:global(dt),
|
|
42
|
+
:global(figcaption),
|
|
43
|
+
:global(figure),
|
|
44
|
+
:global(footer),
|
|
45
|
+
:global(form),
|
|
46
|
+
:global(h1),
|
|
47
|
+
:global(h2),
|
|
48
|
+
:global(h3),
|
|
49
|
+
:global(h4),
|
|
50
|
+
:global(h5),
|
|
51
|
+
:global(h6),
|
|
52
|
+
:global(header),
|
|
53
|
+
:global(html),
|
|
54
|
+
:global(img),
|
|
55
|
+
:global(li),
|
|
56
|
+
:global(nav),
|
|
57
|
+
:global(ol),
|
|
58
|
+
:global(p),
|
|
59
|
+
:global(section),
|
|
60
|
+
:global(table),
|
|
61
|
+
:global(td),
|
|
62
|
+
:global(ul) {
|
|
63
|
+
margin: 0;
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:global(header),
|
|
68
|
+
:global(section),
|
|
69
|
+
:global(footer),
|
|
70
|
+
:global(aside),
|
|
71
|
+
:global(nav),
|
|
72
|
+
:global(article),
|
|
73
|
+
:global(figure),
|
|
74
|
+
:global(figcaption) {
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*Images are block-level*/
|
|
79
|
+
:global(img),
|
|
80
|
+
:global(svg),
|
|
81
|
+
:global(video),
|
|
82
|
+
:global(canvas),
|
|
83
|
+
:global(audio),
|
|
84
|
+
:global(iframe),
|
|
85
|
+
:global(embed),
|
|
86
|
+
:global(object) {
|
|
87
|
+
display: block;
|
|
88
|
+
vertical-align: middle;
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:global(table) {
|
|
93
|
+
border-collapse: collapse;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:global(img) {
|
|
97
|
+
border: none;
|
|
98
|
+
height: auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:global(video) {
|
|
102
|
+
outline: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/*Lists are unstyled*/
|
|
106
|
+
:global(ul),
|
|
107
|
+
:global(ol) {
|
|
108
|
+
list-style: none;
|
|
109
|
+
margin: 0;
|
|
110
|
+
padding: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:global(li) {
|
|
114
|
+
list-style: inherit;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:global(input) {
|
|
118
|
+
vertical-align: middle;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
/* Chrome, Safari, Edge, Opera */
|
|
121
|
+
}
|
|
122
|
+
:global(input)::placeholder {
|
|
123
|
+
color: var(--input--placeholder--color, #c1c1c1) !important;
|
|
124
|
+
}
|
|
125
|
+
:global(input):-webkit-autofill, :global(input):-webkit-autofill:hover, :global(input):-webkit-autofill:focus {
|
|
126
|
+
-webkit-background-clip: text;
|
|
127
|
+
}
|
|
128
|
+
:global(input)::-webkit-outer-spin-button, :global(input)::-webkit-inner-spin-button {
|
|
129
|
+
-webkit-appearance: none;
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:global(textarea) {
|
|
134
|
+
vertical-align: top;
|
|
135
|
+
resize: vertical;
|
|
136
|
+
scrollbar-color: var(--custom-scrollbar-color, #b0b0b0) var(--custom-scrollbar-background, #f1f1f1);
|
|
137
|
+
scrollbar-width: thin;
|
|
138
|
+
}
|
|
139
|
+
:global(textarea)::-webkit-scrollbar {
|
|
140
|
+
width: 3px;
|
|
141
|
+
height: 3px;
|
|
142
|
+
background: var(--custom-scrollbar-background, transparent);
|
|
143
|
+
visibility: hidden;
|
|
144
|
+
}
|
|
145
|
+
:global(textarea)::-webkit-scrollbar-thumb {
|
|
146
|
+
background: var(--custom-scrollbar-color, #b0b0b0);
|
|
147
|
+
}
|
|
148
|
+
:global(textarea)::placeholder {
|
|
149
|
+
color: var(--input--placeholder--color, #c1c1c1) !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:global(input:focus),
|
|
153
|
+
:global(textarea:focus) {
|
|
154
|
+
outline: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:global(button),
|
|
158
|
+
:global(input[type="submit"]) {
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
-webkit-appearance: none;
|
|
161
|
+
background-color: transparent;
|
|
162
|
+
padding: 0;
|
|
163
|
+
text-align: left;
|
|
164
|
+
font: inherit;
|
|
165
|
+
color: inherit;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
}
|
|
168
|
+
:global(button):disabled,
|
|
169
|
+
:global(input[type="submit"]):disabled {
|
|
170
|
+
cursor: default;
|
|
171
|
+
}
|
|
172
|
+
:global(button):focus, :global(button):focus-visible,
|
|
173
|
+
:global(input[type="submit"]):focus,
|
|
174
|
+
:global(input[type="submit"]):focus-visible {
|
|
175
|
+
outline: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:global(a) {
|
|
179
|
+
color: inherit;
|
|
180
|
+
text-decoration: none;
|
|
181
|
+
transition: color linear 0.2s;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:global(*),
|
|
185
|
+
:global(*:before),
|
|
186
|
+
:global(*:after) {
|
|
187
|
+
box-sizing: inherit;
|
|
188
|
+
border-width: 0;
|
|
189
|
+
border-style: solid;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Normalize styles */
|
|
193
|
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
|
194
|
+
/* Document
|
|
195
|
+
========================================================================== */
|
|
196
|
+
/**
|
|
197
|
+
* Render the `main` element consistently in IE.
|
|
198
|
+
*/
|
|
199
|
+
:global(main) {
|
|
200
|
+
display: block;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Correct the font size and margin on `h1` elements within `section` and
|
|
205
|
+
* `article` contexts in Chrome, Firefox, and Safari.
|
|
206
|
+
*/
|
|
207
|
+
:global(h1) {
|
|
208
|
+
font-size: 2em;
|
|
209
|
+
margin: 0.67em 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Grouping content
|
|
213
|
+
========================================================================== */
|
|
214
|
+
/**
|
|
215
|
+
* 1. Add the correct box sizing in Firefox.
|
|
216
|
+
* 2. Show the overflow in Edge and IE.
|
|
217
|
+
*/
|
|
218
|
+
:global(hr) {
|
|
219
|
+
box-sizing: content-box; /* 1 */
|
|
220
|
+
height: 0; /* 1 */
|
|
221
|
+
overflow: visible; /* 2 */
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
226
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
227
|
+
*/
|
|
228
|
+
:global(pre) {
|
|
229
|
+
font-family: monospace, monospace; /* 1 */
|
|
230
|
+
font-size: 1em; /* 2 */
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* Text-level semantics
|
|
234
|
+
========================================================================== */
|
|
235
|
+
/**
|
|
236
|
+
* Remove the gray background on active links in IE 10.
|
|
237
|
+
*/
|
|
238
|
+
:global(a) {
|
|
239
|
+
background-color: transparent;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* 1. Remove the bottom border in Chrome 57-
|
|
244
|
+
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
245
|
+
*/
|
|
246
|
+
:global(abbr[title]) {
|
|
247
|
+
border-bottom: none; /* 1 */
|
|
248
|
+
text-decoration: underline; /* 2 */
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
253
|
+
*/
|
|
254
|
+
:global(b),
|
|
255
|
+
:global(strong) {
|
|
256
|
+
font-weight: bolder;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
261
|
+
* 2. Correct the odd `em` font sizing in all browsers.
|
|
262
|
+
*/
|
|
263
|
+
:global(code),
|
|
264
|
+
:global(kbd),
|
|
265
|
+
:global(samp) {
|
|
266
|
+
font-family: monospace, monospace; /* 1 */
|
|
267
|
+
font-size: 1em; /* 2 */
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Add the correct font size in all browsers.
|
|
272
|
+
*/
|
|
273
|
+
:global(small) {
|
|
274
|
+
font-size: 80%;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
279
|
+
* all browsers.
|
|
280
|
+
*/
|
|
281
|
+
:global(sub),
|
|
282
|
+
:global(sup) {
|
|
283
|
+
font-size: 75%;
|
|
284
|
+
line-height: 0;
|
|
285
|
+
position: relative;
|
|
286
|
+
vertical-align: baseline;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
:global(sub) {
|
|
290
|
+
bottom: -0.25em;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:global(sup) {
|
|
294
|
+
top: -0.5em;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* Embedded content
|
|
298
|
+
========================================================================== */
|
|
299
|
+
/**
|
|
300
|
+
* Remove the border on images inside links in IE 10.
|
|
301
|
+
*/
|
|
302
|
+
:global(img) {
|
|
303
|
+
border-style: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Forms
|
|
307
|
+
========================================================================== */
|
|
308
|
+
/**
|
|
309
|
+
* 1. Change the font styles in all browsers.
|
|
310
|
+
* 2. Remove the margin in Firefox and Safari.
|
|
311
|
+
*/
|
|
312
|
+
:global(button),
|
|
313
|
+
:global(input),
|
|
314
|
+
:global(optgroup),
|
|
315
|
+
:global(select),
|
|
316
|
+
:global(textarea) {
|
|
317
|
+
font-family: inherit; /* 1 */
|
|
318
|
+
font-size: 100%; /* 1 */
|
|
319
|
+
line-height: 1.15; /* 1 */
|
|
320
|
+
margin: 0; /* 2 */
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Show the overflow in IE.
|
|
325
|
+
* 1. Show the overflow in Edge.
|
|
326
|
+
*/
|
|
327
|
+
:global(button),
|
|
328
|
+
:global(input) {
|
|
329
|
+
/* 1 */
|
|
330
|
+
overflow: visible;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
335
|
+
* 1. Remove the inheritance of text transform in Firefox.
|
|
336
|
+
*/
|
|
337
|
+
:global(button),
|
|
338
|
+
:global(select) {
|
|
339
|
+
/* 1 */
|
|
340
|
+
text-transform: none;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Correct the inability to style clickable types in iOS and Safari.
|
|
345
|
+
*/
|
|
346
|
+
:global(button),
|
|
347
|
+
:global([type="button"]),
|
|
348
|
+
:global([type="reset"]),
|
|
349
|
+
:global([type="submit"]) {
|
|
350
|
+
-webkit-appearance: button;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Remove the inner border and padding in Firefox.
|
|
355
|
+
*/
|
|
356
|
+
:global(button::-moz-focus-inner),
|
|
357
|
+
:global([type="button"]::-moz-focus-inner),
|
|
358
|
+
:global([type="reset"]::-moz-focus-inner),
|
|
359
|
+
:global([type="submit"]::-moz-focus-inner) {
|
|
360
|
+
border-style: none;
|
|
361
|
+
padding: 0;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Restore the focus styles unset by the previous rule.
|
|
366
|
+
*/
|
|
367
|
+
:global(button:-moz-focusring),
|
|
368
|
+
:global([type="button"]:-moz-focusring),
|
|
369
|
+
:global([type="reset"]:-moz-focusring),
|
|
370
|
+
:global([type="submit"]:-moz-focusring) {
|
|
371
|
+
outline: 1px dotted ButtonText;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Correct the padding in Firefox.
|
|
376
|
+
*/
|
|
377
|
+
:global(fieldset) {
|
|
378
|
+
padding: 0.35em 0.75em 0.625em;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* 1. Correct the text wrapping in Edge and IE.
|
|
383
|
+
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
384
|
+
* 3. Remove the padding so developers are not caught out when they zero out
|
|
385
|
+
* `fieldset` elements in all browsers.
|
|
386
|
+
*/
|
|
387
|
+
:global(legend) {
|
|
388
|
+
box-sizing: border-box; /* 1 */
|
|
389
|
+
color: inherit; /* 2 */
|
|
390
|
+
display: table; /* 1 */
|
|
391
|
+
max-width: 100%; /* 1 */
|
|
392
|
+
padding: 0; /* 3 */
|
|
393
|
+
white-space: normal; /* 1 */
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
398
|
+
*/
|
|
399
|
+
:global(progress) {
|
|
400
|
+
vertical-align: baseline;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Remove the default vertical scrollbar in IE 10+.
|
|
405
|
+
*/
|
|
406
|
+
:global(textarea) {
|
|
407
|
+
overflow: auto;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* 1. Add the correct box sizing in IE 10.
|
|
412
|
+
* 2. Remove the padding in IE 10.
|
|
413
|
+
*/
|
|
414
|
+
:global([type="checkbox"]),
|
|
415
|
+
:global([type="radio"]) {
|
|
416
|
+
box-sizing: border-box; /* 1 */
|
|
417
|
+
padding: 0; /* 2 */
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
422
|
+
*/
|
|
423
|
+
:global([type="number"]::-webkit-inner-spin-button),
|
|
424
|
+
:global([type="number"]::-webkit-outer-spin-button) {
|
|
425
|
+
height: auto;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* 1. Correct the odd appearance in Chrome and Safari.
|
|
430
|
+
* 2. Correct the outline style in Safari.
|
|
431
|
+
*/
|
|
432
|
+
:global([type="search"]) {
|
|
433
|
+
-webkit-appearance: textfield; /* 1 */
|
|
434
|
+
outline-offset: -2px; /* 2 */
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Remove the inner padding in Chrome and Safari on macOS.
|
|
439
|
+
*/
|
|
440
|
+
:global([type="search"]::-webkit-search-decoration) {
|
|
441
|
+
-webkit-appearance: none;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
446
|
+
* 2. Change font properties to `inherit` in Safari.
|
|
447
|
+
*/
|
|
448
|
+
:global(::-webkit-file-upload-button) {
|
|
449
|
+
-webkit-appearance: button; /* 1 */
|
|
450
|
+
font: inherit; /* 2 */
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* Misc
|
|
454
|
+
========================================================================== */
|
|
455
|
+
/**
|
|
456
|
+
* Add the correct display in IE 10+.
|
|
457
|
+
*/
|
|
458
|
+
:global(template) {
|
|
459
|
+
display: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Add the correct display in IE 10.
|
|
464
|
+
*/
|
|
465
|
+
:global([hidden]) {
|
|
466
|
+
display: none;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.stream-player-modal {
|
|
470
|
+
/**
|
|
471
|
+
* 1. Correct the line height in all browsers.
|
|
472
|
+
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
473
|
+
*/
|
|
474
|
+
line-height: 1.15; /* 1 */
|
|
475
|
+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
476
|
+
font-weight: 400;
|
|
477
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
|
478
|
+
margin: 0;
|
|
479
|
+
box-sizing: border-box;
|
|
480
|
+
text-align: initial;
|
|
481
|
+
position: fixed;
|
|
482
|
+
top: 0;
|
|
483
|
+
left: 0;
|
|
484
|
+
bottom: 0;
|
|
485
|
+
right: 0;
|
|
486
|
+
}</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { IStreamPlayerLocalization } from '../stream-player';
|
|
2
|
+
import type { Client } from '@urql/core';
|
|
3
|
+
/**
|
|
4
|
+
* @module StreamPlayer
|
|
5
|
+
* @description
|
|
6
|
+
* Provides the `StreamPlayerModal` component and utility functions for managing the stream player modal.
|
|
7
|
+
*
|
|
8
|
+
* ## Usage
|
|
9
|
+
*
|
|
10
|
+
* ```svelte
|
|
11
|
+
* <script lang="ts">
|
|
12
|
+
* import { StreamPlayerModal, openStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
13
|
+
* import { onMount } from 'svelte';
|
|
14
|
+
*
|
|
15
|
+
* onMount(() => {
|
|
16
|
+
* if (!customElements.get('stream-player')) {
|
|
17
|
+
* customElements.define('stream-player', StreamPlayerModal.element!);
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* const openPlayer = () => {
|
|
22
|
+
* openStreamPlayer({
|
|
23
|
+
* streamId,
|
|
24
|
+
* graphql
|
|
25
|
+
* });
|
|
26
|
+
* };
|
|
27
|
+
* </script>
|
|
28
|
+
*
|
|
29
|
+
* <stream-player></stream-player>
|
|
30
|
+
* <button onclick={openPlayer}>Open Player</button>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* StreamPlayerModal is a Svelte component compiled in `customElement` mode.
|
|
35
|
+
* It must be registered manually with `customElements.define` before usage.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { StreamPlayerModal } from '@streamscloud/embeddable/stream-player';
|
|
40
|
+
*
|
|
41
|
+
* if (!customElements.get('stream-player')) {
|
|
42
|
+
* customElements.define('stream-player', StreamPlayerModal.element!);
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export { default as StreamPlayerModal } from './cmp.stream-player-modal.svelte';
|
|
47
|
+
/**
|
|
48
|
+
* Opens the stream player modal with the provided stream details.
|
|
49
|
+
*
|
|
50
|
+
* @param {object} init - Configuration options.
|
|
51
|
+
* @param {string} init.streamId - The ID of the stream to open.
|
|
52
|
+
* @param {Client} init.graphql - The GraphQL client instance.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { openStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
57
|
+
*
|
|
58
|
+
* openStreamPlayer({
|
|
59
|
+
* streamId: '..',
|
|
60
|
+
* graphql: client
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const openStreamPlayer: (init: {
|
|
65
|
+
streamId: string;
|
|
66
|
+
graphql: Client;
|
|
67
|
+
localization?: IStreamPlayerLocalization;
|
|
68
|
+
}) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Closes the currently open stream player modal.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { closeStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
75
|
+
*
|
|
76
|
+
* closeStreamPlayer();
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare const closeStreamPlayer: () => void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { StreamPlayerModalState } from './stream-player-modal-state.svelte';
|
|
2
|
+
/**
|
|
3
|
+
* @module StreamPlayer
|
|
4
|
+
* @description
|
|
5
|
+
* Provides the `StreamPlayerModal` component and utility functions for managing the stream player modal.
|
|
6
|
+
*
|
|
7
|
+
* ## Usage
|
|
8
|
+
*
|
|
9
|
+
* ```svelte
|
|
10
|
+
* <script lang="ts">
|
|
11
|
+
* import { StreamPlayerModal, openStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
12
|
+
* import { onMount } from 'svelte';
|
|
13
|
+
*
|
|
14
|
+
* onMount(() => {
|
|
15
|
+
* if (!customElements.get('stream-player')) {
|
|
16
|
+
* customElements.define('stream-player', StreamPlayerModal.element!);
|
|
17
|
+
* }
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const openPlayer = () => {
|
|
21
|
+
* openStreamPlayer({
|
|
22
|
+
* streamId,
|
|
23
|
+
* graphql
|
|
24
|
+
* });
|
|
25
|
+
* };
|
|
26
|
+
* </script>
|
|
27
|
+
*
|
|
28
|
+
* <stream-player></stream-player>
|
|
29
|
+
* <button onclick={openPlayer}>Open Player</button>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* StreamPlayerModal is a Svelte component compiled in `customElement` mode.
|
|
34
|
+
* It must be registered manually with `customElements.define` before usage.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { StreamPlayerModal } from '@streamscloud/embeddable/stream-player';
|
|
39
|
+
*
|
|
40
|
+
* if (!customElements.get('stream-player')) {
|
|
41
|
+
* customElements.define('stream-player', StreamPlayerModal.element!);
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export { default as StreamPlayerModal } from './cmp.stream-player-modal.svelte';
|
|
46
|
+
/**
|
|
47
|
+
* Opens the stream player modal with the provided stream details.
|
|
48
|
+
*
|
|
49
|
+
* @param {object} init - Configuration options.
|
|
50
|
+
* @param {string} init.streamId - The ID of the stream to open.
|
|
51
|
+
* @param {Client} init.graphql - The GraphQL client instance.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { openStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
56
|
+
*
|
|
57
|
+
* openStreamPlayer({
|
|
58
|
+
* streamId: '..',
|
|
59
|
+
* graphql: client
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export const openStreamPlayer = (init) => {
|
|
64
|
+
StreamPlayerModalState.open(init);
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Closes the currently open stream player modal.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { closeStreamPlayer } from '@streamscloud/embeddable/stream-player';
|
|
72
|
+
*
|
|
73
|
+
* closeStreamPlayer();
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export const closeStreamPlayer = () => {
|
|
77
|
+
StreamPlayerModalState.close();
|
|
78
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IStreamPlayerLocalization } from '../stream-player';
|
|
2
|
+
import type { Client } from '@urql/core';
|
|
3
|
+
declare class StreamPlayerModalStateDefinition {
|
|
4
|
+
playerData: {
|
|
5
|
+
streamId: string;
|
|
6
|
+
graphql: Client;
|
|
7
|
+
localization?: IStreamPlayerLocalization;
|
|
8
|
+
} | null;
|
|
9
|
+
open: (init: {
|
|
10
|
+
streamId: string;
|
|
11
|
+
graphql: Client;
|
|
12
|
+
localization?: IStreamPlayerLocalization;
|
|
13
|
+
}) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const StreamPlayerModalState: StreamPlayerModalStateDefinition;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class StreamPlayerModalStateDefinition {
|
|
2
|
+
playerData = $state.raw(null);
|
|
3
|
+
open = (init) => {
|
|
4
|
+
this.playerData = {
|
|
5
|
+
streamId: init.streamId,
|
|
6
|
+
graphql: init.graphql,
|
|
7
|
+
localization: init.localization
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
close = () => {
|
|
11
|
+
this.playerData = null;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export const StreamPlayerModalState = new StreamPlayerModalStateDefinition();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">import ButtonBase from './resources/button-base.svelte';
|
|
2
|
+
import ButtonTheme from './resources/button-theme.svelte';
|
|
3
|
+
let { type = 'button', disabled = false, autofocus = false, style = null, size = null, on, children } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<ButtonTheme style={style} size={size}>
|
|
7
|
+
<ButtonBase disabled={disabled} type={type} autofocus={autofocus} on={on}>
|
|
8
|
+
{@render children()}
|
|
9
|
+
</ButtonBase>
|
|
10
|
+
</ButtonTheme>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ButtonStyle, ButtonSize } from './resources/button-types';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type Props = {
|
|
4
|
+
type?: 'button' | 'submit' | 'reset';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
autofocus?: boolean;
|
|
7
|
+
style?: ButtonStyle | null;
|
|
8
|
+
size?: ButtonSize | null;
|
|
9
|
+
on?: {
|
|
10
|
+
click: (e: MouseEvent) => void;
|
|
11
|
+
};
|
|
12
|
+
children: Snippet;
|
|
13
|
+
};
|
|
14
|
+
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type Cmp = ReturnType<typeof Cmp>;
|
|
16
|
+
export default Cmp;
|