VLCPlaybackController.h 6.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*****************************************************************************
 * VLCPlaybackController.h
 * VLC for iOS
 *****************************************************************************
 * Copyright (c) 2013-2015 VideoLAN. All rights reserved.
 * $Id$
 *
 * Authors: Felix Paul Kühne <fkuehne # videolan.org>
 *          Tobias Conradi <videolan # tobias-conradi.de>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/

#import "VLCEqualizerView.h"
15 16 17

NS_ASSUME_NONNULL_BEGIN
extern NSString * const VLCPlaybackControllerPlaybackDidStart;
18 19 20 21 22
extern NSString *const VLCPlaybackControllerPlaybackDidPause;
extern NSString *const VLCPlaybackControllerPlaybackDidResume;
extern NSString *const VLCPlaybackControllerPlaybackDidStop;
extern NSString *const VLCPlaybackControllerPlaybackDidFail;
extern NSString *const VLCPlaybackControllerPlaybackMetadataDidChange;
23
extern NSString *const VLCPlaybackControllerPlaybackPositionUpdated;
24

25
@class VLCPlaybackController;
26
@class VLCMetaData;
27
@class VLCDialogProvider;
28 29

@protocol VLCPlaybackControllerDelegate <NSObject>
30
@optional
31 32 33 34 35 36 37
- (void)playbackPositionUpdated:(VLCPlaybackController *)controller;
- (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
                      isPlaying:(BOOL)isPlaying
currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
        currentMediaHasChapters:(BOOL)currentMediaHasChapters
          forPlaybackController:(VLCPlaybackController *)controller;
- (void)prepareForMediaPlayback:(VLCPlaybackController *)controller;
38
- (void)showStatusMessage:(NSString *)statusMessage;
39
- (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller metadata:(VLCMetaData *)metadata;
40 41 42 43 44

@end

@interface VLCPlaybackController : NSObject <VLCEqualizerViewDelegate>

45
@property (nonatomic, strong, nullable) UIView *videoOutputView;
46 47 48

@property (nonatomic, retain) VLCMediaList *mediaList;

49 50 51
/* returns nil if currently playing item is not available,*/

@property (nonatomic, strong, readonly) VLCMedia *currentlyPlayingMedia;
52 53 54 55

@property (nonatomic, weak) id<VLCPlaybackControllerDelegate> delegate;

@property (nonatomic, readonly) VLCMediaPlayerState mediaPlayerState;
56 57
@property (nonatomic, readonly) VLCMetaData *metadata;

58 59
@property (nonatomic, readonly) NSInteger mediaDuration;
@property (nonatomic, readonly) BOOL isPlaying;
60
@property (nonatomic, readonly) BOOL willPlay;
61
@property (nonatomic, readwrite) VLCRepeatMode repeatMode;
Soomin Lee's avatar
Soomin Lee committed
62
@property (nonatomic, assign, getter=isShuffleMode) BOOL shuffleMode;
63
@property (nonatomic, readwrite) float playbackRate; // default = 1.0
64
@property (nonatomic, readwrite) float audioDelay; // in milliseconds, default = 0.0
65
@property (nonatomic, readwrite) float playbackPosition; // in seconds, default = 0.0
66
@property (nonatomic, readwrite) float subtitleDelay; // in milliseconds, default = 0.0
67 68 69 70 71 72 73

@property (nonatomic, readwrite) float hue; // default = 0.0
@property (nonatomic, readwrite) float contrast; // default = 1.0
@property (nonatomic, readwrite) float brightness; // default = 1.0
@property (nonatomic, readwrite) float saturation; // default = 1.0
@property (nonatomic, readwrite) float gamma; // default = 1.0

74 75 76 77 78
@property (nonatomic, readonly) CGFloat yaw; //  between ]-180;180]
@property (nonatomic, readonly) CGFloat pitch; // ]-90;90]
@property (nonatomic, readonly) CGFloat roll; // ]-180;180]
@property (nonatomic, readonly) CGFloat fov; // ]0;180[ (default 80.)

79 80 81 82 83 84 85 86
@property (readonly) NSInteger indexOfCurrentAudioTrack;
@property (readonly) NSInteger indexOfCurrentSubtitleTrack;
@property (readonly) NSInteger indexOfCurrentTitle;
@property (readonly) NSInteger indexOfCurrentChapter;
@property (readonly) NSInteger numberOfAudioTracks;
@property (readonly) NSInteger numberOfVideoSubtitlesIndexes;
@property (readonly) NSInteger numberOfTitles;
@property (readonly) NSInteger numberOfChaptersForCurrentTitle;
87 88 89 90
@property (assign, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (assign, readwrite) BOOL fullscreenSessionRequested;
@property (assign, readonly) BOOL isSeekable;
@property (assign, readonly) BOOL currentMediaIs360Video;
91
@property (readonly) NSNumber *playbackTime;
92
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
93
@property (nonatomic, readonly) NSTimer *sleepTimer;
94
@property (nonatomic, readonly) VLCDialogProvider *dialogProvider;
95

96
@property (nonatomic, nullable) VLCRendererItem *renderer;
97

98
+ (VLCPlaybackController *)sharedInstance;
99 100
- (VLCTime *)playedTime;
#pragma mark - playback
101 102 103
- (void)startPlayback;
- (void)stopPlayback;
- (void)playPause;
104 105
- (void)play;
- (void)pause;
106 107
- (void)next;
- (void)previous;
108 109
- (void)jumpForward:(int)interval;
- (void)jumpBackward:(int)interval;
110
- (void)toggleRepeatMode;
111 112
- (void)resetFilters;
- (VLCTime *)remainingTime;
113 114 115 116 117 118 119 120 121

- (NSString *)audioTrackNameAtIndex:(NSInteger)index;
- (NSString *)videoSubtitleNameAtIndex:(NSInteger)index;
- (NSDictionary *)titleDescriptionsDictAtIndex:(NSInteger)index;
- (NSDictionary *)chapterDescriptionsDictAtIndex:(NSInteger)index;
- (void)selectAudioTrackAtIndex:(NSInteger)index;
- (void)selectVideoSubtitleAtIndex:(NSInteger)index;
- (void)selectTitleAtIndex:(NSInteger)index;
- (void)selectChapterAtIndex:(NSInteger)index;
122
- (void)setAudioPassthrough:(BOOL)shouldPass;
123

124
- (void)switchAspectRatio;
125
- (void)toggleFullScreen;
126
#if !TARGET_OS_TV
127 128
- (BOOL)updateViewpoint:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll fov:(CGFloat)fov absolute:(BOOL)absolute;
- (NSInteger)currentMediaProjection;
129
#endif
130
- (void)recoverDisplayedMetadata;
131
- (void)recoverPlaybackState;
132

133 134
- (BOOL)isPlayingOnExternalScreen;

135
- (void)setNeedsMetadataUpdate;
136
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
137
- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
138 139
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(nullable NSString *)subsFilePath;
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(nullable NSString *)subsFilePath completion:(void (^ __nullable)(BOOL success))completion;
140
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
141

142
NS_ASSUME_NONNULL_END
143
@end