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
<?php | |
// Define Postmark API endpoint, token | |
$baseEndpoint = "https://api.postmarkapp.com/messages/outbound/opens"; | |
$serverToken = "YOUR_TOKEN"; // Replace with your actual server token | |
$headers = [ | |
"Accept: application/json", | |
"X-Postmark-Server-Token: $serverToken" | |
]; |
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
-(void)changeOrientation:(NSURL *) videoURL isClockWise:(BOOL)isClockWise fileName:(NSString *)fileName{ | |
AVURLAsset* videoAsset = [[AVURLAsset alloc]initWithURL:videoURL options:nil]; | |
AVMutableComposition* mixComposition = [[AVMutableComposition alloc] init]; | |
AVMutableCompositionTrack *videoCompositionTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; | |
[videoCompositionTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error:nil]; | |
AVMutableVideoCompositionInstruction *videoCompositionInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; | |
videoCompositionInstruction.timeRange = CMTimeRangeMake(kCMTimeZero, videoAsset.duration); | |
AVMutableVideoCompositionLayerInstruction *videoCompositionLayerInstruction = [AVMutableVideoCompositionLayerInstruction videoComposition |