VideoPlayer.h
1.02 KB
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
#pragma once
#import <CoreMedia/CMTime.h>
@class AVPlayer;
@interface VideoPlayerView : UIView
{
}
@property(nonatomic, retain) AVPlayer* player;
@end
@protocol VideoPlayerDelegate<NSObject>
- (void)onPlayerReady;
- (void)onPlayerDidFinishPlayingVideo;
- (void)onPlayerError:(NSError*)error;
@end
@interface VideoPlayer : NSObject
{
id<VideoPlayerDelegate> delegate;
}
@property (nonatomic, retain) id delegate;
@property (nonatomic, readonly) AVPlayer* player;
+ (BOOL)CanPlayToTexture:(NSURL*)url;
+ (BOOL)CheckScalingModeAspectFill:(CGSize)videoSize screenSize:(CGSize)screenSize;
- (BOOL)loadVideo:(NSURL*)url;
- (BOOL)readyToPlay;
- (void)unloadPlayer;
- (BOOL)playToView:(VideoPlayerView*)view;
- (BOOL)playToTexture;
- (BOOL)playVideoPlayer;
- (BOOL)isPlaying;
- (intptr_t)curFrameTexture;
- (void)pause;
- (void)resume;
- (void)rewind;
- (void)seekToTimestamp:(CMTime)time;
- (void)seekTo:(float)timeSeconds;
- (BOOL)setAudioVolume:(float)volume;
- (CMTime)duration;
- (float)durationSeconds;
- (CGSize)videoSize;
@end