VLCPlaybackController.h 4.49 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 25 26
@class VLCPlaybackController;

@protocol VLCPlaybackControllerDelegate <NSObject>
27
@optional
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
- (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;
- (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller
                                       title:(NSString *)title
                                     artwork:(UIImage *)artwork
                                      artist:(NSString *)artist
                                       album:(NSString *)album
                                   audioOnly:(BOOL)audioOnly;

@end

@interface VLCPlaybackController : NSObject <VLCEqualizerViewDelegate>

@property (nonatomic, readonly) VLCMediaListPlayer *listPlayer;
@property (nonatomic, readonly) VLCMediaPlayer *mediaPlayer;

@property (nonatomic, strong) UIView *videoOutputView;

52 53
@property (nonatomic, readwrite) BOOL sessionWillRestart;

54 55 56 57 58 59 60 61
@property (nonatomic, strong) NSURL *url;
@property (nonatomic, strong) NSURL *successCallback;
@property (nonatomic, strong) NSURL *errorCallback;

@property (nonatomic, strong) NSString *pathToExternalSubtitlesFile;
@property (nonatomic, retain) VLCMediaList *mediaList;
@property (nonatomic, readwrite) int itemInMediaListToBePlayedFirst;

Felix Paul Kühne's avatar
Felix Paul Kühne committed
62
#if TARGET_OS_IOS
63
/* returns nil if currently playing item is not a MLFile, e.g. a url */
64
@property (nonatomic, strong, readonly) MLFile *currentlyPlayingMediaFile;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
65
#endif
66 67 68 69 70 71 72

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

@property (nonatomic, readonly) VLCMediaPlayerState mediaPlayerState;
@property (nonatomic, readonly) NSInteger mediaDuration;
@property (nonatomic, readonly) BOOL isPlaying;
@property (nonatomic, readwrite) VLCRepeatMode repeatMode;
73 74 75
@property (nonatomic, readwrite) float playbackRate; // default = 1.0
@property (nonatomic, readwrite) float audioDelay; // in seconds, default = 0.0
@property (nonatomic, readwrite) float subtitleDelay; // in seconds, default = 0.0
76 77
@property (nonatomic, readonly) BOOL currentMediaHasChapters;
@property (nonatomic, readonly) BOOL currentMediaHasTrackToChooseFrom;
78 79
@property (nonatomic, readonly) BOOL activePlaybackSession;
@property (nonatomic, readonly) BOOL audioOnlyPlaybackSession;
80
@property (nonatomic, readonly) NSString *mediaTitle;
81
@property (nonatomic, readwrite) BOOL fullscreenSessionRequested;
82
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
83
@property (nonatomic, readonly) NSTimer* sleepTimer;
84 85 86 87 88 89 90 91 92 93 94 95

+ (VLCPlaybackController *)sharedInstance;

- (void)startPlayback;
- (void)stopPlayback;

- (void)playPause;
- (void)forward;
- (void)backward;
- (void)switchAspectRatio;

- (void)recoverDisplayedMetadata;
96
- (void)recoverPlaybackState;
97

98
- (void)setNeedsMetadataUpdate;
99
- (void)scheduleSleepTimerWithInterval:(NSTimeInterval)timeInterval;
100

101
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index;
102 103
- (void)playURL:(NSURL *)url successCallback:(NSURL*)successCallback errorCallback:(NSURL *)errorCallback;
- (void)playURL:(NSURL *)url subtitlesFilePath:(NSString *)subsFilePath;
104
- (void)remoteControlReceivedWithEvent:(UIEvent *)event;
105

106
@end