Post

Replies

Boosts

Views

Activity

How to get animation interpolation during animation?
I want to get animation interpolation during animation running. just like code below: Animator(begin:100,end:200).addListener({value in //here will be called when animation updates. print(value) }) But I can't find any API like the code above in iOS SDK.And I don't want to use any UIView or CALayer to get presentationLayer to get this value. So How can I do that?🤔🤔🤔
2
0
1.3k
Oct ’21
How to put the midi and recorded audio file into a single player?
The GarageBand app can import both midi and recorded audio file into a single player to play. Just like this: My App have the same feature but I don't know how to implement it. I have tried the AVAudioSequencer,but it only can load and play MIDI file. I have tried the AVPlayer and AVPlayerItem,but it seems that it can't load the MIDI file. So How to combine MIDI file and audio file into a single AVPlayerItem or anything else to play?
0
0
1.2k
Feb ’22
How to change the AVMutableVideoCompositionLayerInstruction 's transform anchor point to center?
What I want is to make video 's rotation be from 0 to 90 degree in 0 ~ 2s. Here is the code: let layerIns = AVMutableVideoCompositionLayerInstruction(assetTrack: track) let endTransform = CGAffineTransform(rotationAngle: CGFloat(Double.pi / 2)) let timeRange = CMTimeRange(start: .zero, duration: CMTime(seconds: 2, preferredTimescale: 600)) layerIns.setTransformRamp(fromStart: .identity, toEnd: endTransform, timeRange: timeRange) But the center of rotation is top-left corner.. Which makes rotation effect look strange. I wonder how to change the video layer's anchor point to center point instead of top-left corner... related question on StackOverFlow :Question Link - https://stackoverflow.com/questions/65575655/how-to-change-the-settransformramp-s-transform-anchor-point
1
0
933
Jan ’21