All Projects → g763007297 → GQImageVideoViewer

g763007297 / GQImageVideoViewer

Licence: GPL-2.0 license
仿微信多图片及视频浏览器,图片和视频原尺寸显示,不会变形,双击图片放大缩小,单击消失,支持多张本地和网络图片以及网络视频混合查看,支持链式调用

Programming Languages

objective c
16641 projects - #2 most used programming language
c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to GQImageVideoViewer

Modernavplayer
ModernAVPlayer is a persistence AVPlayer wrapper
Stars: ✭ 179 (+214.04%)
Mutual labels:  pod, avplayer
kubernetes-basico
Demonstração dos componentes do Kubernetes
Stars: ✭ 26 (-54.39%)
Mutual labels:  pod
FFDB
ORM database,is build on top of FMDB
Stars: ✭ 18 (-68.42%)
Mutual labels:  pod
PagedLists
Paginated UITableView and UICollectionViews for iOS.
Stars: ✭ 69 (+21.05%)
Mutual labels:  pod
AVPlayer-SwiftUI
Using AVPlayer in SwiftUI
Stars: ✭ 204 (+257.89%)
Mutual labels:  avplayer
MBVideoPlayer
feed流在线播放器。仿抖音交互效果,支持边下边播以及离线播放功能。
Stars: ✭ 20 (-64.91%)
Mutual labels:  avplayer
backblaze
Backblaze.Agent is a high-performance .NET Core implementation of the Backblaze B2 Cloud Storage API.
Stars: ✭ 32 (-43.86%)
Mutual labels:  pod
QuickWebKit
A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。
Stars: ✭ 29 (-49.12%)
Mutual labels:  pod
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (+184.21%)
Mutual labels:  pod
MLLineChart
A simple Line Chart Lib
Stars: ✭ 28 (-50.88%)
Mutual labels:  pod
iOSUtilitiesSource
IOS Utilities Library for Swift
Stars: ✭ 46 (-19.3%)
Mutual labels:  pod
frakti
The hypervisor-based container runtime for Kubernetes.
Stars: ✭ 669 (+1073.68%)
Mutual labels:  pod
AVPlayerItemHomeOutput
Coordinate the output of content associated with your HomeKit lightbulbs. #Ambilight
Stars: ✭ 38 (-33.33%)
Mutual labels:  avplayer
AFWebViewController
In-app browser that uses WKWebView
Stars: ✭ 38 (-33.33%)
Mutual labels:  pod
flutter playout
AV Playout in Flutter
Stars: ✭ 129 (+126.32%)
Mutual labels:  avplayer
kubervisor
The Kubervisor allow you to control which pods should receive traffic or not based on anomaly detection.It is a new kind of health check system.
Stars: ✭ 35 (-38.6%)
Mutual labels:  pod
podhd
PODHD Preset Tool -- Modify And Convert Line6 POD HD Presets, Setlists And Bundles.
Stars: ✭ 37 (-35.09%)
Mutual labels:  pod
GoogleDriveBrowser
Goole Drive Download Library for iOS
Stars: ✭ 13 (-77.19%)
Mutual labels:  pod
kubernetes-scheduling-examples
Walk-through guide of advanced scheduling concepts in Kubernetes
Stars: ✭ 38 (-33.33%)
Mutual labels:  pod
simplenetes
The sns tool is used to manage the full life cycle of your Simplenetes clusters. It integrates with the Simplenetes Podcompiler project podc to compile pods.
Stars: ✭ 731 (+1182.46%)
Mutual labels:  pod

License MIT    support 

GQImageVideoViewer

一款仿微信多图片及视频浏览器,图片和视频原尺寸显示,不会变形,双击图片放大缩小,单击消失,支持多张本地和网络图片以及网络视频混合查看,支持链式调用。不需要跳转到新的viewcontroller,就可以覆盖当前控制器显示。

Overview

Demo Overview

##CocoaPods

1.在 Podfile 中添加 pod 'GQImageVideoViewer'。 2.执行 pod install 或 pod update。 3.导入 GQImageVideoViewer.h。

Basic usage

1.将GQImageVideoViewer文件夹加入到工程中。如果你的工程中有SDWebImage就不需要再添加,如果没有则需要将SDWebImage加入。

2.在需要使用的图片查看器的控制器中#import "GQImageVideoViewer.h"。

3.在需要触发查看器的地方添加以下代码:

注: < 1 >图片数组中可以放单独的NSString,NSUrl,UIImage,UIImageView,如果是单独放这些类型,则默认为是图片类型。

< 2 >如果需要放视频链接,则需要放字典或者GQBaseImageVideoModel类型,数组的key为以下两个:

(1).GQURLString(链接地址,支持类型为NSUrl和NSString)

(2).GQIsImageURL(是否为图片,如果是图片地址就传YES,如果是视频地址就传NO)。

< 3 >如果需要自定义图片和视频显示画面,则需要分别继承基类: (分别在两个覆盖的方法中写需要自定义的样式。)

(1).自定义图片显示view: 继承 GQBaseImageView 类,然后在子类中覆盖方法: - (void)configureImageView;

(2).自定义视频显示view: 继承 GQBaseVideoView 类,然后在子类中覆盖方法: - (void)configureVideoView;

NSMutableArray *imageArray = [[NSMutableArray alloc] initWithCapacity:0];

NSURL *url = [NSURL URLWithString:@"http://static.tripbe.com/videofiles/20121214/9533522808.f4v.mp4"];

[imageArray addObjectsFromArray:@[@{GQIsImageURL:@(NO),
                                        GQURLString:url},
                                      @{GQIsImageURL:@(NO),
                                        GQURLString:[NSURL URLWithString:@"http://192.168.31.152:8080/abc.mp4"]},
                                      @{GQIsImageURL:@(NO),
                                        GQURLString:url},
                                      @{GQIsImageURL:@(YES),
                                        GQURLString:@"http://cdn.cocimg.com/bbs/attachment/upload/30/5811301473150224.gif"},
                                      @{GQIsImageURL:@(YES),
                                        GQURLString:@"http://img0.imgtn.bdimg.com/it/u=513437991,1334115219&fm=206&gp=0.jpg"},
                                      @{GQIsImageURL:@(YES),
                                        GQURLString:@"http://h.hiphotos.baidu.com/image/pic/item/203fb80e7bec54e7f14e9ce2bf389b504ec26aa8.jpg"},
                                      @{GQIsImageURL:@(YES),
                                        GQURLString:@"http://f.hiphotos.baidu.com/image/pic/item/a8014c086e061d9507500dd67ff40ad163d9cacd.jpg"},
                                      @{GQIsImageURL:@(YES)]];


//基本调用
[[GQImageVideoViewer sharedInstance] setImageArray:imageArray];//这是图片和视频数组
[GQImageVideoViewer sharedInstance].usePageControl = YES;//设置是否使用pageControl
[GQImageVideoViewer sharedInstance].selectIndex = 5;//设置选中的图片索引
[GQImageVideoViewer sharedInstance].achieveSelectIndex = ^(NSInteger selectIndex){
    NSLog(@"%ld",selectIndex);
};//获取当前选中的图片索引
[GQImageVideoViewer sharedInstance].laucnDirection = GQLaunchDirectionRight;//设置推出方向
[[GQImageVideoViewer sharedInstance] showInView:self.navigationController.view];//显示GQImageViewer到指定view上

//链式调用
[GQImageVideoViewer sharedInstance]
.imageArrayChain(imageArray)
.usePageControlChain(NO)
.selectIndexChain(6)
.achieveSelectIndexChain(^(NSInteger selectIndex){
    NSLog(@"%ld",selectIndex);
})
.launchDirectionChain(GQLaunchDirectionRight)
.showViewChain(self.navigationController.view);

特别说明,如果是拉取网络图片的话,在iOS9以上的系统需要添加plist字段,否则无法拉取图片:

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

Level history

(1) 0.0.1

github添加代码

(2) 0.0.2

添加model,传图片和视频数组更加方便。

(3) 0.0.3

将tableView替换成collectionView,完美适配屏幕旋转,修复滑动不播放的bug。

(4) 0.0.4

添加自定义图片展示和视频展示功能

(5) wait a moment

##Support

欢迎指出bug或者需要改善的地方,欢迎提出issues、加Q群交流iOS经验:578841619 , 我会及时的做出回应,觉得好用的话不妨给个star吧,你的每个star是我持续维护的强大动力。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].