This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am gonzo-oin on github. | |
* I am gonzooin (https://keybase.io/gonzooin) on keybase. | |
* I have a public key ASAIBVagUFeEuqNAiurEM8GZJpSAjQb9w7zw2Xrvjq-UWgo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let videoAsset = AVAsset(url: videoStreamURL) | |
var duration: CMTime! | |
if (CMTimeGetSeconds(audioAsset.duration) < CMTimeGetSeconds(videoAsset.duration)) { | |
duration = audioAsset.duration; | |
} else { | |
duration = videoAsset.duration; | |
} | |
var compo = AVMutableComposition() | |
let track = compo.addMutableTrack(withMediaType: .audio, preferredTrackID: kCMPersistentTrackID_Invalid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
protocol Duplicatable {} | |
extension Duplicatable where Self: Codable { | |
func duplicate() throws -> Self { | |
return try JSONDecoder().decode(Self.self, from: JSONEncoder().encode(self)) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIViewController.h | |
// UIKit | |
// | |
// Copyright (c) 2007-2013, Apple Inc. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKitDefines.h> | |
#import <UIKit/UIApplication.h> |