forked from rFlex/SCRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCVideoPlayerView.h
64 lines (49 loc) · 1.71 KB
/
SCVideoPlayerView.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// SCVideoPlayerView.h
// SCAudioVideoRecorder
//
// Created by Simon CORSIN on 8/30/13.
// Copyright (c) 2013 rFlex. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SCPlayer.h"
#import "SCImageView.h"
@class SCVideoPlayerView;
@protocol SCVideoPlayerViewDelegate <NSObject>
- (void)videoPlayerViewTappedToPlay:(SCVideoPlayerView *__nonnull)videoPlayerView;
- (void)videoPlayerViewTappedToPause:(SCVideoPlayerView *__nonnull)videoPlayerView;
@end
@interface SCVideoPlayerView : UIView
/**
The delegate
*/
@property (weak, nonatomic) IBOutlet __nullable id<SCVideoPlayerViewDelegate> delegate;
/**
The player this SCVideoPlayerView show
*/
@property (strong, nonatomic) SCPlayer *__nullable player;
/**
The underlying AVPlayerLayer used for displaying the video.
*/
@property (readonly, nonatomic) AVPlayerLayer *__nullable playerLayer;
/**
If enabled, tapping on the view will pause/unpause the player.
*/
@property (assign, nonatomic) BOOL tapToPauseEnabled;
/**
Init the SCVideoPlayerView with a provided SCPlayer.
*/
- (nonnull instancetype)initWithPlayer:(SCPlayer *__nonnull)player;
/**
Set whether every new instances of SCVideoPlayerView should automatically create
and hold an SCPlayer when needed. If disabled, an external SCPlayer must be set
manually to each SCVideoPlayerView instance in order to work properly. Default is YES.
*/
+ (void)setAutoCreatePlayerWhenNeeded:(BOOL)autoCreatePlayerWhenNeeded;
/**
Whether every new instances of SCVideoPlayerView should automatically create and hold an SCPlayer
when needed. If disabled, an external SCPlayer must be set manually to each
SCVideoPlayerView instance in order to work properly. Default is YES.
*/
+ (BOOL)autoCreatePlayerWhenNeeded;
@end