Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift 3: How to set multiple cookies for JWPlayer for HLS Streaming

As I'm using JWPlayer for HLS Streaming at iOS side. For Streaming we have secure Video url to play content in iOS device. For that we are using cloud front domain. What I want is, our web has integrated cloudfront signed cookie where we need to set cookies for cloudfront domain, Is this we can achieve using JW Player in Ios device?

Please refer below URL for more details,

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html

like image 681
Chirag Vindhani Avatar asked Mar 21 '17 05:03

Chirag Vindhani


1 Answers

let cookies = "cookiesKey=value;cookiesKey=value...."
let config = JWConfig(containtURL:"your url")
config.assetOptions = ["AVURLAssetHTTPHeaderFieldsKey":["cookie":cookies]]

as above code of cookies, create your cookies string with key and value pair and separated by semicolon and use this as cookie in assetOptions.

like image 80
user2393484 Avatar answered Sep 28 '22 04:09

user2393484