-1

im trying to play a protected video which you need to be logged thru our API and get a cookie to access to the m3u8. In Safari, i need to be logged in in order to play the video. I tried to implement this but doesnt work at all.

                let cookies: [Any] = HTTPCookieStorage.shared.cookies!
                self.playerAsset = AVURLAsset.init(url: urlStream!, options:[AVURLAssetHTTPCookiesKey : cookies])
                let item = AVPlayerItem(asset: self.playerAsset!)
                self.playerItems.append(item)

Anyone could help me ?

jboisjoli
  • 99
  • 1
  • 10

1 Answers1

-1

could you play the video in saffari? If yes then you can use the new safari webview instead of avplayer

Rayen Kamta
  • 214
  • 3
  • 10
  • i'm using Alamofire to connect to the API to access to our playlist and i think i need to get this cookie to put there. It doesnt work in Safari if i don't have the cookie... – jboisjoli May 09 '17 at 19:08