CustomVideoPlayer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #import <CoreMedia/CMTime.h>
  3. @class AVPlayer;
  4. @interface CustomVideoPlayerView : UIView {}
  5. @property(nonatomic, retain) AVPlayer* player;
  6. @end
  7. @protocol CustomVideoPlayerDelegate<NSObject>
  8. - (void)onPlayerReady;
  9. - (void)onPlayerDidFinishPlayingVideo;
  10. @end
  11. @interface CustomVideoPlayer : NSObject
  12. {
  13. id<CustomVideoPlayerDelegate> delegate;
  14. }
  15. @property (nonatomic, retain) id delegate;
  16. + (BOOL)CanPlayToTexture:(NSURL*)url;
  17. - (BOOL)loadVideo:(NSURL*)url;
  18. - (BOOL)readyToPlay;
  19. - (void)unloadPlayer;
  20. - (void)cleanCache;
  21. - (BOOL)playToView:(CustomVideoPlayerView*)view;
  22. - (BOOL)playToTexture;
  23. - (BOOL)playToTextureloop;
  24. - (BOOL)isPlaying;
  25. - (BOOL)getError;
  26. - (intptr_t)curFrameTexture;
  27. - (void)pause;
  28. - (void)resume;
  29. - (void)rewind;
  30. - (void)seekToTimestamp:(CMTime)time;
  31. - (void)seekTo:(float)timeSeconds;
  32. - (void)setSpeed:(float)fSpeed;
  33. - (BOOL)setAudioVolume:(float)volume;
  34. - (NSTimeInterval) availableDuration;
  35. - (void)setAudioTrack:(int)trackId;
  36. - (int )getAudioTrack;
  37. - (int)audioTrack;
  38. - (CMTime)duration;
  39. - (float)durationSeconds;
  40. - (float)curTimeSeconds;
  41. - (CGSize)videoSize;
  42. - (void)setTextureID:(intptr_t)id;
  43. @end