Post

Replies

Boosts

Views

Created

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
1.4k
Feb ’22
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
1.3k
Feb ’22
How can I get very accurate time of a video interval?
let time1cmt = CMTimeGetSeconds(playerOK.currentTime()) time1 = Double(time1cmt) let time2cmt = CMTimeGetSeconds(playerOK.currentTime()) time2 = Double(time2cmt) videoDif = (time2 - time1) Now I'm using .currentTime() to get the start point and end point, but they don't seem to be accurate, is there any other way to get the time more accurately?
0
0
836
Mar ’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!
Replies
2
Boosts
0
Views
1.4k
Activity
Feb ’22
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
Replies
1
Boosts
0
Views
1.3k
Activity
Feb ’22
How to solve the error: Type '()' cannot conform to 'View' when the problem is inside "if"
Some code is not allowed to be inside an if. For example how can I call a func inside an if?
Replies
5
Boosts
0
Views
5.5k
Activity
Feb ’22
How to get the FPS of a video?
I am playing a video with AVPlayer, how can I get the float value of the FPS of the video? I readed it's possible with AVAssetTrack but I don't know how to implement it. On Swift/SwiftUI Thanks!
Replies
1
Boosts
0
Views
2.3k
Activity
Feb ’22
How create Log Events with Swift?
How can I create Log Events to the console to diagnose issues?
Replies
2
Boosts
0
Views
1.3k
Activity
Feb ’22
How to declare and initialize a variable type .headline?
How can I declare a variable to change the font? The compiler indicates that it must be type CGFont. so: var typeFont: CGFont //but I don't know how to initialize How is the correct way to give an initial value? Thanks
Replies
1
Boosts
0
Views
1.2k
Activity
Mar ’22
How can I get very accurate time of a video interval?
let time1cmt = CMTimeGetSeconds(playerOK.currentTime()) time1 = Double(time1cmt) let time2cmt = CMTimeGetSeconds(playerOK.currentTime()) time2 = Double(time2cmt) videoDif = (time2 - time1) Now I'm using .currentTime() to get the start point and end point, but they don't seem to be accurate, is there any other way to get the time more accurately?
Replies
0
Boosts
0
Views
836
Activity
Mar ’22
Width and height of a video?
How can I know the width and height of a video? For example, the video is playing and the screen is rotated.
Replies
0
Boosts
0
Views
805
Activity
Mar ’22
In SwiftUI, How to increase Font Size/Style of a Picker?
Is there a way to change the Font Size or Style inside a Picker?? In SwiftUI. Thanks
Replies
2
Boosts
0
Views
4.8k
Activity
Mar ’22
Apple, why is it not possible to program applications on the Ipad?
Why is it possible to create more things on a computer with windows 3.11 and a 485 processor than on an Ipad with 1000 times more power? Do you understand why most people still "love" Windows???
Replies
1
Boosts
0
Views
858
Activity
May ’22