We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(void)showBrowserWithIndex:(NSInteger)index { NSMutableArray *photos = [NSMutableArray new]; [self.dataSource enumerateObjectsUsingBlock:^(GKTimeLineModel *model, NSUInteger idx, BOOL * _Nonnull stop) { GKChatViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:0]]; GKTimeLineImage *img = model.images.firstObject;
GKPhoto *photo = [GKPhoto new]; photo.url = [NSURL URLWithString:img.url]; photo.sourceImageView = cell.imgView; if (img.isVideo) { photo.videoUrl = [NSURL URLWithString:img.video_url]; photo.autoPlay = NO; } // 首次点击的是视频,自动播放 if (img.isVideo && index == idx) { photo.isVideoClicked = YES; } [photos addObject:photo];
}];
GKPhotoBrowser *browser = [GKPhotoBrowser photoBrowserWithPhotos:photos currentIndex:index]; browser.showStyle = GKPhotoBrowserShowStyleZoom; browser.hideStyle = GKPhotoBrowserHideStyleZoomScale; browser.hidesPageControl = YES; browser.hidesSavedBtn = YES; browser.hidesCountLabel = YES; browser.delegate = self; browser.isSingleTapDisabled = YES; browser.isVideoPausedWhenDragged = NO; [browser setupVideoProgressProtocol:[GKVideoProgressView new]]; browser.isVideoReplay = NO; [browser showFromVC:self]; }
#pragma mark - GKPhotoBrowserDelegate
The text was updated successfully, but these errors were encountered:
No branches or pull requests
(void)showBrowserWithIndex:(NSInteger)index {
NSMutableArray *photos = [NSMutableArray new];
[self.dataSource enumerateObjectsUsingBlock:^(GKTimeLineModel *model, NSUInteger idx, BOOL * _Nonnull stop) {
GKChatViewCell *cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:idx inSection:0]];
GKTimeLineImage *img = model.images.firstObject;
}];
GKPhotoBrowser *browser = [GKPhotoBrowser photoBrowserWithPhotos:photos currentIndex:index];
browser.showStyle = GKPhotoBrowserShowStyleZoom;
browser.hideStyle = GKPhotoBrowserHideStyleZoomScale;
browser.hidesPageControl = YES;
browser.hidesSavedBtn = YES;
browser.hidesCountLabel = YES;
browser.delegate = self;
browser.isSingleTapDisabled = YES;
browser.isVideoPausedWhenDragged = NO;
[browser setupVideoProgressProtocol:[GKVideoProgressView new]];
browser.isVideoReplay = NO;
[browser showFromVC:self];
}
#pragma mark - GKPhotoBrowserDelegate
GKPhoto *photo = browser.curPhoto;
if (photo.isVideo) {
browser.progressView.hidden = !browser.progressView.isHidden;
}else {
[browser dismiss];
}
}
The text was updated successfully, but these errors were encountered: