VLCPlaybackController.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*****************************************************************************
  2. * VLCPlaybackController.h
  3. * VLC for iOS
  4. *****************************************************************************
  5. * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
  6. * $Id$
  7. *
  8. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  9. * Tobias Conradi <videolan # tobias-conradi.de>
  10. *
  11. * Refer to the COPYING file of the official project for license.
  12. *****************************************************************************/
  13. #import "VLCEqualizerView.h"
  14. NS_ASSUME_NONNULL_BEGIN
  15. extern NSString * const VLCPlaybackControllerPlaybackDidStart;
  16. extern NSString *const VLCPlaybackControllerPlaybackDidPause;
  17. extern NSString *const VLCPlaybackControllerPlaybackDidResume;
  18. extern NSString *const VLCPlaybackControllerPlaybackDidStop;
  19. extern NSString *const VLCPlaybackControllerPlaybackDidFail;
  20. extern NSString *const VLCPlaybackControllerPlaybackMetadataDidChange;
  21. extern NSString *const VLCPlaybackControllerPlaybackPositionUpdated;
  22. @class VLCPlaybackController;
  23. @class VLCMetaData;
  24. @class VLCDialogProvider;
  25. @protocol VLCPlaybackControllerDelegate <NSObject>
  26. @optional
  27. - (void)playbackPositionUpdated:(VLCPlaybackController *)controller;
  28. - (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
  29. isPlaying:(BOOL)isPlaying
  30. currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
  31. currentMediaHasChapters:(BOOL)currentMediaHasChapters
  32. forPlaybackController:(VLCPlaybackController *)controller;
  33. - (void)prepareForMediaPlayback:(VLCPlaybackController *)controller;
  34. - (void)showStatusMessage:(NSString *)statusMessage forPlaybackController:(VLCPlaybackController *)controller;
  35. - (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller metadata:(VLCMetaData *)metadata;
  36. @end
  37. @interface VLCPlaybackController : NSObject <VLCEqualizerViewDelegate>
  38. @property (nonatomic, strong) UIView *videoOutputView;
  39. @property (nonatomic, retain) VLCMediaList *mediaList;
  40. /* returns nil if currently playing item is not available,*/
  41. @property (nonatomic, strong, readonly) VLCMedia *currentlyPlayingMedia;
  42. @property (nonatomic, weak) id<VLCPlaybackControllerDelegate> delegate;
  43. @property (nonatomic, readonly) VLCMediaPlayerState mediaPlayerState;
  44. @property (nonatomic, readonly) VLCMetaData *metadata;
  45. @property (nonatomic, readonly) NSInteger mediaDuration;
  46. @property (nonatomic, readonly) BOOL isPlaying;
  47. @property (nonatomic, readonly) BOOL willPlay;
  48. @property (nonatomic, readwrite) VLCRepeatMode repeatMode;
  49. @property (nonatomic, assign, getter=isShuffleMode) BOOL shuffleMode;
  50. @property (nonatomic, readwrite) float playbackRate; // default = 1.0
  51. @property (nonatomic, readwrite) float audioDelay; // in milliseconds, default = 0.0
  52. @property (nonatomic, readwrite) float playbackPosition; // in seconds, default = 0.0
  53. @property (nonatomic, readwrite) float subtitleDelay; // in milliseconds, default = 0.0
  54. @property (nonatomic, readwrite) float hue; // default = 0.0
  55. @property (nonatomic, readwrite) float contrast; // default = 1.0
  56. @property (nonatomic, readwrite) float brightness; // default = 1.0
  57. @property (nonatomic, readwrite) float saturation; // default = 1.0
  58. @property (nonatomic, readwrite) float gamma; // default = 1.0
  59. @property (nonatomic, readonly) CGFloat yaw; // between ]-180;180]
  60. @property (nonatomic, readonly) CGFloat pitch; // ]-90;90]
  61. @property (nonatomic, readonly) CGFloat roll; // ]-180;180]
  62. @property (nonatomic, readonly) CGFloat fov; // ]0;180[ (default 80.)
  63. @property (readonly) NSInteger indexOfCurrentAudioTrack;
  64. @property (readonly) NSInteger indexOfCurrentSubtitleTrack;
  65. @property (readonly) NSInteger indexOfCurrentTitle;
  66. @property (readonly) NSInteger indexOfCurrentChapter;
  67. @property (readonly) NSInteger numberOfAudioTracks;
  68. @property (readonly) NSInteger numberOfVideoSubtitlesIndexes;
  69. @property (readonly) NSInteger numberOfTitles;
  70. @property (readonly) NSInteger numberOfChaptersForCurrentTitle;
  71. @property (assign, readonly) BOOL currentMediaHasTrackToChooseFrom;
  72. @property (assign, readwrite) BOOL fullscreenSessionRequested;
  73. @property (assign, readonly) BOOL isSeekable;
  74. @property (assign, readonly) BOOL currentMediaIs360Video;
  75. @property (readonly) NSNumber *playbackTime;
  76. @property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
  77. @property (nonatomic, readonly) NSTimer *sleepTimer;
  78. @property (nonatomic, readonly) VLCDialogProvider *dialogProvider;
  79. @property (nonatomic) VLCRendererItem * _Nullable renderer;
  80. + (VLCPlaybackController *)sharedInstance;
  81. - (VLCTime *)playedTime;
  82. #pragma mark - playback
  83. - (void)startPlayback;
  84. - (void)stopPlayback;
  85. - (void)playPause;
  86. - (void)play;
  87. - (void)pause;
  88. - (void)next;
  89. - (void)previous;
  90. - (void)jumpForward:(int)interval;
  91. - (void)jumpBackward:(int)interval;
  92. - (void)toggleRepeatMode;
  93. - (void)resetFilters;
  94. - (VLCTime *)remainingTime;
  95. - (NSString *)audioTrackNameAtIndex:(NSInteger)index;
  96. - (NSString *)videoSubtitleNameAtIndex:(NSInteger)index;
  97. - (NSDictionary *)titleDescriptionsDictAtIndex:(NSInteger)index;
  98. - (NSDictionary *)chapterDescriptionsDictAtIndex:(NSInteger)index;
  99. - (void)selectAudioTrackAtIndex:(NSInteger)index;
  100. - (void)selectVideoSubtitleAtIndex:(NSInteger)index;
  101. - (void)selectTitleAtIndex:(NSInteger)index;
  102. - (void)selectChapterAtIndex:(NSInteger)index;
  103. - (void)setAudioPassthrough:(BOOL)shouldPass;
  104. - (void)switchAspectRatio;
  105. - (void)switchIPhoneXFullScreen;
  106. #if !TARGET_OS_TV
  107. - (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute;
  108. - (NSInteger)currentMediaProjection;
  109. #endif
  110. - (void)recoverDisplayedMetadata;
  111. - (void)recoverPlaybackState;
  112. - (void)setNeedsMetadataUpdate;
  113. - (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
  114. - (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
  115. - (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString * _Nullable)subsFilePath;
  116. - (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString * _Nullable)subsFilePath completion:(void (^ __nullable)(BOOL success))completion;
  117. - (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
  118. NS_ASSUME_NONNULL_END
  119. @end