Group Activities

RSS for tag

Integrate your app into FaceTime to share its contents with groups of people.

Group Activities Documentation

Posts under Group Activities tag

39 Posts
Sort by:
Post not yet marked as solved
0 Replies
106 Views
Hello Has anyone tried to send unreliable messages in first beta? I have a bad access crash every time I try: (lldb) thread backtrace * thread #28, queue = 'com.apple.root.user-initiated-qos.cooperative', stop reason = EXC_BAD_ACCESS (code=1, address=0x22)   * frame #0: 0x00000001033aa3b4 libdispatch.dylib`_dispatch_root_queue_drain + 208     frame #1: 0x00000001033aae6c libdispatch.dylib`_dispatch_worker_thread2 + 196     frame #2: 0x00000001f9b8d06c libsystem_pthread.dylib`_pthread_wqthread + 228 I don't know if I do something wrong or if someone else experiences the same issue. Thanks, Gil
Posted
by
Gil
Post not yet marked as solved
1 Replies
190 Views
This app was written using SwiftUI and I also consulted Apple's official documentation and some third-party websites. So I wrote something like the following code This is the Swift code where the player is called and the SharePlay-related logic import SwiftUI import AVFoundation import AVKit import GroupActivities import Combine struct EpisodeDetail: View { @State var episode: CommonResponse<Episode> @State var videoPlayer: CustomVideoPlayer @State private var groupSession: GroupSession<EpisodeActivity>? @State private var subscriptions = Set<AnyCancellable>() var body: some View { VStack { videoPlayer .transition(.move(edge: .bottom)) .edgesIgnoringSafeArea(.all) ScrollView { VStack(alignment: .center) { Button { prepareToPlay(episode.attributes) } label: { Label("SharePlay", systemImage: "shareplay") } .buttonStyle(.bordered) .cornerRadius(20) } VStack(alignment: .leading, spacing: 20) { Text(episode.attributes.title) .font(.title2) .fontWeight(.bold) Text(episode.attributes.description) .font(.body) .foregroundColor(.gray) } } .padding(12) } .task { for await session in EpisodeActivity.sessions() { configureGroupSession(session) } } } private func configureGroupSession(_ session: GroupSession<EpisodeActivity>) { groupSession = session videoPlayer.player.playbackCoordinator.coordinateWithSession(session) session.$state .sink { state in if case .invalidated = state { groupSession = nil subscriptions.removeAll() } } .store(in: &subscriptions) session.$activity .sink { activity in print("Activity Changed: \(activity.metadata.title ?? "No title for this ****** video LOL")") } .store(in: &subscriptions) session.join() } private func prepareToPlay(_ playerEpisodeData: Episode) { let activity = EpisodeActivity(episode: playerEpisodeData) Task { switch await activity.prepareForActivation() { case .activationDisabled: videoPlayer.player.replaceCurrentItem(with: AVPlayerItem(url: playerEpisodeData.videoUrl)) break case .activationPreferred: videoPlayer.player.replaceCurrentItem(with: AVPlayerItem(url: playerEpisodeData.videoUrl)) _ = try await activity.activate() case .cancelled: break @unknown default: break } } } } Then the following code is a custom AVPlayer import SwiftUI import AVFoundation import AVKit struct CustomVideoPlayer: UIViewControllerRepresentable { @State var videoUrl: URL var player: AVPlayer { return AVPlayer(url: videoUrl) } func updateUIViewController(_ playerController: AVPlayerViewController, context: Context) { playerController.modalPresentationStyle = .fullScreen playerController.allowsPictureInPicturePlayback = true playerController.canStartPictureInPictureAutomaticallyFromInline = true playerController.player = player } func makeUIViewController(context: Context) -> AVPlayerViewController { return AVPlayerViewController() } } The SharePlay prompt pops up properly and shows the current activity correctly This is a screenshot of the SharePlay pop-up box, I couldn't insert an image, so I had to insert a link https://i.stack.imgur.com/QNqBE.jpg But when I do something with the player, like pause, or adjust the playback progress, the other iPhone doesn't sync So what should I do? Can't thank you enough :-)
Posted
by
Post not yet marked as solved
1 Replies
168 Views
The GroupSession API doesn't seem to expose any method for determining whether there is active FaceTime call. Any suggestions on how one might check this? (I can't use groupSession.activeParticipants, as this data is only available once a SharePlay session has started. I need to know the existence of a FaceTime call prior to the user starting a SharePlay session).
Posted
by
Post not yet marked as solved
3 Replies
502 Views
Hi everyone, I am not able to get Group Activities (SharePlay/mediaSession.coordinator) to work on Safari. Here's my setup: macOS Monterey 12.3 Beta, Safari 15.4, Intel. https://github.com/tokorom/SharePlaySample as the iOS project. (I also experimented with setting metadata.type = .watchTogether.) I set https://theoplayershareplay.thijslowette.repl.co as the fallbackURL. (Code available at https://replit.com/@THIJSLOWETTE/THEOplayerSharePlay.) What am I doing & seeing? I Facetime myself from an iOS 15.2.1 as the "initializer" to my macOS through the Desktop Facetime app. I open the app on my iOS device. I start the SharePlay activity. I can see the "popup" on my macOS device. I click open, and it opens up my fallback URL in Safari. (I had to set Safari as my default browser.) I can see (in the Safari dev tools) that my Safari has joined the session. In Safari, I click the custom play button at the top which should call coordinator.play(). Nothing happens on my iOS app. I pause the video again in Safari. I hit play in my iOS app. Nothing happens in Safari. You can verify these observations in the screen recording at https://www.loom.com/share/809062d87af244b1bda96d30bd08518e. Notes Also tried different SharePlay projects. Also tried Facetiming other people's macOS to ensure that the session is between two unique Facetime IDs. Also tried the macOS 12.2 Stable. Although I'm running out of ideas, I am not yet ready to give up. Can someone assist? I promise I'll write a kick-*** how-to guide & demo for the community if we figure it out! 😅🙌 Kind regards, -thijsl
Posted
by
Post not yet marked as solved
0 Replies
346 Views
Details I'm working on a video streaming app, and we've implemented GroupActivity for SharePlay. The app doesn't support PiP. Based on the documentation we found, we can use the function requestForegroundPresentation described here. I was trying to call this function when the GroupSession is in waiting and joined states, but nothing happens on the user's device. There is no banner to explain anything The WWDC videos doesn't show an example, they just mention this feature, and it's unclear how it should work. Tried the api in the sample project supporting_coordinated_media_playback, and same result
Posted
by
Post not yet marked as solved
0 Replies
320 Views
I am using SharePlay and the Group Activities framework in my app and my usecase requires the number of participants, so I am trying to get it like this: _ = SharePlayManager.sharedInstance.groupSession?.$activeParticipants.sink(receiveValue: { participants in             print(participants.count)         }) But this always prints 0, am I doing something wrong? (groupSession is 100% not nil)
Posted
by
Post not yet marked as solved
1 Replies
651 Views
I'm working on Group Activities for our video app. When I start a video from Apple TV, it's fine to sync it with other user's iPhone device. but inverse case, it's not working. And in some cases, I saw "Unsupported Activity : The active SharePlay activity is not supported on this Apple TV" What did I miss or wrong something?
Posted
by
Post not yet marked as solved
0 Replies
355 Views
I want to make a custom UI that integrates each video feed from my FaceTime group activity participants. I found the app Share+ in the App Store integrates the video from each FaceTime participant into it's own UI, so I know it's possible. Can anyone point me to the relevant documentation that shows me how I can get to the video of each FaceTime group member to put in my own AVSampleBufferDisplayLayer or otherwise?
Posted
by
Post marked as solved
1 Replies
586 Views
Hello, I'm developing with Group Activities, my app builds and run successfully on Debug. But when I switch to Release, I get many errors: SharePlay.swift:21:19: Cannot find type 'GroupActivityMetadata' in scope SharePlay.swift:12:30: Cannot find type 'GroupActivity' in scope SharePlay.swift:55:30: Cannot find 'GroupStateObserver' in scope SharePlay.swift:78:23: Cannot find type 'GroupSession' in scope SharePlay.swift:79:20: Cannot find type 'GroupSessionMessenger' in scope SharePlay.swift:98:31: Cannot find type 'GroupSession' in scope SharePlay.swift:22:24: Cannot find 'GroupActivityMetadata' in scope SharePlay.swift:24:26: Cannot infer contextual base in reference to member 'generic' SharePlay.swift:64:55: Type 'GenericGroupActivity' has no member 'sessions' SharePlay.swift:82:29: 'nil' requires a contextual type SharePlay.swift:83:26: 'nil' requires a contextual type SharePlay.swift:89:31: Type of expression is ambiguous without more context SharePlay.swift:101:25: Cannot find 'GroupSessionMessenger' in scope SharePlay.swift:103:45: Unable to infer type of a closure parameter 'state' in the current context SharePlay.swift:110:49: Unable to infer type of a closure parameter 'activity' in the current context SharePlay.swift:115:49: Tuple pattern cannot match values of non-tuple type '_' SharePlay.swift:138:31: Type of expression is ambiguous without more context SharePlay.swift:143:59: Value of type 'GenericGroupActivity' has no member 'prepareForActivation' SharePlay.swift:144:40: Value of type 'GenericGroupActivity' has no member 'activate' SharePlay.swift:148:32: Value of type 'GenericGroupActivity' has no member 'activate' SharePlay.swift:152:31: Type of expression is ambiguous without more context SharePlay.swift:158:28: Type of expression is ambiguous without more context SharePlay.swift:164:31: Type of expression is ambiguous without more context SharePlay.swift:170:31: Type of expression is ambiguous without more context It looks like the compiler in Release doesn't find the GroupActivity framework... XCode 13.1 swift-driver version: 1.26.9 Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6) Target: x86_64-apple-macosx11.0 The code that triggers these errors can be found here. I could reproduce this with the example project Did you encounter this problem? Thanks
Posted
by
Post not yet marked as solved
0 Replies
322 Views
I have the SharePlay button on my FaceTime but it is grey and does nothing when I click on it.
Posted
by
Post not yet marked as solved
1 Replies
399 Views
As the title asks, is it possible to support SharePlay using the applicationQueuePlayer in the Media Player framework? It seems not to be possible since there is no AVPlaybackCoordinator available like there is for AVPlayer. Is that correct? It would be nice to be able to support this in my application if possible. Thanks!
Posted
by
Post not yet marked as solved
1 Replies
518 Views
Hi there, when awaiting a message through an GroupSessionMessenger, I can get the Participant who sent the message through the context.source. But is there any way to get the actual name of that Participant? I haven't seen any way - but I guess it would have to go through the Contacts API? The reason I need this is because of the VoiceOver support in my app. If a Participant triggers an interaction, I would like to announce who triggered the interaction instead of just announcing "Someone did XY". Best, Klemens
Posted
by
Post not yet marked as solved
1 Replies
2.1k Views
Since iOS 15, the UI for FaceTime has been moved to the upper half of the screen. I find this choice strange considering they did the exact opposite for Safari in this exact update. (Moved it from the top to the bottom.) Are there any options or is there any way to revert the changes made to that specific thing within FaceTime?
Posted
by
Post not yet marked as solved
0 Replies
257 Views
While working on an app that uses a custom player based on AVFoundation, ie not based on AVPlayerViewController, I was unable to get picture-in-picture to start while the app was in the background with Group Activities. It turns out we were initiating and configuring our AVPictureInPictureController after coordinating our GroupSession with the players AVPlayerPlaybackCoordinator. Once we setup the picture-in-picture controller first, then coordinated the group session, background picture-in-picture started working. Hope this helps others in the same situation.
Posted
by