Commit a7ea9909 authored by Carola's avatar Carola
Browse files

VLCPlaybackController: fix compilation for tvOS by making the trackrestoration iOS only

(cherry picked from commit 1ebdff9a)
parent 2cd68cd9
......@@ -427,6 +427,17 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
}
#if TARGET_OS_IOS
- (void)restoreAudioAndSubtitleTrack
{
MLFile *item = [MLFile fileForURL:_mediaPlayer.media.url].firstObject;
if (item) {
_mediaPlayer.currentAudioTrackIndex = item.lastAudioTrack.intValue;
_mediaPlayer.currentVideoSubTitleIndex = item.lastSubtitleTrack.intValue;
}
}
- (void)_savePlaybackState
{
@try {
......@@ -655,12 +666,9 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
[_listPlayer.mediaList unlock];
} break;
case VLCMediaPlayerStateESAdded: {
MLFile *item = [MLFile fileForURL:_mediaPlayer.media.url].firstObject;
if (item) {
_mediaPlayer.currentAudioTrackIndex = item.lastAudioTrack.intValue;
_mediaPlayer.currentVideoSubTitleIndex = item.lastSubtitleTrack.intValue;
}
#if TARGET_OS_IOS
[self restoreAudioAndSubtitleTrack];
#endif
} break;
default:
break;
......
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