mpmovieplayercontroller - Akamai Token Protection stream cant play in IOS -


i developer in iptv. have developed our application in android , want move on ios devices. akamai our cdn. @ moment have simple ios application able play hls streams. can navigate through each channel , streams played correctly. protect our streams planned use token. have implemented token on android experiencing difficulties on ios. streams protected token won't play, screen remains black.

here example of stream

http://this_is_my_stream_protected_with_token.m3u8?token=exp=1432902926~acl=*~hmac=1e1d2afa7e7fbca72b0da6f5820ba1063446631e75fea80093c8183b619c0acc

if try play stream in application,screen remains black in other hand if open vlc or player in webbrowser (http://www.flashls.org/latest/examples/chromeless/) playes correctly.

i have created function makes http request on link , server response is:

#extm3u #ext-x-version:3 #ext-x-stream-inf:bandwidth=1629884,codecs="avc1.77.31,mp4a.40.2",resolution=640x360  chunklist.m3u8?__token__=exp%3d1432902926%7eacl%3d*%7ehmac%3d1e1d2afa7e7fbca72b0da6f5820ba1063446631e75fea80093c8183b619c0acc 

to make sure application generate correctly token, made hardcoded , still have same problem.

since not akamai problem neither token generation problem, makes me believe perhaps need encode stream somehow in player. have read everywhere problem , still don't have working solution

here player code:

    var param = ["auth":encryption.token()] dictionary<string,string>;             webhelper().httppostnsstring(currentchannel.channeltokenurl, params: param, consumedata: { (nsstring) -> () in                 //this custom method. makes post httprequest. takes token url path , dictionary parameters , returns respnse data converted string.                  token = nsstring;                 _url_ += token;                 _url_ = _url_.stringbytrimmingcharactersinset(nscharacterset.whitespaceandnewlinecharacterset());                 //remove spaces in case (this 'must' in android)                  var address = "http://this_is_my_stream_protected_with_token.m3u8?__token__=exp=1432902926~acl=*~hmac=1e1d2afa7e7fbca72b0da6f5820ba1063446631e75fea80093c8183b619c0acc"                  let url = nsurl(string: address)                  self.movieplayer = mpmovieplayercontroller(contenturl: url)                 self.movieplayer?.controlstyle = mpmoviecontrolstyle.none;                  if(self.db.select.getstringvalue(forkey: self.db.string_value_current_channel) == nil){                     self.db.insert.coredata_insert(value: "-1", coredatakey: self.db.string_value_current_channel)                 }                  logs().sendhit(currentchannel.channelnumber, accessway: self.access_way, lastchannel: self.db.select.getstringvalue(forkey: self.db.string_value_current_channel).value, username: self.db.select.getstringvalue(forkey: self.db.string_value_username).value);                  self.db.delete.deleteentityfromcore(entityname: "stringvalue", field_name: "key", field_value: self.db.string_value_current_channel);                  self.db.insert.coredata_insert(value: currentchannel.channelnumber, coredatakey: self.db.string_value_current_channel);  //we save data , proceed play selected channel.                  if let player = self.movieplayer{                      //save new channel                      player.view.frame = self.view.bounds                     player.preparetoplay()                     player.scalingmode = .aspectfill                     self.view.addsubview(player.view)                     self.view.bringsubviewtofront(self.two_way_channel);                      player.play();                      //send hits                 }             }) 

thank you


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -