Post

Replies

Boosts

Views

Activity

Reply to AVPlayerViewController not displaying playback controls in iOS 18
@DTS Engineer the palyback controls are not showing if adding the AVPlayerViewController or SwiftUI VideoPlayer inside a TabView with .tabViewStyle(.page(indexDisplayMode: .never)) style TabView(selection: $currentIndex) { ForEach(0..<localFiles.count, id:\.self) { index in let url = localFiles[index] SOVideoPlayer(url: url) .clipped() } } .tabViewStyle(.page(indexDisplayMode: .never)) struct SOVideoPlayer: View { let url: URL @State private var play = false var body: some View { CustomVideoPlayer(play: $play, url: url) .overlay { Image(systemName: "play.fill") .foregroundStyle(.white) .background { Color.black.opacity(0.5) .frame(width: 54, height: 54) .clipShape(.circle) } .simultaneousGesture( TapGesture() .onEnded { play.toggle() } ) .opacity(play ? 0 : 1) } .onDisappear { play = false } } } extension SOVideoPlayer { fileprivate struct CustomVideoPlayer: UIViewControllerRepresentable { @Binding var play: Bool let url: URL func makeUIViewController(context: Context) -> AVPlayerViewController { let controller = AVPlayerViewController() let player = AVPlayer(url: url) controller.player = player controller.showsPlaybackControls = true return controller } func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) { if play { uiViewController.player?.play() } else { uiViewController.player?.pause() } } } }
Topic: Media Technologies SubTopic: Video Tags:
Oct ’24
Reply to Unable to add custom menu in PDFKit using "UIEditMenuInteraction"
Did you get any solution?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to iOS 17 AppIntent and requesting confirmation for widgets
Did you find any solution for this?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to How can widget be updated every half a second?
@dyyi Did you find out how we can refresh every second? I want to show a digital clock in widget.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to AVPlayerViewController not displaying playback controls in iOS 18
Facing the same issue. Did you find any solution @fandrade ?
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to AVPlayerViewController not displaying playback controls in iOS 18
@DTS Engineer the palyback controls are not showing if adding the AVPlayerViewController or SwiftUI VideoPlayer inside a TabView with .tabViewStyle(.page(indexDisplayMode: .never)) style TabView(selection: $currentIndex) { ForEach(0..<localFiles.count, id:\.self) { index in let url = localFiles[index] SOVideoPlayer(url: url) .clipped() } } .tabViewStyle(.page(indexDisplayMode: .never)) struct SOVideoPlayer: View { let url: URL @State private var play = false var body: some View { CustomVideoPlayer(play: $play, url: url) .overlay { Image(systemName: "play.fill") .foregroundStyle(.white) .background { Color.black.opacity(0.5) .frame(width: 54, height: 54) .clipShape(.circle) } .simultaneousGesture( TapGesture() .onEnded { play.toggle() } ) .opacity(play ? 0 : 1) } .onDisappear { play = false } } } extension SOVideoPlayer { fileprivate struct CustomVideoPlayer: UIViewControllerRepresentable { @Binding var play: Bool let url: URL func makeUIViewController(context: Context) -> AVPlayerViewController { let controller = AVPlayerViewController() let player = AVPlayer(url: url) controller.player = player controller.showsPlaybackControls = true return controller } func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) { if play { uiViewController.player?.play() } else { uiViewController.player?.pause() } } } }
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to How to customize UIActivityViewController
This screenshot is from Microsoft Teams app. Here they are filtering all other third party apps and only allowing few apps. This same behaviour I need to achieve.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’25