Skip to content

Instantly share code, notes, and snippets.

View NghiaTranUIT's full-sized avatar
💭
Workaholic 👨‍💻

Noah Tran NghiaTranUIT

💭
Workaholic 👨‍💻
View GitHub Profile
@NghiaTranUIT
NghiaTranUIT / gist:6aaac1fe9fd52600507a
Last active August 29, 2015 14:10
Pause video at 15th second
__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];
- (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];
}
NSString *customURL = @"facebook://";
if ([[UIApplication sharedApplication]
canOpenURL:[NSURL URLWithString:customURL]])
{
// App fb có cài
return YES;
}
else
{