Rework the firstSourceURL method.

This commit is contained in:
Damiano Galassi committed 2017-10-09 17:05:52 +02:00
1 parent 32eba2590c
commit 022a9b893a
1 file changed
+7 -2
+7 -2
View File
@@ -15,7 +15,7 @@ extension MP42File {
}
var hdType: TrackHDType? {
for track in self.tracks(withMediaType: kMP42MediaType_Video) as! [MP42VideoTrack] {
for track in tracks(withMediaType: kMP42MediaType_Video) as! [MP42VideoTrack] {
if track.width > 1280 || track.height > 720 {
return .hd1080p
} else if track.width >= 960 && track.height >= 720 || track.width >= 1280 {
@@ -26,7 +26,12 @@ extension MP42File {
}
func firstSourceURL() -> URL? {
return self.tracks.flatMap { $0.url } .first
for track in tracks {
if track.url != nil {
return track.url
}
}
return nil
}
func extractSearchTerms(fallbackURL: URL?) -> MetadataSearchTerms {