prefer hls_aes streams over others

This commit is contained in:
Jens Timmerman 2020-11-01 03:27:38 +01:00
parent 24a495625e
commit cc4b8d70b6
2 changed files with 13 additions and 3 deletions

View File

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

View File

@ -51,7 +51,16 @@ struct Episode: Hashable, Comparable{
let duration = videojson.value(forKey: "duration") as! Double let duration = videojson.value(forKey: "duration") as! Double
let title = videojson.value(forKey: "title") as! String let title = videojson.value(forKey: "title") as! String
let targetURLs = videojson.value(forKey: "targetUrls") as! [NSDictionary] 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) 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() //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)!, var video = Video(hlsUrl: URL(string: videourl)!,