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