首页 > 编程知识 正文

hls加密的m3u8格式URL,m3u8加密文件合并

时间:2023-05-05 03:20:27 阅读:163559 作者:2697

we ' reusingavplayeronios 8.4 toplayhls,AES-encrypted video。

our.m3 u8 filesincludetheurlofthelicenseserver,e.g.

EXT-X-KEY:METHOD=AES-128,URI='https://. '

In our iOS application,we're using atgdsl method

资源加载器: shouldwaitforloadingofrequestedresource 3360

tointercepttherequestthatgetssentbytheavplayer (orsomeobjectwithinavfoundation ) tothelicenseserver.withinthatmethod,weade

thelicenseserverreceivestherequestwiththetoken,returns the encryption key,and playback begins。

In other words,everything works as expected。

However,we ' re noticing (using the ' xld gtx ' http monitor ) )。 thatfollowingthecreationoftheavplayeritemandpriortotheinvocationoftheresourceloader 3360 method, avfoundationsendsaninitialrequest arequestthat ' snot ' routed ' throughmethodresourceloader 360.thisrequestisrejectedattttthesesed

Summary of events:

thisbehaviorcanbereplicatedusingapple ' savarldelegatedemoapp。

Questions:

istheinitialhttprequestsentbyavfoundationnormal?

If so,whyisitnecessaryandwhyisn ' tit getting ' routed ' throughtheresourceloader : method?

isitpossibletosuppresstheinitialrequestormodifyitbeforeit ' ssent?

汉克you!

解决方案

thesimpleanswertothisissueistheatgdslwillonlyhandlerequestsfor聪明的月亮swhichcannotbeprocessedinthenormalway。

In your case,the聪明之月for your key is a normal https://聪明之月,sotheavplayerwilltrytoprocessthisrequestitself.withoutthetokenthough, thisrequestisrejectedbyyourserver.therefore,theatgdslwillthenpasstherequesttoyourdelegatetohandleit。

To avoid the 'extraneous' request,modifyyourplaylistsothattheencryptionkey聪明月hasaninvalidscheme.usesomethinglikecrypt 3360 .

That way,youwillreceivetheresourceloadercallonthefirsttry,andyoucanreplacethecrypt ://scheme with 3359 anddyourtokenbbbry

It's just how atgdsl works,I'm afraid。

check out apple ' ssampleapphereformoredetails 3360

3359 developer.apple.com/library/IOs/sample code/sc 1791 /

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。