Commit 8cab30f5 authored by Felix Paul Kühne's avatar Felix Paul Kühne

media player: add convience API to get the number of media tracks

(cherry picked from commit 33f96d81)
parent c9a2e03a
......@@ -281,6 +281,12 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
*/
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoTrackIndexes;
/**
* returns the number of video tracks available in the current media
* \return number of tracks
*/
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfVideoTracks;
/**
* Return the video tracks
*
......@@ -310,6 +316,12 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
*/
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *videoSubTitlesIndexes;
/**
* returns the number of SPU tracks available in the current media
* \return number of tracks
*/
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfSubtitlesTracks;
/**
* Return the video subtitle tracks
* \note this property is deprecated. use (NSArray *)videoSubtitleNames instead.
......@@ -380,6 +392,12 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
*/
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray *audioTrackIndexes;
/**
* returns the number of audio tracks available in the current media
* \return number of tracks
*/
@property (NS_NONATOMIC_IOSONLY, readonly) int numberOfAudioTracks;
/**
* Return the audio tracks
*
......
Version 2.2.2:
--------------
New APIs:
- VLCMediaPlayer
- added properties: numberOfVideoTracks, numberOfSubtitlesTracks
numberOfAudioTracks
Version 2.2.0:
--------------
......
......@@ -341,6 +341,11 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
return [NSArray arrayWithArray: tempArray];
}
- (int)numberOfVideoTracks
{
return libvlc_video_get_track_count(_playerInstance);
}
#pragma mark -
#pragma mark Subtitles
......@@ -393,6 +398,11 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
return [NSArray arrayWithArray: tempArray];
}
- (int)numberOfSubtitlesTracks
{
return libvlc_video_get_spu_count(_playerInstance);
}
- (BOOL)openVideoSubTitlesFromFile:(NSString *)path
{
return libvlc_video_set_subtitle_file(_playerInstance, [path UTF8String]);
......@@ -769,6 +779,11 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
return [NSArray arrayWithArray: tempArray];
}
- (int)numberOfAudioTracks
{
return libvlc_audio_get_track_count(_playerInstance);
}
- (void)setAudioChannel:(int)value
{
libvlc_audio_set_channel(_playerInstance, value);
......
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