@amityco/react-native-social-uikit 4.0.0-c2327e7.0 → 4.0.0-d2b8337.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/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
- package/lib/commonjs/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
- package/lib/commonjs/components/MediaSection/index.js +3 -3
- package/lib/commonjs/components/MediaSection/index.js.map +1 -1
- package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js +5 -14
- package/lib/commonjs/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
- package/lib/commonjs/components/PostTypeChoiceModal/style.js +2 -1
- package/lib/commonjs/components/PostTypeChoiceModal/style.js.map +1 -1
- package/lib/commonjs/components/Social/PostList/index.js +3 -1
- package/lib/commonjs/components/Social/PostList/index.js.map +1 -1
- package/lib/commonjs/components/Toast/Toast.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js.map +1 -1
- package/lib/commonjs/index.js +0 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/providers/file-provider.js +38 -19
- package/lib/commonjs/providers/file-provider.js.map +1 -1
- package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js +16 -16
- package/lib/commonjs/screens/CreateLivestream/CreateLivestream.js.map +1 -1
- package/lib/commonjs/screens/LivestreamPlayer/index.js +6 -3
- package/lib/commonjs/screens/LivestreamPlayer/index.js.map +1 -1
- package/lib/commonjs/svg/svg-xml-list.js +7 -2
- package/lib/commonjs/svg/svg-xml-list.js.map +1 -1
- package/lib/commonjs/util/postTypeChecker.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +9 -11
- package/lib/commonjs/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +2 -3
- package/lib/commonjs/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +25 -28
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
- package/lib/commonjs/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +68 -206
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +3 -71
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +117 -120
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +37 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
- package/lib/commonjs/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/commonjs/v4/assets/icons/toast.js +6 -6
- package/lib/commonjs/v4/assets/icons/toast.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/index.js +9 -4
- package/lib/commonjs/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/commonjs/v4/component/CommunityStories/styles.js +7 -2
- package/lib/commonjs/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/commonjs/v4/component/LivestreamContent/index.js +12 -12
- package/lib/commonjs/v4/component/LivestreamContent/index.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingImage/index.js +22 -25
- package/lib/commonjs/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingImage/styles.js +19 -2
- package/lib/commonjs/v4/component/LoadingImage/styles.js.map +1 -1
- package/lib/commonjs/v4/component/LoadingVideo/index.js +12 -6
- package/lib/commonjs/v4/component/LoadingVideo/index.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js +11 -4
- package/lib/commonjs/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/commonjs/v4/component/MyStories/styles.js +5 -0
- package/lib/commonjs/v4/component/MyStories/styles.js.map +1 -1
- package/lib/commonjs/v4/component/PostContent/index.js +4 -4
- package/lib/commonjs/v4/component/PostContent/index.js.map +1 -1
- package/lib/commonjs/v4/component/PostMenu/index.js +2 -2
- package/lib/commonjs/v4/component/PostMenu/index.js.map +1 -1
- package/lib/commonjs/v4/component/Toast/index.js +4 -4
- package/lib/commonjs/v4/component/Toast/index.js.map +1 -1
- package/lib/commonjs/v4/component/Toast/styles.js +2 -2
- package/lib/commonjs/v4/component/Toast/styles.js.map +1 -1
- package/lib/commonjs/v4/enum/livestreamStatus.js +13 -0
- package/lib/commonjs/v4/enum/livestreamStatus.js.map +1 -0
- package/lib/commonjs/v4/hook/index.js +0 -22
- package/lib/commonjs/v4/hook/index.js.map +1 -1
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js +3 -1
- package/lib/commonjs/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/commonjs/v4/index.js +0 -7
- package/lib/commonjs/v4/index.js.map +1 -1
- package/lib/commonjs/v4/stores/slices/toast.js +1 -4
- package/lib/commonjs/v4/stores/slices/toast.js.map +1 -1
- package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js +1 -1
- package/lib/module/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.js.map +1 -1
- package/lib/module/components/MediaSection/index.js +3 -3
- package/lib/module/components/MediaSection/index.js.map +1 -1
- package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js +8 -15
- package/lib/module/components/PostTypeChoiceModal/PostTypeChoiceModal.js.map +1 -1
- package/lib/module/components/PostTypeChoiceModal/style.js +2 -1
- package/lib/module/components/PostTypeChoiceModal/style.js.map +1 -1
- package/lib/module/components/Social/PostList/index.js +3 -1
- package/lib/module/components/Social/PostList/index.js.map +1 -1
- package/lib/module/components/Toast/Toast.js +2 -1
- package/lib/module/components/Toast/Toast.js.map +1 -1
- package/lib/module/index.js +6 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/file-provider.js +38 -19
- package/lib/module/providers/file-provider.js.map +1 -1
- package/lib/module/screens/CreateLivestream/CreateLivestream.js +17 -17
- package/lib/module/screens/CreateLivestream/CreateLivestream.js.map +1 -1
- package/lib/module/screens/LivestreamPlayer/index.js +8 -4
- package/lib/module/screens/LivestreamPlayer/index.js.map +1 -1
- package/lib/module/svg/svg-xml-list.js +5 -1
- package/lib/module/svg/svg-xml-list.js.map +1 -1
- package/lib/module/util/postTypeChecker.js.map +1 -1
- package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js +9 -11
- package/lib/module/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.js.map +1 -1
- package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js +2 -3
- package/lib/module/v4/PublicApi/Elements/ButtonWithIconElement/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js +26 -29
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js +2 -2
- package/lib/module/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js +72 -211
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js +3 -71
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js +120 -123
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js +37 -1
- package/lib/module/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js +54 -21
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.js.map +1 -1
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js +24 -2
- package/lib/module/v4/PublicApi/Pages/AmityViewStoryPage/styles.js.map +1 -1
- package/lib/module/v4/assets/icons/toast.js +6 -6
- package/lib/module/v4/assets/icons/toast.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/index.js +10 -5
- package/lib/module/v4/component/CommunityStories/index.js.map +1 -1
- package/lib/module/v4/component/CommunityStories/styles.js +7 -2
- package/lib/module/v4/component/CommunityStories/styles.js.map +1 -1
- package/lib/module/v4/component/LivestreamContent/index.js +13 -13
- package/lib/module/v4/component/LivestreamContent/index.js.map +1 -1
- package/lib/module/v4/component/LoadingImage/index.js +22 -24
- package/lib/module/v4/component/LoadingImage/index.js.map +1 -1
- package/lib/module/v4/component/LoadingImage/styles.js +19 -2
- package/lib/module/v4/component/LoadingImage/styles.js.map +1 -1
- package/lib/module/v4/component/LoadingVideo/index.js +12 -6
- package/lib/module/v4/component/LoadingVideo/index.js.map +1 -1
- package/lib/module/v4/component/MyStories/StoryCircleItem.js +13 -6
- package/lib/module/v4/component/MyStories/StoryCircleItem.js.map +1 -1
- package/lib/module/v4/component/MyStories/styles.js +5 -0
- package/lib/module/v4/component/MyStories/styles.js.map +1 -1
- package/lib/module/v4/component/PostContent/index.js +4 -4
- package/lib/module/v4/component/PostContent/index.js.map +1 -1
- package/lib/module/v4/component/PostMenu/index.js +2 -2
- package/lib/module/v4/component/PostMenu/index.js.map +1 -1
- package/lib/module/v4/component/Toast/index.js +4 -4
- package/lib/module/v4/component/Toast/index.js.map +1 -1
- package/lib/module/v4/component/Toast/styles.js +2 -2
- package/lib/module/v4/component/Toast/styles.js.map +1 -1
- package/lib/module/v4/enum/livestreamStatus.js +7 -0
- package/lib/module/v4/enum/livestreamStatus.js.map +1 -0
- package/lib/module/v4/hook/index.js +0 -2
- package/lib/module/v4/hook/index.js.map +1 -1
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js +3 -1
- package/lib/module/v4/hook/useCustomRankingGlobalFeed.js.map +1 -1
- package/lib/module/v4/index.js +1 -1
- package/lib/module/v4/index.js.map +1 -1
- package/lib/module/v4/stores/slices/toast.js +1 -4
- package/lib/module/v4/stores/slices/toast.js.map +1 -1
- package/lib/typescript/src/components/MediaSection/index.d.ts.map +1 -1
- package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts +2 -1
- package/lib/typescript/src/components/PostTypeChoiceModal/style.d.ts.map +1 -1
- package/lib/typescript/src/components/Social/PostList/index.d.ts +3 -1
- package/lib/typescript/src/components/Social/PostList/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/providers/file-provider.d.ts.map +1 -1
- package/lib/typescript/src/screens/LivestreamPlayer/index.d.ts.map +1 -1
- package/lib/typescript/src/svg/svg-xml-list.d.ts +1 -0
- package/lib/typescript/src/svg/svg-xml-list.d.ts.map +1 -1
- package/lib/typescript/src/util/postTypeChecker.d.ts +1 -1
- package/lib/typescript/src/util/postTypeChecker.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts +3 -1
- package/lib/typescript/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts +0 -1
- package/lib/typescript/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.d.ts +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts +2 -70
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts +22 -0
- package/lib/typescript/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/assets/icons/toast.d.ts +3 -3
- package/lib/typescript/src/v4/assets/icons/toast.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts +5 -0
- package/lib/typescript/src/v4/component/CommunityStories/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts +1 -1
- package/lib/typescript/src/v4/component/LivestreamContent/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingImage/index.d.ts +2 -1
- package/lib/typescript/src/v4/component/LoadingImage/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts +21 -0
- package/lib/typescript/src/v4/component/LoadingImage/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts +2 -1
- package/lib/typescript/src/v4/component/LoadingVideo/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/StoryCircleItem.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts +5 -0
- package/lib/typescript/src/v4/component/MyStories/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/PostContent/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/component/Toast/styles.d.ts +1 -1
- package/lib/typescript/src/v4/component/Toast/styles.d.ts.map +1 -1
- package/lib/typescript/src/v4/enum/livestreamStatus.d.ts +7 -0
- package/lib/typescript/src/v4/enum/livestreamStatus.d.ts.map +1 -0
- package/lib/typescript/src/v4/hook/index.d.ts +0 -2
- package/lib/typescript/src/v4/hook/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts +0 -3
- package/lib/typescript/src/v4/hook/usePendingPostQuery.d.ts.map +1 -1
- package/lib/typescript/src/v4/index.d.ts +0 -1
- package/lib/typescript/src/v4/index.d.ts.map +1 -1
- package/lib/typescript/src/v4/routes/RouteParamList.d.ts +1 -1
- package/lib/typescript/src/v4/routes/RouteParamList.d.ts.map +1 -1
- package/lib/typescript/src/v4/stores/slices/toast.d.ts +0 -1
- package/lib/typescript/src/v4/stores/slices/toast.d.ts.map +1 -1
- package/package.json +3 -6
- package/src/components/CreatePostChooseTargetModal/CreatePostChooseTargetModal.tsx +1 -1
- package/src/components/MediaSection/index.tsx +6 -4
- package/src/components/PostTypeChoiceModal/PostTypeChoiceModal.tsx +15 -15
- package/src/components/PostTypeChoiceModal/style.ts +2 -1
- package/src/components/Social/PostList/index.tsx +4 -1
- package/src/components/Toast/Toast.tsx +1 -0
- package/src/index.tsx +2 -2
- package/src/providers/file-provider.tsx +42 -20
- package/src/screens/CreateLivestream/CreateLivestream.tsx +17 -17
- package/src/screens/LivestreamPlayer/index.tsx +15 -9
- package/src/svg/svg-xml-list.ts +7 -1
- package/src/util/postTypeChecker.ts +1 -1
- package/src/v4/PublicApi/Components/AmityCreatePostMenuComponent/AmityCreatePostMenuComponent.tsx +10 -10
- package/src/v4/PublicApi/Components/AmityPostContentComponent/AmityPostContentComponent.tsx +1 -1
- package/src/v4/PublicApi/Elements/ButtonWithIconElement/styles.ts +2 -3
- package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/AmityCommunityProfilePage.tsx +25 -24
- package/src/v4/PublicApi/Pages/AmityCommunityProfilePage/styles.ts +2 -2
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/AmityCreateLivestreamPage.tsx +89 -241
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/styles.ts +3 -72
- package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/AmityLivestreamPlayerPage.tsx +148 -135
- package/src/v4/PublicApi/Pages/AmityLivestreamPlayerPage/styles.ts +0 -1
- package/src/v4/PublicApi/Pages/AmityPostComposerPage/AmityPostComposerPage.tsx +46 -0
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/Components/AmityViewStoryItem.tsx +122 -57
- package/src/v4/PublicApi/Pages/AmityViewStoryPage/styles.ts +23 -1
- package/src/v4/assets/icons/toast.tsx +12 -9
- package/src/v4/component/CommunityStories/index.tsx +26 -17
- package/src/v4/component/CommunityStories/styles.ts +7 -2
- package/src/v4/component/LivestreamContent/index.tsx +22 -21
- package/src/v4/component/LoadingImage/index.tsx +28 -25
- package/src/v4/component/LoadingImage/styles.ts +17 -0
- package/src/v4/component/LoadingVideo/index.tsx +13 -7
- package/src/v4/component/MyStories/StoryCircleItem.tsx +19 -12
- package/src/v4/component/MyStories/styles.ts +5 -0
- package/src/v4/component/PostContent/index.tsx +8 -6
- package/src/v4/component/PostMenu/index.tsx +2 -2
- package/src/v4/component/Toast/index.tsx +1 -1
- package/src/v4/component/Toast/styles.ts +2 -2
- package/src/v4/enum/livestreamStatus.ts +6 -0
- package/src/v4/hook/index.ts +0 -2
- package/src/v4/hook/useCustomRankingGlobalFeed.ts +1 -1
- package/src/v4/index.tsx +1 -1
- package/src/v4/routes/RouteParamList.tsx +1 -1
- package/src/v4/stores/slices/toast.ts +0 -5
- package/uikit.config.json +1 -1
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +0 -50
- package/lib/commonjs/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +0 -1
- package/lib/commonjs/v4/enum/roomStatus.js +0 -14
- package/lib/commonjs/v4/enum/roomStatus.js.map +0 -1
- package/lib/commonjs/v4/hook/usePostSubscription.js +0 -38
- package/lib/commonjs/v4/hook/usePostSubscription.js.map +0 -1
- package/lib/commonjs/v4/hook/useRoomSubscription.js +0 -22
- package/lib/commonjs/v4/hook/useRoomSubscription.js.map +0 -1
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js +0 -42
- package/lib/module/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.js.map +0 -1
- package/lib/module/v4/enum/roomStatus.js +0 -8
- package/lib/module/v4/enum/roomStatus.js.map +0 -1
- package/lib/module/v4/hook/usePostSubscription.js +0 -31
- package/lib/module/v4/hook/usePostSubscription.js.map +0 -1
- package/lib/module/v4/hook/useRoomSubscription.js +0 -15
- package/lib/module/v4/hook/useRoomSubscription.js.map +0 -1
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts +0 -8
- package/lib/typescript/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.d.ts.map +0 -1
- package/lib/typescript/src/v4/enum/roomStatus.d.ts +0 -8
- package/lib/typescript/src/v4/enum/roomStatus.d.ts.map +0 -1
- package/lib/typescript/src/v4/hook/usePostSubscription.d.ts +0 -4
- package/lib/typescript/src/v4/hook/usePostSubscription.d.ts.map +0 -1
- package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts +0 -4
- package/lib/typescript/src/v4/hook/useRoomSubscription.d.ts.map +0 -1
- package/src/v4/PublicApi/Pages/AmityCreateLivestreamPage/RoomView.tsx +0 -48
- package/src/v4/enum/roomStatus.ts +0 -7
- package/src/v4/hook/usePostSubscription.ts +0 -34
- package/src/v4/hook/useRoomSubscription.ts +0 -19
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
useCallback,
|
|
3
|
+
useEffect,
|
|
4
|
+
useLayoutEffect,
|
|
5
|
+
useRef,
|
|
6
|
+
useState,
|
|
7
|
+
} from 'react';
|
|
2
8
|
import {
|
|
3
9
|
Alert,
|
|
4
10
|
Image,
|
|
@@ -6,15 +12,20 @@ import {
|
|
|
6
12
|
Platform,
|
|
7
13
|
TextInput,
|
|
8
14
|
TouchableOpacity,
|
|
15
|
+
// Linking,
|
|
9
16
|
View,
|
|
10
17
|
ImageStyle,
|
|
11
|
-
Linking,
|
|
12
18
|
} from 'react-native';
|
|
13
19
|
import { useStyles } from './styles';
|
|
14
20
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
21
|
+
// import {
|
|
22
|
+
// AmityStreamBroadcasterState,
|
|
23
|
+
// AmityVideoBroadcaster,
|
|
24
|
+
// // @ts-ignore
|
|
25
|
+
// } from '@amityco/video-broadcaster-react-native';
|
|
15
26
|
import { RouteProp, useNavigation, useRoute } from '@react-navigation/native';
|
|
16
27
|
import useImagePicker from '../../../../v4/hook/useImagePicker';
|
|
17
|
-
import { arrowDown
|
|
28
|
+
import { arrowDown } from '../../../../v4/assets/icons';
|
|
18
29
|
import { SvgXml } from 'react-native-svg';
|
|
19
30
|
import { Typography } from '../../../component/Typography/Typography';
|
|
20
31
|
import { useTheme } from 'react-native-paper';
|
|
@@ -22,12 +33,12 @@ import { MyMD3Theme } from '../../../../providers/amity-ui-kit-provider';
|
|
|
22
33
|
import { useBottomSheet } from '../../../../redux/slices/bottomSheetSlice';
|
|
23
34
|
import { CircularProgressIndicator } from '../../../component/CircularProgressIndicator';
|
|
24
35
|
import { RootStackParamList } from '../../../../v4/routes/RouteParamList';
|
|
25
|
-
import { PostRepository,
|
|
36
|
+
import { PostRepository, StreamRepository } from '@amityco/ts-sdk-react-native';
|
|
26
37
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
27
|
-
import Button from '../../../component/Button/Button';
|
|
38
|
+
// import Button from '../../../component/Button/Button';
|
|
28
39
|
import { useRequestPermission } from '../../../../v4/hook/useCamera';
|
|
29
40
|
import NetInfo from '@react-native-community/netinfo';
|
|
30
|
-
import {
|
|
41
|
+
import { LivestreamStatus } from '../../../enum/livestreamStatus';
|
|
31
42
|
import { AmityThumbnailActionComponent } from '../../Components/AmityThumbnailActionComponent';
|
|
32
43
|
import { StartLivestreamButton } from '../../../elements/StartLivestreamButton';
|
|
33
44
|
import { PageID } from '../../../enum';
|
|
@@ -37,18 +48,6 @@ import { EndLiveStreamButton } from '../../../elements/EndLiveStreamButton';
|
|
|
37
48
|
import { AddThumbnailButton } from '../../../elements/AddThumbnailButton';
|
|
38
49
|
import { SwitchCameraButton } from '../../../elements/SwitchCameraButton';
|
|
39
50
|
|
|
40
|
-
import { Track, LocalVideoTrack } from 'livekit-client';
|
|
41
|
-
import { LiveKitRoom, registerGlobals } from '@livekit/react-native';
|
|
42
|
-
import { RoomView } from './RoomView';
|
|
43
|
-
import { Camera, useCameraDevice } from 'react-native-vision-camera';
|
|
44
|
-
import { useRoomSubscription } from '../../../../v4/hook/useRoomSubscription';
|
|
45
|
-
import { useToast } from '../../../../v4/stores/slices/toast';
|
|
46
|
-
|
|
47
|
-
// Register WebRTC globals required for LiveKit
|
|
48
|
-
registerGlobals();
|
|
49
|
-
|
|
50
|
-
const serverUrl = 'wss://sp-live-3tr59jrk.livekit.cloud';
|
|
51
|
-
|
|
52
51
|
const calculateTime = (time: number) => {
|
|
53
52
|
const hours = Math.floor(time / 3600000);
|
|
54
53
|
const minutes = Math.floor(time / 60000);
|
|
@@ -65,6 +64,7 @@ const calculateTime = (time: number) => {
|
|
|
65
64
|
|
|
66
65
|
function AmityCreateLivestreamPage() {
|
|
67
66
|
const styles = useStyles();
|
|
67
|
+
const streamRef = useRef<any>(null);
|
|
68
68
|
const navigation =
|
|
69
69
|
useNavigation<NativeStackNavigationProp<RootStackParamList>>();
|
|
70
70
|
const theme = useTheme<MyMD3Theme>();
|
|
@@ -75,28 +75,15 @@ function AmityCreateLivestreamPage() {
|
|
|
75
75
|
const [isLive, setIsLive] = useState<boolean>(false);
|
|
76
76
|
const [description, setDescription] = useState<string>('');
|
|
77
77
|
const [isEnding, setIsEnding] = useState<boolean>(false);
|
|
78
|
-
const [countdown, setCountdown] = useState<number | null>(null);
|
|
79
78
|
const [post, setPost] = useState<Amity.Post | null>(null);
|
|
80
|
-
const [
|
|
81
|
-
const
|
|
79
|
+
const [stream, setStream] = useState<Amity.Stream | null>(null);
|
|
80
|
+
const [timer] = useState<number | null>(null);
|
|
82
81
|
const [isConnecting, setIsConnecting] = useState<boolean>(false);
|
|
83
82
|
const [androidPermission, setAndroidPermission] = useState<boolean>(false);
|
|
84
83
|
const [iOSPermission, setIOSPermission] = useState<boolean>(true);
|
|
85
84
|
const [reconnecting, setReconnecting] = useState<boolean>(false);
|
|
86
|
-
const [livekitParticipant, setLivekitParticipant] = useState<any>(null);
|
|
87
|
-
const [isFrontCamera, setIsFrontCamera] = useState<boolean>(true);
|
|
88
|
-
const [roomToken, setRoomToken] = useState<Amity.BroadcasterData | null>(
|
|
89
|
-
null
|
|
90
|
-
);
|
|
91
85
|
const unsubscribeRef = useRef<Amity.Unsubscriber>(null);
|
|
92
86
|
|
|
93
|
-
useRoomSubscription({ room });
|
|
94
|
-
const { showToast } = useToast();
|
|
95
|
-
|
|
96
|
-
const frontCamera = useCameraDevice('front');
|
|
97
|
-
const backCamera = useCameraDevice('back');
|
|
98
|
-
const cameraDevice = isFrontCamera ? frontCamera : backCamera;
|
|
99
|
-
|
|
100
87
|
const {
|
|
101
88
|
imageUri,
|
|
102
89
|
isLoading,
|
|
@@ -113,43 +100,6 @@ function AmityCreateLivestreamPage() {
|
|
|
113
100
|
(Platform.OS === 'android' && androidPermission) ||
|
|
114
101
|
(Platform.OS === 'ios' && iOSPermission);
|
|
115
102
|
|
|
116
|
-
const fourHours = 4 * 60 * 60 * 1000; // 4 hours
|
|
117
|
-
const countdownStart = fourHours - 10 * 1000; // Start countdown 10 seconds before end
|
|
118
|
-
const toastTriggerTime = fourHours - 3 * 60 * 1000; // Show toast 3 minutes before end
|
|
119
|
-
|
|
120
|
-
const switchCamera = useCallback(async () => {
|
|
121
|
-
if (isLive && livekitParticipant) {
|
|
122
|
-
try {
|
|
123
|
-
const cameraPublication = livekitParticipant.getTrackPublication(
|
|
124
|
-
Track.Source.Camera
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
if (cameraPublication?.track) {
|
|
128
|
-
const videoTrack = cameraPublication.track as LocalVideoTrack;
|
|
129
|
-
|
|
130
|
-
// Stop current camera
|
|
131
|
-
await videoTrack.stop();
|
|
132
|
-
|
|
133
|
-
// Get new facing mode
|
|
134
|
-
const newFacingMode = isFrontCamera ? 'environment' : 'user';
|
|
135
|
-
|
|
136
|
-
// Restart camera with new facing mode
|
|
137
|
-
await videoTrack.restartTrack({
|
|
138
|
-
facingMode: newFacingMode,
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// Toggle the camera state
|
|
142
|
-
setIsFrontCamera((prev) => !prev);
|
|
143
|
-
}
|
|
144
|
-
} catch (error) {
|
|
145
|
-
console.error('Failed to switch camera:', error);
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
// Just toggle the camera state for preview
|
|
149
|
-
setIsFrontCamera((prev) => !prev);
|
|
150
|
-
}
|
|
151
|
-
}, [livekitParticipant, isFrontCamera, isLive]);
|
|
152
|
-
|
|
153
103
|
useRequestPermission({
|
|
154
104
|
shouldCall: Platform.OS === 'ios',
|
|
155
105
|
onRequestPermissionFailed: (callback?: () => void) => {
|
|
@@ -206,54 +156,37 @@ function AmityCreateLivestreamPage() {
|
|
|
206
156
|
setIsLive(true);
|
|
207
157
|
setIsConnecting(true);
|
|
208
158
|
|
|
209
|
-
const { data: newStream } = await
|
|
159
|
+
const { data: newStream } = await StreamRepository.createStream({
|
|
210
160
|
title,
|
|
211
161
|
description: description || undefined,
|
|
212
162
|
thumbnailFileId: uploadedImage?.fileId,
|
|
213
|
-
type: 'coHosts',
|
|
214
163
|
});
|
|
215
164
|
|
|
216
|
-
setRoom(newStream);
|
|
217
|
-
|
|
218
165
|
if (newStream) {
|
|
219
|
-
const roomTokenResponse = await RoomRepository.getBroadcasterData(
|
|
220
|
-
newStream.roomId
|
|
221
|
-
);
|
|
222
|
-
|
|
223
|
-
setRoomToken(roomTokenResponse);
|
|
224
|
-
|
|
225
166
|
const params = {
|
|
226
167
|
targetId,
|
|
227
168
|
targetType,
|
|
228
|
-
dataType: '
|
|
169
|
+
dataType: 'liveStream' as Amity.PostContentType,
|
|
229
170
|
data: {
|
|
230
171
|
text: `${newStream.title}${
|
|
231
172
|
newStream.description ? `\n\n${newStream.description}` : ''
|
|
232
173
|
}`,
|
|
233
|
-
|
|
174
|
+
streamId: newStream.streamId,
|
|
234
175
|
},
|
|
235
176
|
};
|
|
236
177
|
|
|
237
178
|
const newPost = await PostRepository.createPost(params);
|
|
238
179
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const intervalId = setInterval(() => {
|
|
250
|
-
setTime((prev) => prev + 1000);
|
|
251
|
-
}, 1000);
|
|
252
|
-
|
|
253
|
-
timerRef.current = intervalId;
|
|
180
|
+
streamRef.current = StreamRepository.getStreamById(
|
|
181
|
+
newStream.streamId,
|
|
182
|
+
({ data }) => {
|
|
183
|
+
setStream(data);
|
|
184
|
+
setPost(newPost.data);
|
|
185
|
+
streamRef?.current?.startPublish(newStream.streamId);
|
|
186
|
+
}
|
|
187
|
+
);
|
|
254
188
|
}
|
|
255
189
|
} catch (error) {
|
|
256
|
-
console.log('startLiveStream error', error);
|
|
257
190
|
setIsLive(false);
|
|
258
191
|
setIsConnecting(false);
|
|
259
192
|
Alert.alert(
|
|
@@ -268,6 +201,17 @@ function AmityCreateLivestreamPage() {
|
|
|
268
201
|
}
|
|
269
202
|
};
|
|
270
203
|
|
|
204
|
+
// const onBroadcastStateChange = (state: AmityStreamBroadcasterState) => {
|
|
205
|
+
// if (state === AmityStreamBroadcasterState.CONNECTED) {
|
|
206
|
+
// setIsConnecting(false);
|
|
207
|
+
// setReconnecting(false);
|
|
208
|
+
// const intervalId = setInterval(() => {
|
|
209
|
+
// setTime((prev) => prev + 1000);
|
|
210
|
+
// }, 1000);
|
|
211
|
+
// setTimer(intervalId);
|
|
212
|
+
// }
|
|
213
|
+
// };
|
|
214
|
+
|
|
271
215
|
const confirmEndStreamAlert = () => {
|
|
272
216
|
Alert.alert(
|
|
273
217
|
'End live stream?',
|
|
@@ -290,22 +234,21 @@ function AmityCreateLivestreamPage() {
|
|
|
290
234
|
|
|
291
235
|
const endLiveStream = useCallback(
|
|
292
236
|
async (showEndPopup = false) => {
|
|
293
|
-
if (
|
|
237
|
+
if (stream) {
|
|
294
238
|
setIsEnding(true);
|
|
295
239
|
try {
|
|
296
|
-
await
|
|
240
|
+
await StreamRepository.disposeStream(stream.streamId);
|
|
297
241
|
} catch (e) {
|
|
298
242
|
console.log('disposeStream error', e);
|
|
299
243
|
} finally {
|
|
244
|
+
streamRef?.current.stopPublish();
|
|
245
|
+
|
|
300
246
|
setIsLive(false);
|
|
301
|
-
|
|
247
|
+
setStream(null);
|
|
302
248
|
setTitle('');
|
|
303
249
|
setDescription('');
|
|
304
250
|
setTime(0);
|
|
305
|
-
|
|
306
|
-
clearInterval(timerRef.current);
|
|
307
|
-
timerRef.current = null;
|
|
308
|
-
}
|
|
251
|
+
clearInterval(timer);
|
|
309
252
|
setIsEnding(false);
|
|
310
253
|
setReconnecting(false);
|
|
311
254
|
|
|
@@ -316,40 +259,15 @@ function AmityCreateLivestreamPage() {
|
|
|
316
259
|
}
|
|
317
260
|
}
|
|
318
261
|
},
|
|
319
|
-
[post,
|
|
262
|
+
[post, stream, timer, navigation]
|
|
320
263
|
);
|
|
321
264
|
|
|
322
265
|
useEffect(() => {
|
|
323
|
-
|
|
324
|
-
if (
|
|
325
|
-
showToast({
|
|
326
|
-
type: 'informative',
|
|
327
|
-
message:
|
|
328
|
-
'Your live will automatically end once it reaches 4-hour limit.',
|
|
329
|
-
duration: 3000,
|
|
330
|
-
bottomPosition: 96,
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (room && time >= fourHours) {
|
|
266
|
+
const fourHours = 4 * 60 * 60 * 1000;
|
|
267
|
+
if (streamRef.current && stream && time >= fourHours) {
|
|
335
268
|
endLiveStream(true);
|
|
336
|
-
setCountdown(null);
|
|
337
|
-
} else if (room && time >= countdownStart && time < fourHours) {
|
|
338
|
-
// Calculate countdown from 10 to 0
|
|
339
|
-
const remaining = Math.ceil((fourHours - time) / 1000);
|
|
340
|
-
setCountdown(remaining);
|
|
341
|
-
} else {
|
|
342
|
-
setCountdown(null);
|
|
343
269
|
}
|
|
344
|
-
}, [
|
|
345
|
-
endLiveStream,
|
|
346
|
-
room,
|
|
347
|
-
time,
|
|
348
|
-
showToast,
|
|
349
|
-
toastTriggerTime,
|
|
350
|
-
fourHours,
|
|
351
|
-
countdownStart,
|
|
352
|
-
]);
|
|
270
|
+
}, [endLiveStream, stream, time]);
|
|
353
271
|
|
|
354
272
|
useEffect(() => {
|
|
355
273
|
if (Platform.OS === 'android') checkPermissionAndroid();
|
|
@@ -366,34 +284,48 @@ function AmityCreateLivestreamPage() {
|
|
|
366
284
|
return () => unsubscribe();
|
|
367
285
|
}, []);
|
|
368
286
|
|
|
287
|
+
useLayoutEffect(() => {
|
|
288
|
+
setTimeout(() => {
|
|
289
|
+
streamRef.current && streamRef.current.switchCamera();
|
|
290
|
+
}, 300);
|
|
291
|
+
}, [streamRef]);
|
|
292
|
+
|
|
369
293
|
useEffect(() => {
|
|
370
294
|
let threeMinutesTimeout: number;
|
|
371
295
|
|
|
372
|
-
if (reconnecting &&
|
|
296
|
+
if (reconnecting && stream && stream?.status === 'live') {
|
|
373
297
|
threeMinutesTimeout = setTimeout(() => {
|
|
374
298
|
endLiveStream();
|
|
375
299
|
}, 1000 * 60 * 3);
|
|
376
300
|
}
|
|
377
301
|
|
|
378
|
-
if (
|
|
302
|
+
if (
|
|
303
|
+
!reconnecting &&
|
|
304
|
+
stream &&
|
|
305
|
+
stream?.status === 'live' &&
|
|
306
|
+
streamRef?.current
|
|
307
|
+
) {
|
|
308
|
+
streamRef?.current?.startPublish(stream?.streamId);
|
|
309
|
+
|
|
379
310
|
if (threeMinutesTimeout) {
|
|
380
311
|
clearTimeout(threeMinutesTimeout);
|
|
381
312
|
threeMinutesTimeout = null;
|
|
382
313
|
}
|
|
383
314
|
}
|
|
384
|
-
}, [reconnecting, endLiveStream,
|
|
315
|
+
}, [reconnecting, endLiveStream, stream]);
|
|
385
316
|
|
|
386
317
|
useEffect(() => {
|
|
387
318
|
const isTerminated =
|
|
388
|
-
|
|
389
|
-
|
|
319
|
+
stream?.moderation?.terminateLabels &&
|
|
320
|
+
stream?.moderation?.terminateLabels?.length > 0;
|
|
390
321
|
const isLiveOrEnded =
|
|
391
|
-
|
|
322
|
+
stream?.status === LivestreamStatus.live ||
|
|
323
|
+
stream?.status === LivestreamStatus.ended;
|
|
392
324
|
|
|
393
325
|
if (isLiveOrEnded && isTerminated) {
|
|
394
326
|
navigation.replace('LivestreamTerminated', { type: 'streamer' });
|
|
395
327
|
}
|
|
396
|
-
}, [
|
|
328
|
+
}, [stream?.moderation?.terminateLabels, stream?.status, navigation]);
|
|
397
329
|
|
|
398
330
|
useEffect(() => {
|
|
399
331
|
const unsubscribe = unsubscribeRef.current;
|
|
@@ -413,53 +345,17 @@ function AmityCreateLivestreamPage() {
|
|
|
413
345
|
style={[styles.overlay, !hasPermission && styles.noPermissionOverlay]}
|
|
414
346
|
/>
|
|
415
347
|
)}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
options={{
|
|
426
|
-
adaptiveStream: { pixelDensity: 'screen' },
|
|
427
|
-
}}
|
|
428
|
-
audio={{
|
|
429
|
-
echoCancellation: true,
|
|
430
|
-
noiseSuppression: true,
|
|
431
|
-
autoGainControl: true,
|
|
432
|
-
}}
|
|
433
|
-
video={{
|
|
434
|
-
facingMode: isFrontCamera ? 'user' : 'environment',
|
|
435
|
-
}}
|
|
436
|
-
onConnected={() => {
|
|
437
|
-
setIsConnecting(false);
|
|
438
|
-
setReconnecting(false);
|
|
439
|
-
}}
|
|
440
|
-
>
|
|
441
|
-
<View style={styles.cameraContainer}>
|
|
442
|
-
<View style={styles.camera}>
|
|
443
|
-
<RoomView
|
|
444
|
-
onLocalParticipantReady={setLivekitParticipant}
|
|
445
|
-
isFrontCamera={isFrontCamera}
|
|
446
|
-
/>
|
|
447
|
-
</View>
|
|
448
|
-
</View>
|
|
449
|
-
</LiveKitRoom>
|
|
450
|
-
) : (
|
|
451
|
-
<View style={styles.cameraContainer}>
|
|
452
|
-
<View style={styles.camera}>
|
|
453
|
-
{cameraDevice && (
|
|
454
|
-
<Camera
|
|
455
|
-
style={{ flex: 1 }}
|
|
456
|
-
device={cameraDevice}
|
|
457
|
-
isActive={true}
|
|
458
|
-
/>
|
|
459
|
-
)}
|
|
460
|
-
</View>
|
|
348
|
+
{/* {hasPermission ? (
|
|
349
|
+
<View style={styles.cameraContainer}>
|
|
350
|
+
<View style={styles.camera}>
|
|
351
|
+
<AmityVideoBroadcaster
|
|
352
|
+
ref={streamRef}
|
|
353
|
+
bitrate={2 * 1024 * 1024}
|
|
354
|
+
onBroadcastStateChange={onBroadcastStateChange}
|
|
355
|
+
resolution={{ width: 1280, height: 720 }}
|
|
356
|
+
/>
|
|
461
357
|
</View>
|
|
462
|
-
|
|
358
|
+
</View>
|
|
463
359
|
) : (
|
|
464
360
|
<View style={styles.permission}>
|
|
465
361
|
<Typography.TitleBold style={styles.permissionTitle}>
|
|
@@ -478,8 +374,7 @@ function AmityCreateLivestreamPage() {
|
|
|
478
374
|
</Typography.BodyBold>
|
|
479
375
|
</Button>
|
|
480
376
|
</View>
|
|
481
|
-
)}
|
|
482
|
-
|
|
377
|
+
)} */}
|
|
483
378
|
{isEnding && (
|
|
484
379
|
<View style={styles.connecting}>
|
|
485
380
|
<CircularProgressIndicator size={40} strokeWidth={2} />
|
|
@@ -511,46 +406,12 @@ function AmityCreateLivestreamPage() {
|
|
|
511
406
|
</Typography.Caption>
|
|
512
407
|
</View>
|
|
513
408
|
)}
|
|
514
|
-
|
|
515
|
-
<TouchableOpacity
|
|
516
|
-
style={styles.closeButton}
|
|
517
|
-
onPress={() => confirmEndStreamAlert()}
|
|
518
|
-
>
|
|
519
|
-
<SvgXml
|
|
520
|
-
xml={close()}
|
|
521
|
-
width="28"
|
|
522
|
-
height="28"
|
|
523
|
-
color={theme.colors.background}
|
|
524
|
-
/>
|
|
525
|
-
</TouchableOpacity>
|
|
526
|
-
|
|
527
409
|
<View style={styles.timer}>
|
|
528
410
|
<LiveTimerStatus
|
|
529
411
|
time={calculateTime(time)}
|
|
530
412
|
pageId={PageID.create_livestream_page}
|
|
531
413
|
/>
|
|
532
414
|
</View>
|
|
533
|
-
{countdown !== null && (
|
|
534
|
-
<View style={styles.countdownOverlay}>
|
|
535
|
-
<View style={styles.countdownContainer}>
|
|
536
|
-
<Typography.TitleBold style={styles.countdownText}>
|
|
537
|
-
Live stream ends in
|
|
538
|
-
</Typography.TitleBold>
|
|
539
|
-
<View style={styles.countdownCircle}>
|
|
540
|
-
<CircularProgressIndicator
|
|
541
|
-
size={64}
|
|
542
|
-
strokeWidth={2}
|
|
543
|
-
progress={((10 - countdown) / 10) * 100}
|
|
544
|
-
/>
|
|
545
|
-
<View style={styles.countdownNumberContainer}>
|
|
546
|
-
<Typography.Title style={styles.countdownNumber}>
|
|
547
|
-
{countdown}
|
|
548
|
-
</Typography.Title>
|
|
549
|
-
</View>
|
|
550
|
-
</View>
|
|
551
|
-
</View>
|
|
552
|
-
</View>
|
|
553
|
-
)}
|
|
554
415
|
</>
|
|
555
416
|
)
|
|
556
417
|
) : (
|
|
@@ -582,18 +443,7 @@ function AmityCreateLivestreamPage() {
|
|
|
582
443
|
/>
|
|
583
444
|
<TouchableOpacity
|
|
584
445
|
style={styles.communityButton}
|
|
585
|
-
onPress={() =>
|
|
586
|
-
const state = navigation.getState();
|
|
587
|
-
const routes = state.routes;
|
|
588
|
-
const currentIndex = state.index;
|
|
589
|
-
const previousRoute = routes[currentIndex - 1];
|
|
590
|
-
|
|
591
|
-
if (previousRoute?.name === 'LivestreamPostTargetSelection') {
|
|
592
|
-
navigation.goBack();
|
|
593
|
-
} else {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
}}
|
|
446
|
+
onPress={() => navigation.goBack()}
|
|
597
447
|
activeOpacity={0.7}
|
|
598
448
|
>
|
|
599
449
|
<Typography.Body
|
|
@@ -602,11 +452,7 @@ function AmityCreateLivestreamPage() {
|
|
|
602
452
|
ellipsizeMode="tail"
|
|
603
453
|
>
|
|
604
454
|
Live on{' '}
|
|
605
|
-
<Typography.BodyBold
|
|
606
|
-
numberOfLines={1}
|
|
607
|
-
ellipsizeMode="tail"
|
|
608
|
-
style={styles.communityName}
|
|
609
|
-
>
|
|
455
|
+
<Typography.BodyBold numberOfLines={1} ellipsizeMode="tail">
|
|
610
456
|
{targetName}
|
|
611
457
|
</Typography.BodyBold>
|
|
612
458
|
</Typography.Body>
|
|
@@ -721,7 +567,9 @@ function AmityCreateLivestreamPage() {
|
|
|
721
567
|
)}
|
|
722
568
|
<SwitchCameraButton
|
|
723
569
|
pageId={PageID.create_livestream_page}
|
|
724
|
-
onPress={
|
|
570
|
+
onPress={() => {
|
|
571
|
+
streamRef.current && streamRef.current.switchCamera();
|
|
572
|
+
}}
|
|
725
573
|
/>
|
|
726
574
|
</View>
|
|
727
575
|
</SafeAreaView>
|
|
@@ -8,7 +8,7 @@ export const useStyles = () => {
|
|
|
8
8
|
const { height: screenHeight } = Dimensions.get('window');
|
|
9
9
|
const insets = useSafeAreaInsets();
|
|
10
10
|
|
|
11
|
-
const availableHeight = screenHeight - 80 - 60 - 40 - 40 - 120
|
|
11
|
+
const availableHeight = screenHeight - 80 - 60 - 40 - 40 - 120;
|
|
12
12
|
const styles = StyleSheet.create({
|
|
13
13
|
container: {
|
|
14
14
|
flex: 1,
|
|
@@ -26,6 +26,7 @@ export const useStyles = () => {
|
|
|
26
26
|
},
|
|
27
27
|
overlay: {
|
|
28
28
|
flex: 1,
|
|
29
|
+
height: '100%',
|
|
29
30
|
top: 0,
|
|
30
31
|
bottom: 0,
|
|
31
32
|
left: 0,
|
|
@@ -157,15 +158,8 @@ export const useStyles = () => {
|
|
|
157
158
|
text: {
|
|
158
159
|
color: theme.colors.background,
|
|
159
160
|
},
|
|
160
|
-
|
|
161
|
-
closeButton: {
|
|
162
|
-
left: 16,
|
|
163
|
-
zIndex: 100,
|
|
164
|
-
position: 'absolute',
|
|
165
|
-
top: 20 + insets.top,
|
|
166
|
-
},
|
|
167
161
|
timer: {
|
|
168
|
-
|
|
162
|
+
left: 16,
|
|
169
163
|
zIndex: 100,
|
|
170
164
|
position: 'absolute',
|
|
171
165
|
top: 20 + insets.top,
|
|
@@ -197,69 +191,6 @@ export const useStyles = () => {
|
|
|
197
191
|
color: theme.colors.background,
|
|
198
192
|
textAlign: 'center',
|
|
199
193
|
},
|
|
200
|
-
containerRoom: {
|
|
201
|
-
flex: 1,
|
|
202
|
-
alignItems: 'stretch',
|
|
203
|
-
justifyContent: 'center',
|
|
204
|
-
padding: 10,
|
|
205
|
-
},
|
|
206
|
-
participantView: {
|
|
207
|
-
flex: 1,
|
|
208
|
-
margin: 5,
|
|
209
|
-
height: 200,
|
|
210
|
-
backgroundColor: '#ccc',
|
|
211
|
-
},
|
|
212
|
-
roomContainer: {
|
|
213
|
-
flex: 1,
|
|
214
|
-
width: '100%',
|
|
215
|
-
height: '100%',
|
|
216
|
-
},
|
|
217
|
-
videoTrack: {
|
|
218
|
-
width: '100%',
|
|
219
|
-
height: '100%',
|
|
220
|
-
},
|
|
221
|
-
countdownOverlay: {
|
|
222
|
-
position: 'absolute',
|
|
223
|
-
top: 0,
|
|
224
|
-
left: 0,
|
|
225
|
-
right: 0,
|
|
226
|
-
bottom: 80,
|
|
227
|
-
justifyContent: 'center',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
230
|
-
zIndex: 150,
|
|
231
|
-
},
|
|
232
|
-
countdownContainer: {
|
|
233
|
-
alignItems: 'center',
|
|
234
|
-
gap: 24,
|
|
235
|
-
},
|
|
236
|
-
countdownCircle: {
|
|
237
|
-
position: 'relative',
|
|
238
|
-
alignItems: 'center',
|
|
239
|
-
justifyContent: 'center',
|
|
240
|
-
width: 72,
|
|
241
|
-
height: 72,
|
|
242
|
-
},
|
|
243
|
-
countdownNumberContainer: {
|
|
244
|
-
position: 'absolute',
|
|
245
|
-
top: 0,
|
|
246
|
-
left: 0,
|
|
247
|
-
right: 0,
|
|
248
|
-
bottom: 0,
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
justifyContent: 'center',
|
|
251
|
-
},
|
|
252
|
-
countdownNumber: {
|
|
253
|
-
fontSize: 32,
|
|
254
|
-
fontWeight: '700',
|
|
255
|
-
color: theme.colors.background,
|
|
256
|
-
},
|
|
257
|
-
countdownText: {
|
|
258
|
-
fontSize: 24,
|
|
259
|
-
fontWeight: '500',
|
|
260
|
-
color: theme.colors.background,
|
|
261
|
-
textAlign: 'center',
|
|
262
|
-
},
|
|
263
194
|
});
|
|
264
195
|
|
|
265
196
|
return styles;
|