Merge pull request 'prefer hls_aes streams over others' (#6) from hlsstreams into main

Reviewed-on: #6
This commit is contained in:
jens 2020-11-01 02:28:33 +00:00
commit 85aee01979
2 changed files with 13 additions and 3 deletions

View File

@ -54,6 +54,7 @@ struct LoginView: View{
struct VRTNuView: View{
var vrtNu: VRTNu
var body: some View {
NavigationView(){
List(vrtNu.getShows(), id: \.title){ show in
NavigationLink(destination: ShowView(show: show)){
@ -72,8 +73,8 @@ struct VRTNuView: View{
}
}
}
}
}.navigationTitle("Browse VRT Nu")//.listStyle(DefaultListStyle())
}.navigationBarTitle("Browse VRT Nu")
}
}
}
struct ShowView: View {

View File

@ -51,7 +51,16 @@ struct Episode: Hashable, Comparable{
let duration = videojson.value(forKey: "duration") as! Double
let title = videojson.value(forKey: "title") as! String
let targetURLs = videojson.value(forKey: "targetUrls") as! [NSDictionary]
let videourl = targetURLs[0].value(forKey: "url") as! String
var videourl = targetURLs[0].value(forKey: "url") as! String
// it seams that the hls_aes stream has more changes of playing
// TODO: pass all streams and switch stream if one fails?
for i in 0 ..< targetURLs.count{
if targetURLs[i].value(forKey: "type") as! String == "hls_aes"{
videourl = targetURLs[i].value(forKey: "url") as! String
}
}
print(videourl)
//session.get('https://media-services-public.vrt.be/vualto-video-aggregator-web/rest/external/v1/videos/%s?vrtPlayerToken=%s&client=%s@PROD' %(video_id, token, clientid)).json()
var video = Video(hlsUrl: URL(string: videourl)!,