Skip to content

Commit 36f872d

Browse files
author
Diogo Simao Marques
committed
VLCPlaybackService: Add helper to retrieve the VLCTime object
This helper retrieves the VLCTime object and avoids having to recreate it based on the mediaDuration int value.
1 parent 91aff15 commit 36f872d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Sources/Playback/Control/VLCPlaybackService.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ NS_SWIFT_NAME(PlaybackService)
7070
@property (nonatomic, readonly) VLCMetaData *metadata;
7171

7272
@property (nonatomic, readonly) NSInteger mediaDuration;
73+
@property (nonatomic, readonly) VLCTime *mediaLength;
7374
@property (nonatomic, readonly) BOOL isPlaying;
7475
@property (nonatomic, readonly) BOOL playerIsSetup;
7576
@property (nonatomic, readwrite) BOOL playAsAudio;

Sources/Playback/Control/VLCPlaybackService.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,12 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
529529

530530
- (NSInteger)mediaDuration
531531
{
532-
return _mediaPlayer.media.length.intValue;;
532+
return _mediaPlayer.media.length.intValue;
533+
}
534+
535+
- (VLCTime *)mediaLength
536+
{
537+
return _mediaPlayer.media.length;
533538
}
534539

535540
- (BOOL)isPlaying

0 commit comments

Comments
 (0)