Commit 83fe7d46 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

media player: deploy VLCKit 3.0 API for titles and chapters, show chapter and title duration, etc.

parent 9a159f58
...@@ -1154,10 +1154,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1154,10 +1154,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
if (mediaPlayer.videoSubTitlesIndexes.count > 1) if (mediaPlayer.videoSubTitlesIndexes.count > 1)
ret++; ret++;
} else { } else {
if ([mediaPlayer countOfTitles] > 1) if ([mediaPlayer numberOfTitles] > 1)
ret++; ret++;
if ([mediaPlayer chaptersForTitleIndex:mediaPlayer.currentTitleIndex].count > 1) if ([mediaPlayer numberOfChaptersForTitle:mediaPlayer.currentTitleIndex] > 1)
ret++; ret++;
} }
...@@ -1185,10 +1185,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1185,10 +1185,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
if (mediaPlayer.videoSubTitlesIndexes.count > 1) if (mediaPlayer.videoSubTitlesIndexes.count > 1)
return NSLocalizedString(@"CHOOSE_SUBTITLE_TRACK", nil); return NSLocalizedString(@"CHOOSE_SUBTITLE_TRACK", nil);
} else { } else {
if ([mediaPlayer countOfTitles] > 1 && section == 0) if ([mediaPlayer numberOfTitles] > 1 && section == 0)
return NSLocalizedString(@"CHOOSE_TITLE", nil); return NSLocalizedString(@"CHOOSE_TITLE", nil);
if ([mediaPlayer chaptersForTitleIndex:mediaPlayer.currentTitleIndex].count > 1) if ([mediaPlayer numberOfChaptersForTitle:mediaPlayer.currentTitleIndex] > 1)
return NSLocalizedString(@"CHOOSE_CHAPTER", nil); return NSLocalizedString(@"CHOOSE_CHAPTER", nil);
} }
...@@ -1225,13 +1225,15 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1225,13 +1225,15 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
cell.textLabel.text = [NSString stringWithFormat:@"%@", mediaPlayer.videoSubTitlesNames[row]]; cell.textLabel.text = [NSString stringWithFormat:@"%@", mediaPlayer.videoSubTitlesNames[row]];
} }
} else { } else {
if ([mediaPlayer countOfTitles] > 1 && section == 0) { if ([mediaPlayer numberOfTitles] > 1 && section == 0) {
cell.textLabel.text = mediaPlayer.titles[row]; NSDictionary *description = mediaPlayer.titleDescriptions[row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ (%@)", description[VLCTitleDescriptionName], [[VLCTime timeWithNumber:description[VLCTitleDescriptionDuration]] stringValue]];
if (row == mediaPlayer.currentTitleIndex) if (row == mediaPlayer.currentTitleIndex)
cellShowsCurrentTrack = YES; cellShowsCurrentTrack = YES;
} else { } else {
cell.textLabel.text = [mediaPlayer chaptersForTitleIndex:mediaPlayer.currentTitleIndex][row]; NSDictionary *description = [mediaPlayer chapterDescriptionsOfTitle:mediaPlayer.currentTitleIndex][row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ (%@)", description[VLCChapterDescriptionName], [[VLCTime timeWithNumber:description[VLCChapterDescriptionDuration]] stringValue]];
if (row == mediaPlayer.currentChapterIndex) if (row == mediaPlayer.currentChapterIndex)
cellShowsCurrentTrack = YES; cellShowsCurrentTrack = YES;
...@@ -1254,10 +1256,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1254,10 +1256,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
return mediaPlayer.videoSubTitlesIndexes.count; return mediaPlayer.videoSubTitlesIndexes.count;
} else { } else {
if ([mediaPlayer countOfTitles] > 1 && section == 0) if ([mediaPlayer numberOfTitles] > 1 && section == 0)
return [mediaPlayer countOfTitles]; return [mediaPlayer numberOfTitles];
else else
return [mediaPlayer chaptersForTitleIndex:mediaPlayer.currentTitleIndex].count; return [mediaPlayer numberOfChaptersForTitle:mediaPlayer.currentTitleIndex];
} }
} }
...@@ -1280,7 +1282,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1280,7 +1282,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
mediaPlayer.currentVideoSubTitleIndex = [indexArray[index] intValue]; mediaPlayer.currentVideoSubTitleIndex = [indexArray[index] intValue];
} }
} else { } else {
if ([mediaPlayer countOfTitles] > 1 && indexPath.section == 0) if ([mediaPlayer numberOfTitles] > 1 && indexPath.section == 0)
mediaPlayer.currentTitleIndex = (int)index; mediaPlayer.currentTitleIndex = (int)index;
else else
mediaPlayer.currentChapterIndex = (int)index; mediaPlayer.currentChapterIndex = (int)index;
......
...@@ -12,7 +12,7 @@ CONFIGURATION="Release" ...@@ -12,7 +12,7 @@ CONFIGURATION="Release"
NONETWORK=no NONETWORK=no
SKIPLIBVLCCOMPILATION=no SKIPLIBVLCCOMPILATION=no
TESTEDVLCKITHASH=ae8c1142 TESTEDVLCKITHASH=dd21c7cf
TESTEDMEDIALIBRARYKITHASH=ee79bd9d TESTEDMEDIALIBRARYKITHASH=ee79bd9d
usage() usage()
......
Supports Markdown
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