فهرست منبع

VLCMediaDataSource: Remove knowledge of MediaPlayer

Carola Nitz 7 سال پیش
والد
کامیت
6cc452708a
1فایلهای تغییر یافته به همراه4 افزوده شده و 6 حذف شده
  1. 4 6
      Sources/VLCMediaDataSource.m

+ 4 - 6
Sources/VLCMediaDataSource.m

@@ -237,12 +237,10 @@
 
     /* stop playback if needed */
     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];