Opening videos by URL and local files

This commit is contained in:
Arkadiusz Fal
2022-11-10 18:11:28 +01:00
parent 34f7621f36
commit 402d1a2f79
40 changed files with 1158 additions and 126 deletions

View File

@@ -79,9 +79,10 @@ extension Watch {
}
var video: Video {
Video(
videoID: videoID, title: "", author: "",
length: 0, published: "", views: -1, channel: Channel(id: "", name: "")
)
if !Video.VideoID.isValid(videoID), let url = URL(string: videoID) {
return .local(url)
}
return Video(videoID: videoID)
}
}