Commit d5fcf4a2 authored by Carola Nitz's avatar Carola Nitz

VLCPlaybackController: Add nullablility

parent 9512e0d8
......@@ -13,7 +13,8 @@
#import "VLCEqualizerView.h"
extern NSString *const VLCPlaybackControllerPlaybackDidStart;
NS_ASSUME_NONNULL_BEGIN
extern NSString * const VLCPlaybackControllerPlaybackDidStart;
extern NSString *const VLCPlaybackControllerPlaybackDidPause;
extern NSString *const VLCPlaybackControllerPlaybackDidResume;
extern NSString *const VLCPlaybackControllerPlaybackDidStop;
......@@ -93,7 +94,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
@property (nonatomic, readonly) NSTimer *sleepTimer;
@property (nonatomic) VLCRendererItem *renderer;
@property (nonatomic) VLCRendererItem * _Nullable renderer;
+ (VLCPlaybackController *)sharedInstance;
- (VLCTime *)playedTime;
......@@ -136,4 +137,5 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath;
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
NS_ASSUME_NONNULL_END
@end
......@@ -1344,7 +1344,7 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
}
#pragma mark - Renderer
- (void)setRenderer:(VLCRendererItem *)renderer
- (void)setRenderer:(VLCRendererItem * __nullable)renderer
{
_renderer = renderer;
[_mediaPlayer setRendererItem:_renderer];
......
......@@ -161,22 +161,20 @@ extension VLCRendererDiscovererManager: VLCRendererDiscovererDelegate {
}
func rendererDiscovererItemDeleted(_ rendererDiscoverer: VLCRendererDiscoverer, item: VLCRendererItem) {
if let playbackController = VLCPlaybackController.sharedInstance() {
// Current renderer has been removed
if playbackController.renderer == item {
playbackController.renderer = nil
delegate?.removedCurrentRendererItem?(item)
// Reset buttons state
for button in rendererButtons {
button.isSelected = false
}
}
if actionSheet.viewIfLoaded?.window != nil {
actionSheet.collectionView.reloadData()
actionSheet.updateViewConstraints()
let playbackController = VLCPlaybackController.sharedInstance()
// Current renderer has been removed
if playbackController.renderer == item {
playbackController.renderer = nil
delegate?.removedCurrentRendererItem?(item)
// Reset buttons state
for button in rendererButtons {
button.isSelected = false
}
}
if actionSheet.viewIfLoaded?.window != nil {
actionSheet.collectionView.reloadData()
actionSheet.updateViewConstraints()
}
// No more renderers to show
if getAllRenderers().isEmpty {
for button in rendererButtons {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment