ASVideoPlayerNodeControlType and fixes

* changed static string to ASVideoPlayerNodeControlType
* public property for duration
* public method for seek
* new _controlFlexGrowSpacerSpec; used to use flexible space in
controlbar. for example if user does not want to have scrubber, he can
replace it with flexible spacer and duration text node will be kept at
the right edge.
This commit is contained in:
Erekle
2016-05-10 23:57:47 +04:00
parent 716082d411
commit 52b40f8004
4 changed files with 59 additions and 22 deletions

View File

@@ -14,12 +14,26 @@
@class AVAsset;
typedef enum {
ASVideoPlayerNodeControlTypePlaybackButton,
ASVideoPlayerNodeControlTypeElapsedText,
ASVideoPlayerNodeControlTypeDurationText,
ASVideoPlayerNodeControlTypeScrubber,
ASVideoPlayerNodeControlTypeFlexGrowSpacer,
} ASVideoPlayerNodeControlType;
NS_ASSUME_NONNULL_BEGIN
@interface ASVideoPlayerNode : ASDisplayNode
@property (nonatomic,assign,readonly) CGFloat duration;
- (instancetype)initWithUrl:(NSURL*)url;
- (instancetype)initWithAsset:(AVAsset*)asset;
#pragma mark - Public API
-(void)seekToTime:(CGFloat)percentComplete;
@end
NS_ASSUME_NONNULL_END
#endif