├── README.md
├── JZVideoDemo
├── Resource
│ └── video
│ │ ├── back@2x.png
│ │ ├── zoomin.png
│ │ ├── zoomin1.png
│ │ ├── zoomout.png
│ │ ├── zoomout1.png
│ │ ├── zoomout2.png
│ │ ├── zoomin@2x.png
│ │ ├── zoomout@2x.png
│ │ ├── bg_rss_head.png
│ │ ├── point_normal.png
│ │ ├── full_pause_icon.png
│ │ ├── full_play_icon.png
│ │ ├── point_selected.png
│ │ └── account_cache_isplay@2x.png
├── ViewController.h
├── VedioDetailViewController.h
├── main.m
├── AppDelegate.h
├── PrefixHeader.pch
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── ViewController.m
├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.xib
├── video
│ ├── JZVideoPlayerView.h
│ └── JZVideoPlayerView.m
├── AppDelegate.m
└── VedioDetailViewController.m
├── JZVideoDemo.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── jinzelu.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── JZVideoDemo.xccheckout
├── xcuserdata
│ └── jinzelu.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── JZVideoDemo.xcscheme
└── project.pbxproj
└── JZVideoDemoTests
├── Info.plist
└── JZVideoDemoTests.m
/README.md:
--------------------------------------------------------------------------------
1 | # JZVideoDemo
2 | 视频播放器
3 |
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/back@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/back@2x.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomin.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomin1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomin1.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomout.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomout1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomout1.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomout2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomout2.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomin@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomin@2x.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/zoomout@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/zoomout@2x.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/bg_rss_head.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/bg_rss_head.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/point_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/point_normal.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/full_pause_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/full_pause_icon.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/full_play_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/full_play_icon.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/point_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/point_selected.png
--------------------------------------------------------------------------------
/JZVideoDemo/Resource/video/account_cache_isplay@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo/Resource/video/account_cache_isplay@2x.png
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/project.xcworkspace/xcuserdata/jinzelu.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lookingstars/JZVideoDemo/HEAD/JZVideoDemo.xcodeproj/project.xcworkspace/xcuserdata/jinzelu.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/JZVideoDemo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/JZVideoDemo/VedioDetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // VedioDetailViewController.h
3 | // aoyouHH
4 | //
5 | // Created by jinzelu on 15/5/20.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface VedioDetailViewController : UIViewController
12 |
13 | @property(nonatomic, strong) NSString *FileUrl;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/JZVideoDemo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/JZVideoDemo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @property(nonatomic, assign) BOOL isFullScreen;
16 |
17 | @end
18 |
19 |
--------------------------------------------------------------------------------
/JZVideoDemo/PrefixHeader.pch:
--------------------------------------------------------------------------------
1 | //
2 | // PrefixHeader.pch
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/3.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #ifndef JZVideoDemo_PrefixHeader_pch
10 | #define JZVideoDemo_PrefixHeader_pch
11 |
12 | // Include any system framework and library headers here that should be included in all compilation units.
13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
14 |
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/xcuserdata/jinzelu.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | JZVideoDemo.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | E362382E1B1D590500570A4C
16 |
17 | primary
18 |
19 |
20 | E36238471B1D590500570A4C
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/JZVideoDemo/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/JZVideoDemoTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.LJZ.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/JZVideoDemoTests/JZVideoDemoTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // JZVideoDemoTests.m
3 | // JZVideoDemoTests
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface JZVideoDemoTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation JZVideoDemoTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/JZVideoDemo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.LJZ.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeRight
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/JZVideoDemo/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "VedioDetailViewController.h"
11 |
12 | @interface ViewController ()
13 | {
14 | UIButton *_playBtn;
15 | }
16 |
17 | @end
18 |
19 | @implementation ViewController
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 | // Do any additional setup after loading the view, typically from a nib.
24 | self.view.backgroundColor = [UIColor whiteColor];
25 | [self initViews];
26 | }
27 |
28 | - (void)didReceiveMemoryWarning {
29 | [super didReceiveMemoryWarning];
30 | // Dispose of any resources that can be recreated.
31 | }
32 |
33 | -(void)initViews{
34 | _playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
35 | _playBtn.frame = CGRectMake(100, 100, 100, 40);
36 | [_playBtn setTitle:@"播放视频" forState:UIControlStateNormal];
37 | [_playBtn setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
38 | [_playBtn addTarget:self action:@selector(OnPlayBtn:) forControlEvents:UIControlEventTouchUpInside];
39 | [self.view addSubview:_playBtn];
40 | }
41 |
42 | -(void)OnPlayBtn:(UIButton *)sender{
43 | VedioDetailViewController *vedioVC = [[VedioDetailViewController alloc] init];
44 | NSString *fileUrl = @"http://v.chuanke.com/vedio/1/08/65/10865711ff6997a671e6622352385208.mp4";
45 | NSLog(@"fileUrl:%@",fileUrl);
46 | vedioVC.FileUrl = fileUrl;
47 | [self.navigationController pushViewController:vedioVC animated:YES];
48 |
49 | }
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/JZVideoDemo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/project.xcworkspace/xcshareddata/JZVideoDemo.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | C9DBAF19-8E66-4416-A249-62284185548A
9 | IDESourceControlProjectName
10 | JZVideoDemo
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 9495D38365EC460FA11FBB1E6B68A7360D02B237
14 | https://github.com/lookingstars/JZVideoDemo.git
15 |
16 | IDESourceControlProjectPath
17 | JZVideoDemo.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 9495D38365EC460FA11FBB1E6B68A7360D02B237
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/lookingstars/JZVideoDemo.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 9495D38365EC460FA11FBB1E6B68A7360D02B237
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 9495D38365EC460FA11FBB1E6B68A7360D02B237
36 | IDESourceControlWCCName
37 | JZVideoDemo
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/JZVideoDemo/video/JZVideoPlayerView.h:
--------------------------------------------------------------------------------
1 | //
2 | // JZVideoPlayerView.h
3 | // aoyouHH
4 | //
5 | // Created by jinzelu on 15/5/29.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 |
13 | @class JZVideoPlayerView;
14 |
15 | @protocol JZPlayerViewDelegate
16 |
17 | @optional
18 | -(void)playerViewZoomButtonClicked:(JZVideoPlayerView *)view;
19 | -(void)JZOnBackBtn;
20 |
21 | @end
22 |
23 | @interface JZVideoPlayerView : UIView
24 |
25 | @property(nonatomic, assign) id delegate;
26 |
27 | //avplayer
28 | @property(nonatomic, strong) AVPlayerItem *playerItem;
29 | @property(nonatomic, strong) AVPlayer *player;
30 | @property(nonatomic, strong) AVPlayerLayer *playerLayer;
31 | @property(nonatomic, strong) NSString *contentStr;
32 | @property(nonatomic, strong) NSURL *contentURL;
33 |
34 | @property(nonatomic, assign) BOOL isFullScreen;
35 | @property(nonatomic, assign) BOOL isPlaying;
36 | @property(nonatomic, assign) BOOL playerIsBuffering;
37 |
38 | //
39 | @property(nonatomic, strong) UIButton *playBtn;//播放,暂停按钮
40 | @property(nonatomic, strong) UIButton *zoomBtn;//全屏,不全屏按钮
41 | @property(nonatomic, strong) UISlider *progressBar;//播放进度条
42 | @property(nonatomic, strong) UIProgressView *loadProgressView;//缓存进度条
43 | @property(nonatomic, strong) UILabel *playTime;//已播放时间
44 | @property(nonatomic, strong) UILabel *playTotalTime;//总时间
45 |
46 | @property(nonatomic, strong) UIButton *backBtn;//返回按钮
47 |
48 | @property(nonatomic, strong) UIView *playerHUDBottomView;
49 | @property(nonatomic, strong) UIView *playerHUDTopView;
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | /**
58 | * NSURL初始化
59 | */
60 | -(id)initWithFrame:(CGRect)frame contentURL:(NSURL *)contentURL;
61 | /**
62 | * 播放
63 | */
64 | -(void)play;
65 | /**
66 | * 暂停
67 | */
68 | -(void)pause;
69 | /**
70 | * 停止
71 | */
72 | -(void)stop;
73 |
74 | @end
75 |
--------------------------------------------------------------------------------
/JZVideoDemo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // JZVideoDemo
4 | //
5 | // Created by jinzelu on 15/6/2.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "ViewController.h"
11 |
12 | @interface AppDelegate ()
13 |
14 | @end
15 |
16 | @implementation AppDelegate
17 |
18 |
19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
20 | // Override point for customization after application launch.
21 |
22 | //需要添加AVFoundation.framework库
23 |
24 | ViewController *VC = [[ViewController alloc] init];
25 | VC.title = @"视频";
26 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:VC];
27 |
28 | self.window.rootViewController = nav;
29 | [self.window makeKeyAndVisible];
30 |
31 | return YES;
32 | }
33 |
34 | - (void)applicationWillResignActive:(UIApplication *)application {
35 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
36 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
37 | }
38 |
39 | - (void)applicationDidEnterBackground:(UIApplication *)application {
40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
42 | }
43 |
44 | - (void)applicationWillEnterForeground:(UIApplication *)application {
45 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
46 | }
47 |
48 | - (void)applicationDidBecomeActive:(UIApplication *)application {
49 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
50 | }
51 |
52 | - (void)applicationWillTerminate:(UIApplication *)application {
53 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
54 | }
55 |
56 | //禁止横屏
57 | - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
58 | {
59 | if (_isFullScreen) {
60 | return UIInterfaceOrientationMaskAll;
61 | return UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationMaskPortrait;
62 | }
63 | return UIInterfaceOrientationMaskPortrait;
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/JZVideoDemo/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/xcuserdata/jinzelu.xcuserdatad/xcschemes/JZVideoDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/JZVideoDemo/VedioDetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // VedioDetailViewController.m
3 | // aoyouHH
4 | //
5 | // Created by jinzelu on 15/5/20.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import "VedioDetailViewController.h"
10 | #import "JZVideoPlayerView.h"
11 |
12 | #import "AppDelegate.h"
13 |
14 | // 4.屏幕大小尺寸
15 | #define screen_width [UIScreen mainScreen].bounds.size.width
16 | #define screen_height [UIScreen mainScreen].bounds.size.height
17 |
18 | @interface VedioDetailViewController ()
19 | {
20 | JZVideoPlayerView *_jzPlayer;
21 | }
22 |
23 | @end
24 |
25 | @implementation VedioDetailViewController
26 |
27 | -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
28 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
29 | if (self) {
30 | self.hidesBottomBarWhenPushed = YES;
31 | }
32 | return self;
33 | }
34 |
35 | - (void)viewDidLoad {
36 | [super viewDidLoad];
37 | // Do any additional setup after loading the view.
38 | [self.navigationController setNavigationBarHidden:YES animated:YES];
39 | self.view.backgroundColor = [UIColor whiteColor];
40 | dispatch_async(dispatch_get_main_queue(), ^{
41 | // [self initPlayer];
42 | [self initJZPlayer];
43 | });
44 | AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
45 | appDelegate.isFullScreen = YES;
46 | }
47 |
48 | -(void)viewWillDisappear:(BOOL)animated{
49 | [super viewWillDisappear:animated];
50 | AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
51 | appDelegate.isFullScreen = NO;
52 | [self.navigationController setNavigationBarHidden:NO animated:YES];
53 | }
54 |
55 | - (void)didReceiveMemoryWarning {
56 | [super didReceiveMemoryWarning];
57 | // Dispose of any resources that can be recreated.
58 | }
59 |
60 |
61 |
62 | -(void)initJZPlayer{
63 | NSURL *url = [NSURL URLWithString:self.FileUrl];
64 | _jzPlayer = [[JZVideoPlayerView alloc] initWithFrame:CGRectMake(0, 0, screen_width, 300) contentURL:url];
65 | _jzPlayer.delegate = self;
66 | [self.view addSubview:_jzPlayer];
67 | [_jzPlayer play];
68 | }
69 |
70 |
71 | //屏幕旋转
72 | -(BOOL)shouldAutorotate{
73 | return YES;
74 | }
75 | //支持旋转的方向
76 | //一开始的屏幕旋转方向
77 | //支持旋转的方向
78 | //一开始的屏幕旋转方向
79 | - (NSUInteger)supportedInterfaceOrientations
80 | {
81 | NSLog(@"11222111111");
82 |
83 | return UIInterfaceOrientationLandscapeLeft;
84 | }
85 | - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
86 | {
87 | return UIInterfaceOrientationLandscapeLeft;
88 | }
89 |
90 | -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
91 | NSLog(@"11111111");
92 | [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
93 | [UIView animateWithDuration:0 animations:^{
94 | if (UIDeviceOrientationIsLandscape(toInterfaceOrientation)) {
95 | _jzPlayer.frame = CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width);
96 | }else{
97 | _jzPlayer.frame = CGRectMake(0, 0, self.view.frame.size.height, 300);
98 | }
99 | } completion:^(BOOL finished){
100 |
101 | }];
102 | }
103 |
104 |
105 |
106 | -(void)playerViewZoomButtonClicked:(JZVideoPlayerView *)view{
107 | //强制横屏
108 | NSLog(@"222222");
109 | if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
110 | SEL selector = NSSelectorFromString(@"setOrientation:");
111 |
112 | if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])) {
113 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
114 | [invocation setSelector:selector];
115 | [invocation setTarget:[UIDevice currentDevice]];
116 | int val = UIInterfaceOrientationPortrait;//
117 | [invocation setArgument:&val atIndex:2];
118 | [invocation invoke];
119 | }else{
120 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
121 | [invocation setSelector:selector];
122 | [invocation setTarget:[UIDevice currentDevice]];
123 | int val = UIInterfaceOrientationLandscapeRight;//
124 | [invocation setArgument:&val atIndex:2];
125 | [invocation invoke];
126 | }
127 | }
128 | }
129 |
130 | #pragma mark - JZPlayerViewDelegate
131 | -(void)JZOnBackBtn{
132 | [self.navigationController popViewControllerAnimated:YES];
133 | }
134 |
135 | /*
136 | #pragma mark - Navigation
137 |
138 | // In a storyboard-based application, you will often want to do a little preparation before navigation
139 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
140 | // Get the new view controller using [segue destinationViewController].
141 | // Pass the selected object to the new view controller.
142 | }
143 | */
144 |
145 | @end
146 |
--------------------------------------------------------------------------------
/JZVideoDemo/video/JZVideoPlayerView.m:
--------------------------------------------------------------------------------
1 | //
2 | // JZVideoPlayerView.m
3 | // aoyouHH
4 | //
5 | // Created by jinzelu on 15/5/29.
6 | // Copyright (c) 2015年 jinzelu. All rights reserved.
7 | //
8 |
9 | #import "JZVideoPlayerView.h"
10 |
11 | // 2.获得RGB颜色
12 | #define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
13 | #define RGB(r, g, b) RGBA(r, g, b, 1.0f)
14 |
15 | #define navigationBarColor RGB(56, 184, 80)
16 |
17 |
18 | // 3.是否为4inch
19 | #define fourInch ([UIScreen mainScreen].bounds.size.height == 568)
20 |
21 | // 4.屏幕大小尺寸
22 | #define screen_width [UIScreen mainScreen].bounds.size.width
23 | #define screen_height [UIScreen mainScreen].bounds.size.height
24 |
25 | @interface JZVideoPlayerView ()
26 | {
27 | id playbackObserver;
28 |
29 | UIView *loadView;
30 | UIActivityIndicatorView *activityIndicatorView;
31 | NSTimer *timer;
32 | BOOL viewIsShowing;
33 | }
34 |
35 | @end
36 |
37 | @implementation JZVideoPlayerView
38 |
39 | -(id)initWithFrame:(CGRect)frame contentURL:(NSURL *)contentURL{
40 | self = [super initWithFrame:frame];
41 | if (self) {
42 | self.backgroundColor = [UIColor blackColor];
43 |
44 | self.playerItem = [AVPlayerItem playerItemWithURL:contentURL];
45 | self.player = [AVPlayer playerWithPlayerItem:self.playerItem];
46 | self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
47 | self.playerLayer.frame = frame;
48 | [self.layer addSublayer:self.playerLayer];
49 |
50 |
51 | [self initLoadingView];
52 | [self initControlView];
53 | viewIsShowing = YES;
54 | //添加监听
55 | [self addNotification];
56 | [self addObserverToPlayerItem:self.playerItem];
57 | [self addProgressObserver];
58 |
59 | }
60 | return self;
61 | }
62 |
63 | -(void)dealloc{
64 | [self removeObserverToPlayerItem:self.playerItem];
65 | [self.player removeTimeObserver:playbackObserver];
66 | [[NSNotificationCenter defaultCenter] removeObserver:self];
67 | }
68 |
69 | -(void)setFrame:(CGRect)frame{
70 | [super setFrame:frame];
71 | [self.playerLayer setFrame:frame];
72 | }
73 |
74 | -(void)setIsFullScreen:(BOOL)isFullScreen{
75 | _isFullScreen = isFullScreen;
76 | if (isFullScreen) {
77 | //
78 | }else{
79 | //
80 | }
81 | }
82 |
83 | -(void)play{
84 | [self.player play];
85 | self.isPlaying = YES;
86 | [self.playBtn setSelected:YES];
87 | }
88 |
89 | -(void)pause{
90 | [self.player pause];
91 | self.isPlaying = NO;
92 | [self.playBtn setSelected:NO];
93 | }
94 |
95 | -(void)stop{
96 |
97 | }
98 |
99 | -(void)initLoadingView{
100 | loadView = [[UIView alloc] initWithFrame:self.playerLayer.frame];
101 | NSLog(@"playerLayer:=====%f %f",self.playerLayer.frame.size.width,self.playerLayer.frame.size.height);
102 | loadView.backgroundColor = [UIColor clearColor];
103 |
104 |
105 | //
106 | activityIndicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
107 | [activityIndicatorView setCenter:loadView.center];
108 | [activityIndicatorView setActivityIndicatorViewStyle:UIActivityIndicatorViewStyleWhiteLarge];
109 | [activityIndicatorView startAnimating];
110 | [loadView addSubview:activityIndicatorView];
111 |
112 | [self addSubview:loadView];
113 | }
114 | //初始化播放,进度条,时间等视图
115 | -(void)initControlView{
116 | int frameWidth = self.frame.size.width;
117 | int frameHeight = self.frame.size.height;
118 |
119 | //上面的遮罩
120 | self.playerHUDTopView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, frameWidth, 44)];
121 | [self addSubview:self.playerHUDTopView];
122 |
123 | self.backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
124 | self.backBtn.frame = CGRectMake(15, 0, 30, 30);
125 | [self.backBtn addTarget:self action:@selector(OnBackBtn:) forControlEvents:UIControlEventTouchUpInside];
126 | [self.backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
127 | [self.playerHUDTopView addSubview:self.backBtn];
128 |
129 | //下面的遮罩
130 | self.playerHUDBottomView = [[UIView alloc] initWithFrame:CGRectMake(0, frameHeight-44, frameWidth, 44)];
131 | self.playerHUDBottomView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
132 | [self addSubview:self.playerHUDBottomView];
133 | //播放,暂停按钮
134 | self.playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
135 | self.playBtn.frame = CGRectMake(8, 10, 20, 20);
136 | [self.playBtn addTarget:self action:@selector(OnPlayBtn:) forControlEvents:UIControlEventTouchUpInside];
137 | [self.playBtn setSelected:NO];
138 | [self.playBtn setBackgroundImage:[UIImage imageNamed:@"full_pause_icon"] forState:UIControlStateSelected];
139 | [self.playBtn setBackgroundImage:[UIImage imageNamed:@"full_play_icon"] forState:UIControlStateNormal];
140 | [self.playBtn setTintColor:[UIColor clearColor]];
141 | [self.playerHUDBottomView addSubview:self.playBtn];
142 | //全屏按钮
143 | self.zoomBtn = [UIButton buttonWithType:UIButtonTypeCustom];
144 | self.zoomBtn.frame = CGRectMake(frameWidth-27, 10, 20, 20);
145 | [self.zoomBtn addTarget:self action:@selector(OnZoomBtn:) forControlEvents:UIControlEventTouchUpInside];
146 | [self.zoomBtn setSelected:NO];
147 | [self.zoomBtn setBackgroundImage:[UIImage imageNamed:@"zoomout1"] forState:UIControlStateSelected];
148 | [self.zoomBtn setBackgroundImage:[UIImage imageNamed:@"zoomin1"] forState:UIControlStateNormal];
149 | [self.zoomBtn setTintColor:[UIColor clearColor]];
150 | [self.playerHUDBottomView addSubview:self.zoomBtn];
151 | //缓冲进度条
152 | self.loadProgressView = [[UIProgressView alloc] init];
153 | self.loadProgressView.frame = CGRectMake(32, 17, frameWidth-60, 14);
154 | self.loadProgressView.progressViewStyle = UIProgressViewStyleBar;
155 | self.loadProgressView.progressTintColor = RGB(181, 181, 181);
156 | self.loadProgressView.backgroundColor = [UIColor greenColor];
157 | self.loadProgressView.progress = 0;
158 | [self.playerHUDBottomView addSubview:self.loadProgressView];
159 | //播放进度条
160 | self.progressBar = [[UISlider alloc] init];
161 | self.progressBar.frame = CGRectMake(30, 11, frameWidth-60, 14);
162 | [self.progressBar addTarget:self action:@selector(progressBarChanged:) forControlEvents:UIControlEventValueChanged];
163 | [self.progressBar addTarget:self action:@selector(progressBarChangeEnded:) forControlEvents:UIControlEventTouchUpInside];
164 | [self.progressBar setMinimumTrackTintColor:RGB(242, 96, 0)];
165 | [self.progressBar setMaximumTrackTintColor:[UIColor clearColor]]; //设置成透明
166 | // [self.progressBar trackRectForBounds:CGRectMake(0, 0, frameWidth-60, 5)];
167 | [self.progressBar setThumbTintColor:[UIColor clearColor]];
168 | //滑块图片
169 | UIImage *thumbImage = [UIImage imageNamed:@"account_cache_isplay"];
170 | //注意这里要加UIControlStateHightlighted的状态,否则当拖动滑块时滑块将变成原生的控件
171 | [self.progressBar setThumbImage:thumbImage forState:UIControlStateHighlighted];
172 | [self.progressBar setThumbImage:thumbImage forState:UIControlStateNormal];
173 |
174 | [self.playerHUDBottomView addSubview:self.progressBar];
175 |
176 | //播放时间
177 | self.playTime = [[UILabel alloc] initWithFrame:CGRectMake(30, 20, 200, 20)];
178 | self.playTime.text = @"00:00:00/00:00:00";
179 | self.playTime.font = [UIFont systemFontOfSize:13];
180 | self.playTime.textAlignment = NSTextAlignmentLeft;
181 | self.playTime.textColor = [UIColor whiteColor];
182 | [self.playerHUDBottomView addSubview:self.playTime];
183 |
184 | }
185 |
186 | -(void)initPlayTime{
187 | NSString *currentTime = [self getStringFromCMTime:self.player.currentTime];
188 | NSString *totalTime = [self getStringFromCMTime:self.player.currentItem.asset.duration];
189 | self.playTime.text = [NSString stringWithFormat:@"%@/%@",currentTime,totalTime];
190 | NSLog(@"totalTime:%@",totalTime);
191 | }
192 |
193 | //添加计时器,显示/隐藏播放栏
194 | -(void)startTimer{
195 | if (timer == nil) {
196 | timer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(initHUDViewShowing:) userInfo:nil repeats:YES];
197 | }
198 | }
199 | -(void)stopTimer{
200 | if (timer) {
201 | [timer invalidate];
202 | timer = nil;
203 | }
204 | }
205 |
206 | -(void)initHUDViewShowing:(NSTimer *)timer{
207 | [self showHud:viewIsShowing];
208 | }
209 |
210 | -(void)showHud:(BOOL)showing{
211 | __weak __typeof(self) weakself = self;
212 | if (showing) {//隐藏
213 | viewIsShowing = !showing;
214 | weakself.playerHUDBottomView.hidden = YES;
215 | [weakself stopTimer];
216 | }else{//显示
217 | viewIsShowing = !showing;
218 | weakself.playerHUDBottomView.hidden = NO;
219 | [weakself startTimer];
220 | }
221 | }
222 |
223 | -(void)layoutSubviews{
224 | [super layoutSubviews];
225 | UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
226 | if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
227 | NSLog(@"横屏");
228 | self.isFullScreen = YES;
229 | [self initLandscape];
230 | }else{
231 | NSLog(@"竖屏");
232 | self.isFullScreen = NO;
233 | [self initPortraint];
234 | }
235 | }
236 | //initLandscape与initPortraint里面一样
237 | -(void)initLandscape{
238 | NSLog(@"====%f",self.playerLayer.frame.size.width);
239 | float frameWidth = self.frame.size.width;
240 | float frameHeight = self.frame.size.height;
241 | NSLog(@"横屏:width=%f height=%f",frameWidth,frameHeight);
242 | self.playerHUDBottomView.frame = CGRectMake(0, frameHeight-44, frameWidth, 44);
243 | self.zoomBtn.frame = CGRectMake(frameWidth-27, 10, 20, 20);
244 | self.progressBar.frame = CGRectMake(30, 11, frameWidth-60, 14);
245 | self.loadProgressView.frame = CGRectMake(32, 17, frameWidth-60, 14);
246 | }
247 | //
248 | -(void)initPortraint{
249 | float frameWidth = self.frame.size.width;
250 | float frameHeight = self.frame.size.height;
251 | NSLog(@"竖屏:width=%f height=%f",frameWidth,frameHeight);
252 | self.playerHUDBottomView.frame = CGRectMake(0, frameHeight-44, frameWidth, 44);
253 | self.zoomBtn.frame = CGRectMake(frameWidth-27, 10, 20, 20);
254 | self.progressBar.frame = CGRectMake(30, 11, frameWidth-60, 14);
255 | self.loadProgressView.frame = CGRectMake(32, 17, frameWidth-60, 14);
256 | }
257 |
258 | //监听touch事件
259 | -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
260 | CGPoint point = [(UITouch *)[touches anyObject] locationInView:self];
261 | if (CGRectContainsPoint(self.playerLayer.frame, point)) {
262 | [self showHud:viewIsShowing];
263 | }
264 | }
265 | -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
266 | NSLog(@"touchesMoved");
267 | }
268 |
269 | -(void)OnPlayBtn:(UIButton *)sender{
270 | if (self.isPlaying) {
271 | [self pause];
272 | }else{
273 | [self play];
274 | }
275 | }
276 |
277 | -(void)OnZoomBtn:(UIButton *)sender{
278 | NSLog(@"全屏/非全屏");
279 | self.isFullScreen = !self.isFullScreen;
280 | if (self.isFullScreen) {
281 | [self.zoomBtn setSelected:YES];
282 | }else{
283 | [self.zoomBtn setSelected:NO];
284 | }
285 | [self.delegate playerViewZoomButtonClicked:self];
286 | }
287 |
288 | -(void)OnBackBtn:(UIButton *)sender{
289 | if (self.isFullScreen) {
290 | self.isFullScreen = !self.isFullScreen;
291 | [self.delegate playerViewZoomButtonClicked:self];
292 | }else{
293 | [self.delegate JZOnBackBtn];
294 | }
295 | }
296 |
297 | -(void)progressBarChanged:(UISlider *)sender{
298 | if (self.isPlaying) {
299 | [self.player pause];
300 | }
301 | CMTime seekTime = CMTimeMakeWithSeconds(sender.value*(double)self.player.currentItem.asset.duration.value/(double)self.player.currentItem.asset.duration.timescale, self.player.currentTime.timescale);
302 | [self.player seekToTime:seekTime];
303 | }
304 |
305 | -(void)progressBarChangeEnded:(UISlider *)sender{
306 | [self startTimer];
307 | if (self.isPlaying) {
308 | [self.player play];
309 | }
310 | }
311 |
312 | //添加播放进度条更新
313 | -(void)addProgressObserver{
314 | __weak __typeof(self) weakself = self;
315 | AVPlayerItem *playerItem = self.player.currentItem;
316 | NSLog(@"//添加播放进度条更新");
317 | playbackObserver = [self.player addPeriodicTimeObserverForInterval:CMTimeMake(1.0, 1.0) queue:dispatch_get_main_queue() usingBlock:^(CMTime time){
318 | float current = CMTimeGetSeconds(time);
319 | float total = CMTimeGetSeconds(playerItem.duration);
320 | NSLog(@"当前已经播放%.2fs。",current);
321 | //更新进度条
322 | float progress = current/total;
323 | weakself.progressBar.value = progress;
324 | NSString *currentTime = [weakself getStringFromCMTime:weakself.player.currentTime];
325 | NSString *totalTime = [weakself getStringFromCMTime:playerItem.duration];
326 | weakself.playTime.text = [NSString stringWithFormat:@"%@/%@",currentTime,totalTime];
327 | }];
328 | }
329 |
330 | -(void)addNotification{
331 | //给AVPlayerItem添加播放完成通知
332 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackFinished:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.player.currentItem];
333 | }
334 |
335 | -(void)playbackFinished:(NSNotification *)notification{
336 | NSLog(@"视频播放完成");
337 | }
338 |
339 | /**
340 | * 给AVPlayerItem添加监控
341 | *
342 | * @param playerItem AVPlayerItem对象
343 | */
344 | -(void)addObserverToPlayerItem:(AVPlayerItem *)playerItem{
345 | //监控状态属性,注意AVPlayer也有一个status属性,通过监控它的status也可以获得播放状态
346 | [playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
347 | //监控网络加载情况属性
348 | [playerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:nil];
349 | //监控缓冲区大小
350 | [playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
351 |
352 | [self performSelectorInBackground:@selector(initPlayTime) withObject:nil];
353 | }
354 | /**
355 | * 移除KVO观察
356 | */
357 | -(void)removeObserverToPlayerItem:(AVPlayerItem *)playerItem{
358 | [playerItem removeObserver:self forKeyPath:@"status"];
359 | [playerItem removeObserver:self forKeyPath:@"loadedTimeRanges"];
360 | [playerItem removeObserver:self forKeyPath:@"playbackBufferEmpty"];
361 | }
362 |
363 | #pragma mark - 观察视频播放各个监听触发
364 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
365 | if ([keyPath isEqualToString:@"status"]) {//播放状态
366 | AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
367 | switch (status) {
368 | case AVPlayerStatusFailed:
369 | NSLog(@"播放失败");
370 | [loadView setHidden:NO];
371 | break;
372 | case AVPlayerStatusReadyToPlay:
373 | NSLog(@"正在播放...视频中长度为:%f",CMTimeGetSeconds(self.playerItem.duration));
374 | [loadView setHidden:YES];
375 | break;
376 | default:
377 | NSLog(@"default:");
378 | break;
379 | }
380 | }else if ([keyPath isEqualToString:@"loadedTimeRanges"]){//缓冲
381 | NSArray *array = self.playerItem.loadedTimeRanges;
382 | CMTimeRange timeRange = [array.firstObject CMTimeRangeValue];//本次缓冲时间
383 | float startSeconds = CMTimeGetSeconds(timeRange.start);
384 | float durationSeconds = CMTimeGetSeconds(timeRange.duration);
385 | NSTimeInterval totalBuffer = startSeconds + durationSeconds;//缓冲总长度
386 |
387 | float durationTime = CMTimeGetSeconds([[self.player currentItem] duration]);//总时间
388 | NSLog(@"共缓冲:%.2f,总时长为:%f",totalBuffer,durationTime);
389 | [self.loadProgressView setProgress:totalBuffer/durationTime animated:YES];
390 |
391 | if (self.playerIsBuffering && self.isPlaying) {
392 | [self.player play];
393 | self.playerIsBuffering = NO;
394 | }
395 |
396 | }else if ([keyPath isEqualToString:@"playbackBufferEmpty"]){
397 | if(self.player.currentItem.playbackBufferEmpty){
398 | NSLog(@"缓冲区为空");
399 | self.playerIsBuffering = YES;
400 | }else{
401 | NSLog(@"缓冲区不为空======");
402 | }
403 | }else{
404 | NSLog(@"++++++++++");
405 | }
406 | }
407 |
408 |
409 | -(NSString*)getStringFromCMTime:(CMTime)time
410 | {
411 | Float64 currentSeconds = CMTimeGetSeconds(time);
412 | int mins = currentSeconds/60.0;
413 | int hours = mins / 60.0f;
414 | int secs = fmodf(currentSeconds, 60.0);
415 | mins = fmodf(mins, 60.0f);
416 |
417 | NSString *hoursString = hours < 10 ? [NSString stringWithFormat:@"0%d", hours] : [NSString stringWithFormat:@"%d", hours];
418 | NSString *minsString = mins < 10 ? [NSString stringWithFormat:@"0%d", mins] : [NSString stringWithFormat:@"%d", mins];
419 | NSString *secsString = secs < 10 ? [NSString stringWithFormat:@"0%d", secs] : [NSString stringWithFormat:@"%d", secs];
420 |
421 |
422 | return [NSString stringWithFormat:@"%@:%@:%@", hoursString,minsString, secsString];
423 | }
424 |
425 |
426 | /*
427 | // Only override drawRect: if you perform custom drawing.
428 | // An empty implementation adversely affects performance during animation.
429 | - (void)drawRect:(CGRect)rect {
430 | // Drawing code
431 | }
432 | */
433 |
434 | @end
435 |
--------------------------------------------------------------------------------
/JZVideoDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | E36238351B1D590500570A4C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E36238341B1D590500570A4C /* main.m */; };
11 | E36238381B1D590500570A4C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E36238371B1D590500570A4C /* AppDelegate.m */; };
12 | E362383B1B1D590500570A4C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E362383A1B1D590500570A4C /* ViewController.m */; };
13 | E362383E1B1D590500570A4C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E362383C1B1D590500570A4C /* Main.storyboard */; };
14 | E36238401B1D590500570A4C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E362383F1B1D590500570A4C /* Images.xcassets */; };
15 | E36238431B1D590500570A4C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E36238411B1D590500570A4C /* LaunchScreen.xib */; };
16 | E362384F1B1D590500570A4C /* JZVideoDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E362384E1B1D590500570A4C /* JZVideoDemoTests.m */; };
17 | E362385B1B1D593B00570A4C /* JZVideoPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E362385A1B1D593B00570A4C /* JZVideoPlayerView.m */; };
18 | E362385E1B1D5C5A00570A4C /* VedioDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E362385D1B1D5C5A00570A4C /* VedioDetailViewController.m */; };
19 | E362386F1B1D5D7D00570A4C /* account_cache_isplay@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238611B1D5D7D00570A4C /* account_cache_isplay@2x.png */; };
20 | E36238701B1D5D7D00570A4C /* back@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238621B1D5D7D00570A4C /* back@2x.png */; };
21 | E36238711B1D5D7D00570A4C /* bg_rss_head.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238631B1D5D7D00570A4C /* bg_rss_head.png */; };
22 | E36238721B1D5D7D00570A4C /* full_pause_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238641B1D5D7D00570A4C /* full_pause_icon.png */; };
23 | E36238731B1D5D7D00570A4C /* full_play_icon.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238651B1D5D7D00570A4C /* full_play_icon.png */; };
24 | E36238741B1D5D7D00570A4C /* point_normal.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238661B1D5D7D00570A4C /* point_normal.png */; };
25 | E36238751B1D5D7D00570A4C /* point_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238671B1D5D7D00570A4C /* point_selected.png */; };
26 | E36238761B1D5D7D00570A4C /* zoomin.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238681B1D5D7D00570A4C /* zoomin.png */; };
27 | E36238771B1D5D7D00570A4C /* zoomin1.png in Resources */ = {isa = PBXBuildFile; fileRef = E36238691B1D5D7D00570A4C /* zoomin1.png */; };
28 | E36238781B1D5D7D00570A4C /* zoomin@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E362386A1B1D5D7D00570A4C /* zoomin@2x.png */; };
29 | E36238791B1D5D7D00570A4C /* zoomout.png in Resources */ = {isa = PBXBuildFile; fileRef = E362386B1B1D5D7D00570A4C /* zoomout.png */; };
30 | E362387A1B1D5D7D00570A4C /* zoomout1.png in Resources */ = {isa = PBXBuildFile; fileRef = E362386C1B1D5D7D00570A4C /* zoomout1.png */; };
31 | E362387B1B1D5D7D00570A4C /* zoomout2.png in Resources */ = {isa = PBXBuildFile; fileRef = E362386D1B1D5D7D00570A4C /* zoomout2.png */; };
32 | E362387C1B1D5D7D00570A4C /* zoomout@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E362386E1B1D5D7D00570A4C /* zoomout@2x.png */; };
33 | E362387E1B1D5D9100570A4C /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E362387D1B1D5D9100570A4C /* AVFoundation.framework */; };
34 | /* End PBXBuildFile section */
35 |
36 | /* Begin PBXContainerItemProxy section */
37 | E36238491B1D590500570A4C /* PBXContainerItemProxy */ = {
38 | isa = PBXContainerItemProxy;
39 | containerPortal = E36238271B1D590500570A4C /* Project object */;
40 | proxyType = 1;
41 | remoteGlobalIDString = E362382E1B1D590500570A4C;
42 | remoteInfo = JZVideoDemo;
43 | };
44 | /* End PBXContainerItemProxy section */
45 |
46 | /* Begin PBXFileReference section */
47 | E362382F1B1D590500570A4C /* JZVideoDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JZVideoDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
48 | E36238331B1D590500570A4C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | E36238341B1D590500570A4C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
50 | E36238361B1D590500570A4C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
51 | E36238371B1D590500570A4C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
52 | E36238391B1D590500570A4C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
53 | E362383A1B1D590500570A4C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
54 | E362383D1B1D590500570A4C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
55 | E362383F1B1D590500570A4C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
56 | E36238421B1D590500570A4C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
57 | E36238481B1D590500570A4C /* JZVideoDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JZVideoDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
58 | E362384D1B1D590500570A4C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
59 | E362384E1B1D590500570A4C /* JZVideoDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JZVideoDemoTests.m; sourceTree = ""; };
60 | E36238591B1D593B00570A4C /* JZVideoPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JZVideoPlayerView.h; sourceTree = ""; };
61 | E362385A1B1D593B00570A4C /* JZVideoPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JZVideoPlayerView.m; sourceTree = ""; };
62 | E362385C1B1D5C5A00570A4C /* VedioDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VedioDetailViewController.h; sourceTree = ""; };
63 | E362385D1B1D5C5A00570A4C /* VedioDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VedioDetailViewController.m; sourceTree = ""; };
64 | E36238611B1D5D7D00570A4C /* account_cache_isplay@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "account_cache_isplay@2x.png"; sourceTree = ""; };
65 | E36238621B1D5D7D00570A4C /* back@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back@2x.png"; sourceTree = ""; };
66 | E36238631B1D5D7D00570A4C /* bg_rss_head.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_rss_head.png; sourceTree = ""; };
67 | E36238641B1D5D7D00570A4C /* full_pause_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = full_pause_icon.png; sourceTree = ""; };
68 | E36238651B1D5D7D00570A4C /* full_play_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = full_play_icon.png; sourceTree = ""; };
69 | E36238661B1D5D7D00570A4C /* point_normal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = point_normal.png; sourceTree = ""; };
70 | E36238671B1D5D7D00570A4C /* point_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = point_selected.png; sourceTree = ""; };
71 | E36238681B1D5D7D00570A4C /* zoomin.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomin.png; sourceTree = ""; };
72 | E36238691B1D5D7D00570A4C /* zoomin1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomin1.png; sourceTree = ""; };
73 | E362386A1B1D5D7D00570A4C /* zoomin@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "zoomin@2x.png"; sourceTree = ""; };
74 | E362386B1B1D5D7D00570A4C /* zoomout.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomout.png; sourceTree = ""; };
75 | E362386C1B1D5D7D00570A4C /* zoomout1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomout1.png; sourceTree = ""; };
76 | E362386D1B1D5D7D00570A4C /* zoomout2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomout2.png; sourceTree = ""; };
77 | E362386E1B1D5D7D00570A4C /* zoomout@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "zoomout@2x.png"; sourceTree = ""; };
78 | E362387D1B1D5D9100570A4C /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
79 | E36239461B1EADED00570A4C /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; };
80 | /* End PBXFileReference section */
81 |
82 | /* Begin PBXFrameworksBuildPhase section */
83 | E362382C1B1D590500570A4C /* Frameworks */ = {
84 | isa = PBXFrameworksBuildPhase;
85 | buildActionMask = 2147483647;
86 | files = (
87 | E362387E1B1D5D9100570A4C /* AVFoundation.framework in Frameworks */,
88 | );
89 | runOnlyForDeploymentPostprocessing = 0;
90 | };
91 | E36238451B1D590500570A4C /* Frameworks */ = {
92 | isa = PBXFrameworksBuildPhase;
93 | buildActionMask = 2147483647;
94 | files = (
95 | );
96 | runOnlyForDeploymentPostprocessing = 0;
97 | };
98 | /* End PBXFrameworksBuildPhase section */
99 |
100 | /* Begin PBXGroup section */
101 | E36238261B1D590500570A4C = {
102 | isa = PBXGroup;
103 | children = (
104 | E362387D1B1D5D9100570A4C /* AVFoundation.framework */,
105 | E36238311B1D590500570A4C /* JZVideoDemo */,
106 | E362384B1B1D590500570A4C /* JZVideoDemoTests */,
107 | E36238301B1D590500570A4C /* Products */,
108 | );
109 | sourceTree = "";
110 | };
111 | E36238301B1D590500570A4C /* Products */ = {
112 | isa = PBXGroup;
113 | children = (
114 | E362382F1B1D590500570A4C /* JZVideoDemo.app */,
115 | E36238481B1D590500570A4C /* JZVideoDemoTests.xctest */,
116 | );
117 | name = Products;
118 | sourceTree = "";
119 | };
120 | E36238311B1D590500570A4C /* JZVideoDemo */ = {
121 | isa = PBXGroup;
122 | children = (
123 | E36238581B1D593B00570A4C /* video */,
124 | E362385F1B1D5D7D00570A4C /* Resource */,
125 | E36238361B1D590500570A4C /* AppDelegate.h */,
126 | E36238371B1D590500570A4C /* AppDelegate.m */,
127 | E36238391B1D590500570A4C /* ViewController.h */,
128 | E362383A1B1D590500570A4C /* ViewController.m */,
129 | E362385C1B1D5C5A00570A4C /* VedioDetailViewController.h */,
130 | E362385D1B1D5C5A00570A4C /* VedioDetailViewController.m */,
131 | E362383C1B1D590500570A4C /* Main.storyboard */,
132 | E362383F1B1D590500570A4C /* Images.xcassets */,
133 | E36238411B1D590500570A4C /* LaunchScreen.xib */,
134 | E36238321B1D590500570A4C /* Supporting Files */,
135 | );
136 | path = JZVideoDemo;
137 | sourceTree = "";
138 | };
139 | E36238321B1D590500570A4C /* Supporting Files */ = {
140 | isa = PBXGroup;
141 | children = (
142 | E36238331B1D590500570A4C /* Info.plist */,
143 | E36238341B1D590500570A4C /* main.m */,
144 | E36239461B1EADED00570A4C /* PrefixHeader.pch */,
145 | );
146 | name = "Supporting Files";
147 | sourceTree = "";
148 | };
149 | E362384B1B1D590500570A4C /* JZVideoDemoTests */ = {
150 | isa = PBXGroup;
151 | children = (
152 | E362384E1B1D590500570A4C /* JZVideoDemoTests.m */,
153 | E362384C1B1D590500570A4C /* Supporting Files */,
154 | );
155 | path = JZVideoDemoTests;
156 | sourceTree = "";
157 | };
158 | E362384C1B1D590500570A4C /* Supporting Files */ = {
159 | isa = PBXGroup;
160 | children = (
161 | E362384D1B1D590500570A4C /* Info.plist */,
162 | );
163 | name = "Supporting Files";
164 | sourceTree = "";
165 | };
166 | E36238581B1D593B00570A4C /* video */ = {
167 | isa = PBXGroup;
168 | children = (
169 | E36238591B1D593B00570A4C /* JZVideoPlayerView.h */,
170 | E362385A1B1D593B00570A4C /* JZVideoPlayerView.m */,
171 | );
172 | path = video;
173 | sourceTree = "";
174 | };
175 | E362385F1B1D5D7D00570A4C /* Resource */ = {
176 | isa = PBXGroup;
177 | children = (
178 | E36238601B1D5D7D00570A4C /* video */,
179 | );
180 | path = Resource;
181 | sourceTree = "";
182 | };
183 | E36238601B1D5D7D00570A4C /* video */ = {
184 | isa = PBXGroup;
185 | children = (
186 | E36238611B1D5D7D00570A4C /* account_cache_isplay@2x.png */,
187 | E36238621B1D5D7D00570A4C /* back@2x.png */,
188 | E36238631B1D5D7D00570A4C /* bg_rss_head.png */,
189 | E36238641B1D5D7D00570A4C /* full_pause_icon.png */,
190 | E36238651B1D5D7D00570A4C /* full_play_icon.png */,
191 | E36238661B1D5D7D00570A4C /* point_normal.png */,
192 | E36238671B1D5D7D00570A4C /* point_selected.png */,
193 | E36238681B1D5D7D00570A4C /* zoomin.png */,
194 | E36238691B1D5D7D00570A4C /* zoomin1.png */,
195 | E362386A1B1D5D7D00570A4C /* zoomin@2x.png */,
196 | E362386B1B1D5D7D00570A4C /* zoomout.png */,
197 | E362386C1B1D5D7D00570A4C /* zoomout1.png */,
198 | E362386D1B1D5D7D00570A4C /* zoomout2.png */,
199 | E362386E1B1D5D7D00570A4C /* zoomout@2x.png */,
200 | );
201 | path = video;
202 | sourceTree = "";
203 | };
204 | /* End PBXGroup section */
205 |
206 | /* Begin PBXNativeTarget section */
207 | E362382E1B1D590500570A4C /* JZVideoDemo */ = {
208 | isa = PBXNativeTarget;
209 | buildConfigurationList = E36238521B1D590500570A4C /* Build configuration list for PBXNativeTarget "JZVideoDemo" */;
210 | buildPhases = (
211 | E362382B1B1D590500570A4C /* Sources */,
212 | E362382C1B1D590500570A4C /* Frameworks */,
213 | E362382D1B1D590500570A4C /* Resources */,
214 | );
215 | buildRules = (
216 | );
217 | dependencies = (
218 | );
219 | name = JZVideoDemo;
220 | productName = JZVideoDemo;
221 | productReference = E362382F1B1D590500570A4C /* JZVideoDemo.app */;
222 | productType = "com.apple.product-type.application";
223 | };
224 | E36238471B1D590500570A4C /* JZVideoDemoTests */ = {
225 | isa = PBXNativeTarget;
226 | buildConfigurationList = E36238551B1D590500570A4C /* Build configuration list for PBXNativeTarget "JZVideoDemoTests" */;
227 | buildPhases = (
228 | E36238441B1D590500570A4C /* Sources */,
229 | E36238451B1D590500570A4C /* Frameworks */,
230 | E36238461B1D590500570A4C /* Resources */,
231 | );
232 | buildRules = (
233 | );
234 | dependencies = (
235 | E362384A1B1D590500570A4C /* PBXTargetDependency */,
236 | );
237 | name = JZVideoDemoTests;
238 | productName = JZVideoDemoTests;
239 | productReference = E36238481B1D590500570A4C /* JZVideoDemoTests.xctest */;
240 | productType = "com.apple.product-type.bundle.unit-test";
241 | };
242 | /* End PBXNativeTarget section */
243 |
244 | /* Begin PBXProject section */
245 | E36238271B1D590500570A4C /* Project object */ = {
246 | isa = PBXProject;
247 | attributes = {
248 | LastUpgradeCheck = 0630;
249 | ORGANIZATIONNAME = jinzelu;
250 | TargetAttributes = {
251 | E362382E1B1D590500570A4C = {
252 | CreatedOnToolsVersion = 6.3.1;
253 | };
254 | E36238471B1D590500570A4C = {
255 | CreatedOnToolsVersion = 6.3.1;
256 | TestTargetID = E362382E1B1D590500570A4C;
257 | };
258 | };
259 | };
260 | buildConfigurationList = E362382A1B1D590500570A4C /* Build configuration list for PBXProject "JZVideoDemo" */;
261 | compatibilityVersion = "Xcode 3.2";
262 | developmentRegion = English;
263 | hasScannedForEncodings = 0;
264 | knownRegions = (
265 | en,
266 | Base,
267 | );
268 | mainGroup = E36238261B1D590500570A4C;
269 | productRefGroup = E36238301B1D590500570A4C /* Products */;
270 | projectDirPath = "";
271 | projectRoot = "";
272 | targets = (
273 | E362382E1B1D590500570A4C /* JZVideoDemo */,
274 | E36238471B1D590500570A4C /* JZVideoDemoTests */,
275 | );
276 | };
277 | /* End PBXProject section */
278 |
279 | /* Begin PBXResourcesBuildPhase section */
280 | E362382D1B1D590500570A4C /* Resources */ = {
281 | isa = PBXResourcesBuildPhase;
282 | buildActionMask = 2147483647;
283 | files = (
284 | E362383E1B1D590500570A4C /* Main.storyboard in Resources */,
285 | E36238791B1D5D7D00570A4C /* zoomout.png in Resources */,
286 | E36238741B1D5D7D00570A4C /* point_normal.png in Resources */,
287 | E362386F1B1D5D7D00570A4C /* account_cache_isplay@2x.png in Resources */,
288 | E36238781B1D5D7D00570A4C /* zoomin@2x.png in Resources */,
289 | E36238771B1D5D7D00570A4C /* zoomin1.png in Resources */,
290 | E362387A1B1D5D7D00570A4C /* zoomout1.png in Resources */,
291 | E36238751B1D5D7D00570A4C /* point_selected.png in Resources */,
292 | E36238701B1D5D7D00570A4C /* back@2x.png in Resources */,
293 | E36238761B1D5D7D00570A4C /* zoomin.png in Resources */,
294 | E36238711B1D5D7D00570A4C /* bg_rss_head.png in Resources */,
295 | E36238721B1D5D7D00570A4C /* full_pause_icon.png in Resources */,
296 | E36238731B1D5D7D00570A4C /* full_play_icon.png in Resources */,
297 | E36238431B1D590500570A4C /* LaunchScreen.xib in Resources */,
298 | E362387B1B1D5D7D00570A4C /* zoomout2.png in Resources */,
299 | E36238401B1D590500570A4C /* Images.xcassets in Resources */,
300 | E362387C1B1D5D7D00570A4C /* zoomout@2x.png in Resources */,
301 | );
302 | runOnlyForDeploymentPostprocessing = 0;
303 | };
304 | E36238461B1D590500570A4C /* Resources */ = {
305 | isa = PBXResourcesBuildPhase;
306 | buildActionMask = 2147483647;
307 | files = (
308 | );
309 | runOnlyForDeploymentPostprocessing = 0;
310 | };
311 | /* End PBXResourcesBuildPhase section */
312 |
313 | /* Begin PBXSourcesBuildPhase section */
314 | E362382B1B1D590500570A4C /* Sources */ = {
315 | isa = PBXSourcesBuildPhase;
316 | buildActionMask = 2147483647;
317 | files = (
318 | E362383B1B1D590500570A4C /* ViewController.m in Sources */,
319 | E362385B1B1D593B00570A4C /* JZVideoPlayerView.m in Sources */,
320 | E36238381B1D590500570A4C /* AppDelegate.m in Sources */,
321 | E36238351B1D590500570A4C /* main.m in Sources */,
322 | E362385E1B1D5C5A00570A4C /* VedioDetailViewController.m in Sources */,
323 | );
324 | runOnlyForDeploymentPostprocessing = 0;
325 | };
326 | E36238441B1D590500570A4C /* Sources */ = {
327 | isa = PBXSourcesBuildPhase;
328 | buildActionMask = 2147483647;
329 | files = (
330 | E362384F1B1D590500570A4C /* JZVideoDemoTests.m in Sources */,
331 | );
332 | runOnlyForDeploymentPostprocessing = 0;
333 | };
334 | /* End PBXSourcesBuildPhase section */
335 |
336 | /* Begin PBXTargetDependency section */
337 | E362384A1B1D590500570A4C /* PBXTargetDependency */ = {
338 | isa = PBXTargetDependency;
339 | target = E362382E1B1D590500570A4C /* JZVideoDemo */;
340 | targetProxy = E36238491B1D590500570A4C /* PBXContainerItemProxy */;
341 | };
342 | /* End PBXTargetDependency section */
343 |
344 | /* Begin PBXVariantGroup section */
345 | E362383C1B1D590500570A4C /* Main.storyboard */ = {
346 | isa = PBXVariantGroup;
347 | children = (
348 | E362383D1B1D590500570A4C /* Base */,
349 | );
350 | name = Main.storyboard;
351 | sourceTree = "";
352 | };
353 | E36238411B1D590500570A4C /* LaunchScreen.xib */ = {
354 | isa = PBXVariantGroup;
355 | children = (
356 | E36238421B1D590500570A4C /* Base */,
357 | );
358 | name = LaunchScreen.xib;
359 | sourceTree = "";
360 | };
361 | /* End PBXVariantGroup section */
362 |
363 | /* Begin XCBuildConfiguration section */
364 | E36238501B1D590500570A4C /* Debug */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | ALWAYS_SEARCH_USER_PATHS = NO;
368 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
369 | CLANG_CXX_LIBRARY = "libc++";
370 | CLANG_ENABLE_MODULES = YES;
371 | CLANG_ENABLE_OBJC_ARC = YES;
372 | CLANG_WARN_BOOL_CONVERSION = YES;
373 | CLANG_WARN_CONSTANT_CONVERSION = YES;
374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375 | CLANG_WARN_EMPTY_BODY = YES;
376 | CLANG_WARN_ENUM_CONVERSION = YES;
377 | CLANG_WARN_INT_CONVERSION = YES;
378 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
379 | CLANG_WARN_UNREACHABLE_CODE = YES;
380 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
381 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
382 | COPY_PHASE_STRIP = NO;
383 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
384 | ENABLE_STRICT_OBJC_MSGSEND = YES;
385 | GCC_C_LANGUAGE_STANDARD = gnu99;
386 | GCC_DYNAMIC_NO_PIC = NO;
387 | GCC_NO_COMMON_BLOCKS = YES;
388 | GCC_OPTIMIZATION_LEVEL = 0;
389 | GCC_PREFIX_HEADER = "$(SRCROOT)/JZVideoDemo/PrefixHeader.pch";
390 | GCC_PREPROCESSOR_DEFINITIONS = (
391 | "DEBUG=1",
392 | "$(inherited)",
393 | );
394 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
397 | GCC_WARN_UNDECLARED_SELECTOR = YES;
398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399 | GCC_WARN_UNUSED_FUNCTION = YES;
400 | GCC_WARN_UNUSED_VARIABLE = YES;
401 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
402 | MTL_ENABLE_DEBUG_INFO = YES;
403 | ONLY_ACTIVE_ARCH = YES;
404 | SDKROOT = iphoneos;
405 | };
406 | name = Debug;
407 | };
408 | E36238511B1D590500570A4C /* Release */ = {
409 | isa = XCBuildConfiguration;
410 | buildSettings = {
411 | ALWAYS_SEARCH_USER_PATHS = NO;
412 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
413 | CLANG_CXX_LIBRARY = "libc++";
414 | CLANG_ENABLE_MODULES = YES;
415 | CLANG_ENABLE_OBJC_ARC = YES;
416 | CLANG_WARN_BOOL_CONVERSION = YES;
417 | CLANG_WARN_CONSTANT_CONVERSION = YES;
418 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
419 | CLANG_WARN_EMPTY_BODY = YES;
420 | CLANG_WARN_ENUM_CONVERSION = YES;
421 | CLANG_WARN_INT_CONVERSION = YES;
422 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
423 | CLANG_WARN_UNREACHABLE_CODE = YES;
424 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
425 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
426 | COPY_PHASE_STRIP = NO;
427 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
428 | ENABLE_NS_ASSERTIONS = NO;
429 | ENABLE_STRICT_OBJC_MSGSEND = YES;
430 | GCC_C_LANGUAGE_STANDARD = gnu99;
431 | GCC_NO_COMMON_BLOCKS = YES;
432 | GCC_PREFIX_HEADER = "$(SRCROOT)/JZVideoDemo/PrefixHeader.pch";
433 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
434 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
435 | GCC_WARN_UNDECLARED_SELECTOR = YES;
436 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
437 | GCC_WARN_UNUSED_FUNCTION = YES;
438 | GCC_WARN_UNUSED_VARIABLE = YES;
439 | IPHONEOS_DEPLOYMENT_TARGET = 8.3;
440 | MTL_ENABLE_DEBUG_INFO = NO;
441 | SDKROOT = iphoneos;
442 | VALIDATE_PRODUCT = YES;
443 | };
444 | name = Release;
445 | };
446 | E36238531B1D590500570A4C /* Debug */ = {
447 | isa = XCBuildConfiguration;
448 | buildSettings = {
449 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
450 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
451 | GCC_PREFIX_HEADER = "$(SRCROOT)/JZVideoDemo/PrefixHeader.pch";
452 | INFOPLIST_FILE = JZVideoDemo/Info.plist;
453 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
455 | PRODUCT_NAME = "$(TARGET_NAME)";
456 | };
457 | name = Debug;
458 | };
459 | E36238541B1D590500570A4C /* Release */ = {
460 | isa = XCBuildConfiguration;
461 | buildSettings = {
462 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
463 | GCC_PRECOMPILE_PREFIX_HEADER = YES;
464 | GCC_PREFIX_HEADER = "$(SRCROOT)/JZVideoDemo/PrefixHeader.pch";
465 | INFOPLIST_FILE = JZVideoDemo/Info.plist;
466 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
468 | PRODUCT_NAME = "$(TARGET_NAME)";
469 | };
470 | name = Release;
471 | };
472 | E36238561B1D590500570A4C /* Debug */ = {
473 | isa = XCBuildConfiguration;
474 | buildSettings = {
475 | BUNDLE_LOADER = "$(TEST_HOST)";
476 | FRAMEWORK_SEARCH_PATHS = (
477 | "$(SDKROOT)/Developer/Library/Frameworks",
478 | "$(inherited)",
479 | );
480 | GCC_PREPROCESSOR_DEFINITIONS = (
481 | "DEBUG=1",
482 | "$(inherited)",
483 | );
484 | INFOPLIST_FILE = JZVideoDemoTests/Info.plist;
485 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
486 | PRODUCT_NAME = "$(TARGET_NAME)";
487 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JZVideoDemo.app/JZVideoDemo";
488 | };
489 | name = Debug;
490 | };
491 | E36238571B1D590500570A4C /* Release */ = {
492 | isa = XCBuildConfiguration;
493 | buildSettings = {
494 | BUNDLE_LOADER = "$(TEST_HOST)";
495 | FRAMEWORK_SEARCH_PATHS = (
496 | "$(SDKROOT)/Developer/Library/Frameworks",
497 | "$(inherited)",
498 | );
499 | INFOPLIST_FILE = JZVideoDemoTests/Info.plist;
500 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
501 | PRODUCT_NAME = "$(TARGET_NAME)";
502 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JZVideoDemo.app/JZVideoDemo";
503 | };
504 | name = Release;
505 | };
506 | /* End XCBuildConfiguration section */
507 |
508 | /* Begin XCConfigurationList section */
509 | E362382A1B1D590500570A4C /* Build configuration list for PBXProject "JZVideoDemo" */ = {
510 | isa = XCConfigurationList;
511 | buildConfigurations = (
512 | E36238501B1D590500570A4C /* Debug */,
513 | E36238511B1D590500570A4C /* Release */,
514 | );
515 | defaultConfigurationIsVisible = 0;
516 | defaultConfigurationName = Release;
517 | };
518 | E36238521B1D590500570A4C /* Build configuration list for PBXNativeTarget "JZVideoDemo" */ = {
519 | isa = XCConfigurationList;
520 | buildConfigurations = (
521 | E36238531B1D590500570A4C /* Debug */,
522 | E36238541B1D590500570A4C /* Release */,
523 | );
524 | defaultConfigurationIsVisible = 0;
525 | defaultConfigurationName = Release;
526 | };
527 | E36238551B1D590500570A4C /* Build configuration list for PBXNativeTarget "JZVideoDemoTests" */ = {
528 | isa = XCConfigurationList;
529 | buildConfigurations = (
530 | E36238561B1D590500570A4C /* Debug */,
531 | E36238571B1D590500570A4C /* Release */,
532 | );
533 | defaultConfigurationIsVisible = 0;
534 | defaultConfigurationName = Release;
535 | };
536 | /* End XCConfigurationList section */
537 | };
538 | rootObject = E36238271B1D590500570A4C /* Project object */;
539 | }
540 |
--------------------------------------------------------------------------------