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
__weak FePreviewVideoViewController *weakSelf = self; | |
timeObserver = [_player addPeriodicTimeObserverForInterval:CMTimeMake(15, 1) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) | |
{ | |
typeof(self) strongSelf = weakSelf; | |
CGFloat currentTime = CMTimeGetSeconds(time); | |
if (currentTime >= 15) | |
{ | |
[strongSelf.player pause]; |
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) mergeAVAssetByArrAsset:(NSArray *) arrAsset | |
{ | |
AVMutableComposition * composition = [AVMutableComposition composition]; | |
for (AVAsset *asset in arrAsset) | |
{ | |
CMTimeRange timeRange = CMTimeRangeMake(kCMTimeZero, asset.duration); | |
[composition insertTimeRange:timeRange ofAsset:asset atTime:composition.duration error:nil]; | |
} |
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
NSString *customURL = @"facebook://"; | |
if ([[UIApplication sharedApplication] | |
canOpenURL:[NSURL URLWithString:customURL]]) | |
{ | |
// App fb có cài | |
return YES; | |
} | |
else | |
{ |
NewerOlder