-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b8edbb
commit 5c2b4d8
Showing
10 changed files
with
137 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file modified
BIN
+2.06 KB
(100%)
...deoPlayer.xcworkspace/xcuserdata/changsanjiang.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains 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
17 changes: 17 additions & 0 deletions
17
SJVideoPlayerProject/SJVideoPlayer/Demo/Test/ViewControllerTestPresent.h
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// ViewControllerTestPresent.h | ||
// SJVideoPlayer | ||
// | ||
// Created by 畅三江 on 2018/10/28. | ||
// Copyright © 2018 畅三江. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface ViewControllerTestPresent : UIViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
85 changes: 85 additions & 0 deletions
85
SJVideoPlayerProject/SJVideoPlayer/Demo/Test/ViewControllerTestPresent.m
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// | ||
// ViewControllerTestPresent.m | ||
// SJVideoPlayer | ||
// | ||
// Created by 畅三江 on 2018/10/28. | ||
// Copyright © 2018 畅三江. All rights reserved. | ||
// | ||
|
||
#import "ViewControllerTestPresent.h" | ||
#import "SJVideoPlayer.h" | ||
#import <Masonry/Masonry.h> | ||
|
||
@interface ViewControllerTestPresent () | ||
@property (nonatomic, strong) SJVideoPlayer *player; | ||
@end | ||
|
||
@implementation ViewControllerTestPresent | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.edgesForExtendedLayout = UIRectEdgeNone; | ||
self.view.backgroundColor = [UIColor whiteColor]; | ||
|
||
// create a player of the default type | ||
_player = [SJVideoPlayer player]; | ||
|
||
[self.view addSubview:_player.view]; | ||
[_player.view mas_makeConstraints:^(MASConstraintMaker *make) { | ||
// if (@available(iOS 11.0, *)) make.top.equalTo(self.view.mas_safeAreaLayoutGuideTop); | ||
// else make.top.offset(0); | ||
// make.leading.trailing.offset(0); | ||
// make.height.equalTo(self->_player.view.mas_width).multipliedBy(9 / 16.0f); | ||
make.edges.offset(0); | ||
}]; | ||
|
||
_player.URLAsset = [[SJVideoPlayerURLAsset alloc] initWithURL:[NSBundle.mainBundle URLForResource:@"play" withExtension:@"mp4"]]; | ||
_player.URLAsset.title = @"Test Title"; | ||
_player.URLAsset.alwaysShowTitle = YES; | ||
_player.hideBackButtonWhenOrientationIsPortrait = YES; | ||
_player.enableFilmEditing = YES; | ||
_player.pausedToKeepAppearState = YES; | ||
_player.generatePreviewImages = YES; | ||
|
||
#pragma mark | ||
UILabel *noteLabel = [UILabel new]; | ||
noteLabel.numberOfLines = 0; | ||
noteLabel.text = @"This is a simple demo, please use other demos to understand how to use.\n此为简单Demo, 请通过其他Demo来了解如何使用."; | ||
noteLabel.font = [UIFont systemFontOfSize:12]; | ||
[self.view addSubview:noteLabel]; | ||
[noteLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
make.leading.offset(8); | ||
make.trailing.offset(-8); | ||
make.centerY.offset(0); | ||
}]; | ||
// Do any additional setup after loading the view. | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[super viewDidAppear:animated]; | ||
[self.player vc_viewDidAppear]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated { | ||
[super viewWillDisappear:animated]; | ||
[self.player vc_viewWillDisappear]; | ||
} | ||
|
||
- (void)viewDidDisappear:(BOOL)animated { | ||
[super viewDidDisappear:animated]; | ||
[self.player vc_viewDidDisappear]; | ||
} | ||
|
||
- (BOOL)prefersStatusBarHidden { | ||
return [self.player vc_prefersStatusBarHidden]; | ||
} | ||
|
||
- (UIStatusBarStyle)preferredStatusBarStyle { | ||
return [self.player vc_preferredStatusBarStyle]; | ||
} | ||
|
||
- (BOOL)prefersHomeIndicatorAutoHidden { | ||
return YES; | ||
} | ||
|
||
@end |