Browse Source

VLCMediaDataSource: Remove knowledge of MediaPlayer

Carola Nitz 7 years ago
parent
commit
6cc452708a
1 changed files with 4 additions and 6 deletions
  1. 4 6
      Sources/VLCMediaDataSource.m

+ 4 - 6
Sources/VLCMediaDataSource.m

@@ -237,12 +237,10 @@
 
 
     /* stop playback if needed */
     /* stop playback if needed */
     VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
     VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
-    if (vpc.isPlaying) {
-        MLFile *currentlyPlayingFile = [[MLFile fileForURL:vpc.mediaPlayer.media.url] firstObject];
-        if (currentlyPlayingFile) {
-            if (currentlyPlayingFile == mediaObject)
-                [vpc stopPlayback];
-        }
+    VLCMedia *media = [vpc currentlyPlayingMedia];
+    MLFile *currentlyPlayingFile = [MLFile fileForURL:media.url].firstObject;
+    if (currentlyPlayingFile && currentlyPlayingFile == mediaObject) {
+        [vpc stopPlayback];
     }
     }
 
 
     NSFileManager *fileManager = [NSFileManager defaultManager];
     NSFileManager *fileManager = [NSFileManager defaultManager];