Skip to content

Commit

Permalink
Update AmityUIKit v4.0.0-beta27
Browse files Browse the repository at this point in the history
  • Loading branch information
Zryte authored and Zryte committed Oct 25, 2024
1 parent 7e15ef1 commit 962175a
Show file tree
Hide file tree
Showing 15 changed files with 156 additions and 158 deletions.
8 changes: 4 additions & 4 deletions UpstraUIKit/AmityUIKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
68B30A7C2B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A752B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModelProtocol.swift */; };
68B30A7D2B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A762B70E38B006A4102 /* AmityStoryCommentSettingsScreenViewModel.swift */; };
68B30A7E2B70E38B006A4102 /* AmityStoryCommentSettingsItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68B30A782B70E38B006A4102 /* AmityStoryCommentSettingsItem.swift */; };
68BDD1802CC24EE1001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */; };
68F0EE062BC6BBDF004B3AA4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 68F0EE052BC6BBDF004B3AA4 /* PrivacyInfo.xcprivacy */; };
68F5D9FA2B481E4000A9FA0D /* AmityUIKit4.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68F5D9F92B481E4000A9FA0D /* AmityUIKit4.framework */; };
720D599A2525BDB1009734EF /* DispatchGroupWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720D59992525BDB1009734EF /* DispatchGroupWrapper.swift */; };
Expand Down Expand Up @@ -372,6 +371,7 @@
78DA0324263C715C007C11CE /* AmityMyCommunityPreviewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 78DA0320263C715C007C11CE /* AmityMyCommunityPreviewViewController.xib */; };
78DA0325263C715C007C11CE /* AmityMyCommunityPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78DA0321263C715C007C11CE /* AmityMyCommunityPreviewViewController.swift */; };
921C3FCB2C379FDB00BF403E /* AmitySocialV4Compatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921C3FCA2C379FDB00BF403E /* AmitySocialV4Compatible.swift */; };
9295F1E82CCB98580048603A /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 9295F1E72CCB98580048603A /* SharedFrameworks */; };
970E784726429FA500E5FCEE /* ChatSettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E784526429FA500E5FCEE /* ChatSettingsTableViewCell.swift */; };
970E784826429FA500E5FCEE /* ChatSettingsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 970E784626429FA500E5FCEE /* ChatSettingsTableViewCell.xib */; };
970E784E26429FB300E5FCEE /* AmityChatSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 970E784C26429FB300E5FCEE /* AmityChatSettingsViewController.swift */; };
Expand Down Expand Up @@ -1340,7 +1340,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
68BDD1802CC24EE1001B0D1E /* SharedFrameworks in Frameworks */,
9295F1E82CCB98580048603A /* SharedFrameworks in Frameworks */,
68F5D9FA2B481E4000A9FA0D /* AmityUIKit4.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -4507,7 +4507,7 @@
);
name = AmityUIKit;
packageProductDependencies = (
68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */,
9295F1E72CCB98580048603A /* SharedFrameworks */,
);
productName = UpstraUIKit;
productReference = 72A3503024EA811500DA9D46 /* AmityUIKit.framework */;
Expand Down Expand Up @@ -5523,7 +5523,7 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
68BDD17F2CC24EE1001B0D1E /* SharedFrameworks */ = {
9295F1E72CCB98580048603A /* SharedFrameworks */ = {
isa = XCSwiftPackageProductDependency;
productName = SharedFrameworks;
};
Expand Down
21 changes: 10 additions & 11 deletions UpstraUIKit/AmityUIKit4/AmityUIKit4.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
68BD2D042CB4EF3600FF0A19 /* TabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D032CB4EF3200FF0A19 /* TabBarView.swift */; };
68BD2D5F2CB5119F00FF0A19 /* PreviewLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D5E2CB5119B00FF0A19 /* PreviewLinkView.swift */; };
68BD2D612CB51AB400FF0A19 /* AmityReactionListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BD2D602CB51AB400FF0A19 /* AmityReactionListViewModel.swift */; };
68BDD17E2CC24ED8001B0D1E /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 68BDD17D2CC24ED8001B0D1E /* SharedFrameworks */; };
68BECE6C2BEA097500D1AA36 /* AmityPostModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6B2BEA097500D1AA36 /* AmityPostModel.swift */; };
68BECE6E2BEA09FF00D1AA36 /* AmityMedia.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6D2BEA09FF00D1AA36 /* AmityMedia.swift */; };
68BECE702BEA0C2300D1AA36 /* FeedManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68BECE6F2BEA0C2300D1AA36 /* FeedManager.swift */; };
Expand Down Expand Up @@ -345,9 +344,7 @@
68FF77D92B81C4A300B8F561 /* Page.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FF77C62B81C4A300B8F561 /* Page.swift */; };
68FF77DB2B81DEC900B8F561 /* AmityStoryTargetModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FF77DA2B81DEC900B8F561 /* AmityStoryTargetModel.swift */; };
921C3FC92C379F3E00BF403E /* AmityPostContentComponentBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 921C3FC82C379F3E00BF403E /* AmityPostContentComponentBehavior.swift */; };
923AA5682CB3B43D009C9357 /* RecordedStreamPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923AA5672CB3B43D009C9357 /* RecordedStreamPlayerView.swift */; };
923AA56A2CB3B453009C9357 /* LivestreamVideoPlayerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923AA5692CB3B453009C9357 /* LivestreamVideoPlayerViewModel.swift */; };
923AA56C2CB3B48F009C9357 /* AmityVideoPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923AA56B2CB3B48F009C9357 /* AmityVideoPlayerView.swift */; };
923AA56E2CB3B4BD009C9357 /* LivestreamVideoPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923AA56D2CB3B4BD009C9357 /* LivestreamVideoPlayerView.swift */; };
923AA5702CB3B4F0009C9357 /* Debouncer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 923AA56F2CB3B4F0009C9357 /* Debouncer.swift */; };
9250CA2D2C2D55E9007551ED /* MultiSelectionMediaPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9250CA2C2C2D55E9007551ED /* MultiSelectionMediaPicker.swift */; };
Expand All @@ -363,6 +360,8 @@
9280FDD82C40EB970052F01A /* AmityCommunityFeedComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9280FDD72C40EB970052F01A /* AmityCommunityFeedComponent.swift */; };
9280FDDB2C40EBFC0052F01A /* AmityCommunityProfileTabComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9280FDDA2C40EBFC0052F01A /* AmityCommunityProfileTabComponent.swift */; };
92891DE32BACE17100B5111E /* LiveChatMessageBubbleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92891DE22BACE17100B5111E /* LiveChatMessageBubbleView.swift */; };
9295F1E42CC7972E0048603A /* AmityLivestreamBehavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9295F1E32CC7972E0048603A /* AmityLivestreamBehavior.swift */; };
9295F1E62CCB984F0048603A /* SharedFrameworks in Frameworks */ = {isa = PBXBuildFile; productRef = 9295F1E52CCB984F0048603A /* SharedFrameworks */; };
92CC82702C332C4B0000B523 /* AmityCommentAdComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92CC826F2C332C4B0000B523 /* AmityCommentAdComponent.swift */; };
92D31B5C2BBCCDD000932DDA /* NetworkMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92D31B5B2BBCCDD000932DDA /* NetworkMonitor.swift */; };
92EF987F2BC5F7D60029B420 /* AmityLiveChatMessageSenderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92EF987E2BC5F7D60029B420 /* AmityLiveChatMessageSenderView.swift */; };
Expand Down Expand Up @@ -859,9 +858,7 @@
68FF77C62B81C4A300B8F561 /* Page.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Page.swift; sourceTree = "<group>"; };
68FF77DA2B81DEC900B8F561 /* AmityStoryTargetModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmityStoryTargetModel.swift; sourceTree = "<group>"; };
921C3FC82C379F3E00BF403E /* AmityPostContentComponentBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityPostContentComponentBehavior.swift; sourceTree = "<group>"; };
923AA5672CB3B43D009C9357 /* RecordedStreamPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecordedStreamPlayerView.swift; sourceTree = "<group>"; };
923AA5692CB3B453009C9357 /* LivestreamVideoPlayerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LivestreamVideoPlayerViewModel.swift; sourceTree = "<group>"; };
923AA56B2CB3B48F009C9357 /* AmityVideoPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityVideoPlayerView.swift; sourceTree = "<group>"; };
923AA56D2CB3B4BD009C9357 /* LivestreamVideoPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LivestreamVideoPlayerView.swift; sourceTree = "<group>"; };
923AA56F2CB3B4F0009C9357 /* Debouncer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Debouncer.swift; sourceTree = "<group>"; };
9250CA2C2C2D55E9007551ED /* MultiSelectionMediaPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiSelectionMediaPicker.swift; sourceTree = "<group>"; };
Expand All @@ -879,6 +876,7 @@
9280FDD72C40EB970052F01A /* AmityCommunityFeedComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityFeedComponent.swift; sourceTree = "<group>"; };
9280FDDA2C40EBFC0052F01A /* AmityCommunityProfileTabComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommunityProfileTabComponent.swift; sourceTree = "<group>"; };
92891DE22BACE17100B5111E /* LiveChatMessageBubbleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveChatMessageBubbleView.swift; sourceTree = "<group>"; };
9295F1E32CC7972E0048603A /* AmityLivestreamBehavior.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityLivestreamBehavior.swift; sourceTree = "<group>"; };
92CC826F2C332C4B0000B523 /* AmityCommentAdComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityCommentAdComponent.swift; sourceTree = "<group>"; };
92D31B5B2BBCCDD000932DDA /* NetworkMonitor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitor.swift; sourceTree = "<group>"; };
92EF987E2BC5F7D60029B420 /* AmityLiveChatMessageSenderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmityLiveChatMessageSenderView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1018,7 +1016,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
68BDD17E2CC24ED8001B0D1E /* SharedFrameworks in Frameworks */,
9295F1E62CCB984F0048603A /* SharedFrameworks in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2013,6 +2011,7 @@
68B201B12CAE581100F40C22 /* AmityUserPendingFollowRequestsPageBehavior.swift */,
68B201B32CAE741100F40C22 /* AmityBlockedUsersPageBehavior.swift */,
68B201B52CAE753C00F40C22 /* AmityPendingPostContentComponentBehavior.swift */,
9295F1E32CC7972E0048603A /* AmityLivestreamBehavior.swift */,
);
path = Behaviours;
sourceTree = "<group>";
Expand Down Expand Up @@ -2139,10 +2138,8 @@
isa = PBXGroup;
children = (
926C520C2CB7190B0085CA64 /* AmityLivestreamPlayerPage.swift */,
923AA5672CB3B43D009C9357 /* RecordedStreamPlayerView.swift */,
923AA5692CB3B453009C9357 /* LivestreamVideoPlayerViewModel.swift */,
923AA56D2CB3B4BD009C9357 /* LivestreamVideoPlayerView.swift */,
923AA56B2CB3B48F009C9357 /* AmityVideoPlayerView.swift */,
);
path = Livestream;
sourceTree = "<group>";
Expand Down Expand Up @@ -2755,6 +2752,9 @@
dependencies = (
);
name = AmityUIKit4;
packageProductDependencies = (
9295F1E52CCB984F0048603A /* SharedFrameworks */,
);
productName = AmityUIKit4;
productReference = 684AE0F12B0C5B0200FD7270 /* AmityUIKit4.framework */;
productType = "com.apple.product-type.framework";
Expand Down Expand Up @@ -2885,7 +2885,6 @@
684098212B313A6F00697E1B /* VideoCacheHandler.swift in Sources */,
68F0A1F22C7DB3250006B549 /* CommunityNotificationSettingView.swift in Sources */,
68DD29072C6DAFCF00FD3528 /* AmityCommunitySettingPage.swift in Sources */,
923AA56C2CB3B48F009C9357 /* AmityVideoPlayerView.swift in Sources */,
689A31D42C6368A400F17999 /* AmityCommunitySetupPageViewModel.swift in Sources */,
9280FDD42C40E9F90052F01A /* AmityCommunityHeaderComponent.swift in Sources */,
A97A440C2C2D2D4D0017327D /* PHPickerResultImageDataProvider.swift in Sources */,
Expand Down Expand Up @@ -2917,6 +2916,7 @@
689EE6B72BF21A2500927D51 /* MediaViewer.swift in Sources */,
684097D52B30942F00697E1B /* File.swift in Sources */,
684097DB2B30942F00697E1B /* Download.swift in Sources */,
9295F1E42CC7972E0048603A /* AmityLivestreamBehavior.swift in Sources */,
684097DD2B30942F00697E1B /* DownloadPublisher.swift in Sources */,
68DD290B2C6DD18B00FD3528 /* AmityCommunitySettingPageBehavior.swift in Sources */,
684097C52B30942F00697E1B /* URLImageInMemoryStore.swift in Sources */,
Expand Down Expand Up @@ -3077,7 +3077,6 @@
A9CEB8192C7EECF30062823A /* CommunityCategoryModel.swift in Sources */,
68B201A42CA5137B00F40C22 /* AmityUserPendingFollowRequestsPageViewModel.swift in Sources */,
A97A441B2C2D2D4D0017327D /* ImageProcessor.swift in Sources */,
923AA5682CB3B43D009C9357 /* RecordedStreamPlayerView.swift in Sources */,
A97A44202C2D2D4D0017327D /* ImageDataProcessor.swift in Sources */,
6877D39B2C7C3E6B008B3598 /* AmityCommunityPostPermissionPage.swift in Sources */,
A97A44172C2D2D4D0017327D /* GraphicsContext.swift in Sources */,
Expand Down Expand Up @@ -3606,7 +3605,7 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
68BDD17D2CC24ED8001B0D1E /* SharedFrameworks */ = {
9295F1E52CCB984F0048603A /* SharedFrameworks */ = {
isa = XCSwiftPackageProductDependency;
productName = SharedFrameworks;
};
Expand Down
3 changes: 3 additions & 0 deletions UpstraUIKit/AmityUIKit4/AmityUIKit4/AmityUIKit4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ final class AmityUIKitManagerInternal: NSObject {
// PendingPostContentComponent
let pendingPostContentComponentBehavior = AmityPendingPostContentComponentBehavior()
behavior.pendingPostContentComponentBehavior = pendingPostContentComponentBehavior

let livestreamBehavior = AmityLivestreamBehavior()
behavior.livestreamBehavior = livestreamBehavior
}

func registerDevice(_ userId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ open class AmityUIKitBehaviour {
public var userRelationshipPageBehavior: AmityUserRelationshipPageBehavior?
public var userPendingFollowRequestsPageBehavior: AmityUserPendingFollowRequestsPageBehavior?
public var blockedUsersPageBehavior: AmityBlockedUsersPageBehavior?
public var pendingPostContentComponentBehavior: AmityPendingPostContentComponentBehavior?
public var pendingPostContentComponentBehavior: AmityPendingPostContentComponentBehavior?
public var livestreamBehavior: AmityLivestreamBehavior?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// AmityLivestreamBehavior.swift
// AmityUIKit4
//
// Created by Manuchet Rungraksa on 22/10/2567 BE.
//

import AmitySDK
import SwiftUI

open class AmityLivestreamBehavior {

public init() {}

open func createRecordedPlayer(stream: AmityStream, client: AmityClient) -> any View {
print("To present recorded stream, please override \(AmityLivestreamBehavior.self).\(#function), see https://docs.amity.co for more details.")
return EmptyView()
}

open func createLivestreamPlayer(stream: AmityStream, client: AmityClient, isPlaying: Bool) -> any View {
print("To present live stream, please override \(AmityLivestreamBehavior.self).\(#function), see https://docs.amity.co for more details.")
return EmptyView()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import SwiftUI
import AmitySDK
import AVKit
import AmityVideoPlayerKit

struct PostContentLiveStreamView: View {
@EnvironmentObject private var host: AmitySwiftUIHostWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ public struct AmityLivestreamPlayerPage: AmityPageView {
if let livestream = post.liveStream {
if post.livestreamState == .recorded {

RecordedStreamPlayerView(livestream: livestream)
.ignoresSafeArea(.all)

if let view = AmityUIKitManagerInternal.shared.behavior.livestreamBehavior?.createRecordedPlayer(stream: livestream, client: AmityUIKit4Manager.client) {
AnyView(view)
.ignoresSafeArea(.all)
}
} else {
LivestreamVideoPlayerView(post: post)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ struct LivestreamVideoPlayerView: View {

}

AmityVideoPlayerView(stream: viewModel.stream, isConnected: networkMonitor.isConnected, isPlaying: $isPlaying)
.padding(.bottom, 70)
if let view = AmityUIKitManagerInternal.shared.behavior.livestreamBehavior?.createLivestreamPlayer(stream: stream, client: AmityUIKit4Manager.client, isPlaying: $isPlaying.wrappedValue && networkMonitor.isConnected) {
AnyView(view)
.padding(.bottom, 70)
}
}
}
} else if viewModel.isLoaded {
Expand Down

This file was deleted.

Loading

0 comments on commit 962175a

Please sign in to comment.