Group Activities

RSS for tag

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

Posts under Group Activities tag

75 Posts

Post

Replies

Boosts

Views

Activity

Anyone got SharePlay (Group Activities) to work on Safari?
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-ass how-to guide & demo for the community if we figure it out! 😅🙌 Kind regards, -thijsl
4
1
2.4k
Aug ’22
Shareplay with live streams: HLS manifest requirements?
We're working on enabling Shareplay for our video streaming product, but there's some confusion on what Shareplay/Group Activities actually uses to sync viewing experiences across the group, especially for a live stream. If group members are viewing different HLS variants, the file names of the segments won't be the same (they will probably be very similar, but that isn't guaranteed). So the most likely thing in the HLS manifest for synchronizing is the EXT-X-PROGRAM-DATE-TIME. The problem is that we do session personalization with ads, which makes the EXT-X-PROGRAM-DATE-TIME also get personalized. In order for Group Activities to keep members in sync, do the EXT-X-PROGRAM-DATE-TIME values need to always be consistent for content segments ("content" meaning not-ad-breaks)? If not, can anyone help us understand how it keeps members in sync?
1
0
1k
Jul ’22
Send unreliable messages in group activities
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
0
0
1k
Jun ’22
How to make a custom AVPlayer support SharePlay adjust coordinate or play-pause control
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 :-)
1
1
2.6k
Jun ’22
How to know if a FaceTime call is active?
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).
1
0
2.2k
Jun ’22
iOS FaceTime UI - Option to move the bar that shows after tapping to bottom of screen?
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?
3
3
3.8k
Apr ’22
How to correctly request foreground presentation when using GroupActivity?
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
0
0
1.2k
Jan ’22
Get name of sender of a message in group session
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
1
0
1.5k
Dec ’21
Group Session active participants not working
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)
0
0
773
Dec ’21
Custom UI integrating Facetime Video?
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?
0
0
1k
Nov ’21
Anyone got SharePlay (Group Activities) to work on Safari?
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-ass how-to guide & demo for the community if we figure it out! 😅🙌 Kind regards, -thijsl
Replies
4
Boosts
1
Views
2.4k
Activity
Aug ’22
Shareplay with live streams: HLS manifest requirements?
We're working on enabling Shareplay for our video streaming product, but there's some confusion on what Shareplay/Group Activities actually uses to sync viewing experiences across the group, especially for a live stream. If group members are viewing different HLS variants, the file names of the segments won't be the same (they will probably be very similar, but that isn't guaranteed). So the most likely thing in the HLS manifest for synchronizing is the EXT-X-PROGRAM-DATE-TIME. The problem is that we do session personalization with ads, which makes the EXT-X-PROGRAM-DATE-TIME also get personalized. In order for Group Activities to keep members in sync, do the EXT-X-PROGRAM-DATE-TIME values need to always be consistent for content segments ("content" meaning not-ad-breaks)? If not, can anyone help us understand how it keeps members in sync?
Replies
1
Boosts
0
Views
1k
Activity
Jul ’22
Send unreliable messages in group activities
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
Replies
0
Boosts
0
Views
1k
Activity
Jun ’22
How to make a custom AVPlayer support SharePlay adjust coordinate or play-pause control
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 :-)
Replies
1
Boosts
1
Views
2.6k
Activity
Jun ’22
How to know if a FaceTime call is active?
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).
Replies
1
Boosts
0
Views
2.2k
Activity
Jun ’22
iOS FaceTime UI - Option to move the bar that shows after tapping to bottom of screen?
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?
Replies
3
Boosts
3
Views
3.8k
Activity
Apr ’22
Unsupported Activity popup on tvOS
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?
Replies
3
Boosts
0
Views
1.4k
Activity
Mar ’22
How to correctly request foreground presentation when using GroupActivity?
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
Replies
0
Boosts
0
Views
1.2k
Activity
Jan ’22
Get name of sender of a message in group session
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
Replies
1
Boosts
0
Views
1.5k
Activity
Dec ’21
Group Session active participants not working
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)
Replies
0
Boosts
0
Views
773
Activity
Dec ’21
Custom UI integrating Facetime Video?
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?
Replies
0
Boosts
0
Views
1k
Activity
Nov ’21