VLCPlaybackController.h 5.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*****************************************************************************
 * 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"

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

24
@class VLCPlaybackController;
25
@class VLCMetaData;
26 27

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

@end

@interface VLCPlaybackController : NSObject <VLCEqualizerViewDelegate>

@property (nonatomic, strong) UIView *videoOutputView;

@property (nonatomic, strong) NSURL *successCallback;
@property (nonatomic, strong) NSURL *errorCallback;

@property (nonatomic, retain) VLCMediaList *mediaList;

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

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

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

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

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

@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

75 76 77 78 79
@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.)

80 81 82 83 84 85 86 87
@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;
88 89 90 91
@property (assign, readonly) BOOL currentMediaHasTrackToChooseFrom;
@property (assign, readwrite) BOOL fullscreenSessionRequested;
@property (assign, readonly) BOOL isSeekable;
@property (assign, readonly) BOOL currentMediaIs360Video;
92
@property (readonly) NSNumber *playbackTime;
93
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
94
@property (nonatomic, readonly) NSTimer* sleepTimer;
95

96 97
@property (nonatomic) VLCRendererItem *renderer;

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)switchIPhoneXFullScreen;
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
- (void)setNeedsMetadataUpdate;
134
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
135
- (void)performNavigationAction:(VLCMediaPlaybackNavigationAction)action;
136
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath;
137
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
138

139
@end