Post

Replies

Boosts

Views

Activity

How implement the custom buttons of the AVplayer? from a struct
Im using more easily to create a pick up and play a video, and that part works, and to show the video I use this line: PhotoPickerResultView(result: photoPickerService.results[0]) and this part work fine to, arrives from this: struct PhotoPickerResultView: View {       var result: PHPickerResult       enum MediaType {     case loading, error, video   }       @State private var loaded = false   @State private var url: URL?   @State private var mediaType: MediaType = .loading   @State private var latestErrorDescription = ""       var body: some View {           Group {       switch mediaType {       case .loading:         ProgressView()       case .error:         VStack {           Image(systemName: "exclamationmark.triangle.fill")           Text(latestErrorDescription).font(.caption)         }         .foregroundColor(.gray)       case .video:         if url != nil {                                 VideoPlayer(player: AVPlayer(url: url!))          ... ..... My question is, How can I use or implement the custom buttons of the AVPlayer? like: @State private var player1 = AVPlayer(url: URL(string: "https...mp4")!)          VideoPlayer(player: player1)                   Button {           player1.play()         } label: {           Text(" PLAY ")         }         Button {           player1.pause()         } label: {           Text(" PAUSE ")         } from this line: PhotoPickerResultView(result: photoPickerService.results[0]) ??? or what do I have to change to use more easily that custom buttons of the AVPlayer?? Thanks
1
0
1k
Feb ’22
Where can I get example code from Apple Engineers?
For example, when Apple Engineers design something new like PHPickerViewController, I imagine that they test all the functionalities and to test all these functions, they create applications. Where can I download the code of those applications? I mean, code that is already tested and works from Apple Engineers. I'm sure they have tons of tested code, which would be very useful for us. Thanks!
2
0
998
Feb ’22