Browse Source

VPC: use new VLCKit API to set the drawable directly on init

Felix Paul Kühne 9 years ago
parent
commit
a5bdfe50dd
2 changed files with 11 additions and 11 deletions
  1. 10 10
      Sources/VLCPlaybackController.m
  2. 1 1
      compileVLCforiOS.sh

+ 10 - 10
Sources/VLCPlaybackController.m

@@ -208,15 +208,6 @@ NSString *const VLCPlaybackControllerPlaybackPositionUpdated = @"VLCPlaybackCont
         [self stopPlayback];
         return;
     }
-    if (self.pathToExternalSubtitlesFile)
-        _listPlayer = [[VLCMediaListPlayer alloc] initWithOptions:@[[NSString stringWithFormat:@"--%@=%@", kVLCSettingSubtitlesFilePath, self.pathToExternalSubtitlesFile]]];
-    else
-        _listPlayer = [[VLCMediaListPlayer alloc] init];
-
-    /* to enable debug logging for the playback library instance, switch the boolean below
-     * note that the library instance used for playback may not necessarily match the instance
-     * used for media discovery or thumbnailing */
-    _listPlayer.mediaPlayer.libraryInstance.debugLogging = NO;
 
     /* video decoding permanently fails if we don't provide a UIView to draw into on init
      * hence we provide one which is not attached to any view controller for off-screen drawing
@@ -225,9 +216,18 @@ NSString *const VLCPlaybackControllerPlaybackPositionUpdated = @"VLCPlaybackCont
     _actualVideoOutputView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     _actualVideoOutputView.autoresizesSubviews = YES;
 
+    if (self.pathToExternalSubtitlesFile)
+        _listPlayer = [[VLCMediaListPlayer alloc] initWithOptions:@[[NSString stringWithFormat:@"--%@=%@", kVLCSettingSubtitlesFilePath, self.pathToExternalSubtitlesFile]] andDrawable:_actualVideoOutputView];
+    else
+        _listPlayer = [[VLCMediaListPlayer alloc] initWithDrawable:_actualVideoOutputView];
+
+    /* to enable debug logging for the playback library instance, switch the boolean below
+     * note that the library instance used for playback may not necessarily match the instance
+     * used for media discovery or thumbnailing */
+    _listPlayer.mediaPlayer.libraryInstance.debugLogging = NO;
+
     _mediaPlayer = _listPlayer.mediaPlayer;
     [_mediaPlayer setDelegate:self];
-    [_mediaPlayer setDrawable:_actualVideoOutputView];
     if ([[defaults objectForKey:kVLCSettingPlaybackSpeedDefaultValue] floatValue] != 0)
         [_mediaPlayer setRate: [[defaults objectForKey:kVLCSettingPlaybackSpeedDefaultValue] floatValue]];
     if ([[defaults objectForKey:kVLCSettingDeinterlace] intValue] != 0)

+ 1 - 1
compileVLCforiOS.sh

@@ -12,7 +12,7 @@ NONETWORK=no
 SKIPLIBVLCCOMPILATION=no
 TVOS=no
 
-TESTEDVLCKITHASH=43ae6496
+TESTEDVLCKITHASH=6012c098
 TESTEDMEDIALIBRARYKITHASH=7046f09e
 
 usage()