Encrypted Live stream does not play in IOS5 but plays in IOS4

落花浮王杯 提交于 2019-12-11 08:43:52

问题


basically the below shown segmented video files playlist plays fine in IOS4 but not in IOS5, so i guess that there is no error in the encoding, segmenting or the encryption.

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-KEY:METHOD=AES-128,URI="http://xxx.xx.x.xx/ios/keys/key.txt",IV=0x00000000000000000000000000000000
#EXTINF:10,
http://xxx.xx.x.xx/ios/myvideo/stream-1.ts
#EXTINF:10,
http://xxx.xx.x.xx/ios/myvideo/stream-2.ts

...

#EXTINF:10,
http://xxx.xx.x.xx/ios/myvideo/stream-502.ts
#EXTINF:10,
http://xxx.xx.x.xx/ios/myvideo/stream-503.ts
#EXT-X-ENDLIST

the error is a blunt 'The operation could not be completed' in the safari. but the same list plays fine if the files are not encrypted is both OS versions.

This thread seems to discuss a similar issue but the solution is closed to public.

i also came across this thread which suggests it is related to the #EXT-X-TARGETDURATION tag but i cannot make out much about it.


回答1:


As per the docs here the IV tag is optional and this explains that sequence no should be used as IV while decryption if IV is missing.

the problem IOS4 and IOS5 handles them differently

so this works for IOS5, but threw error in IOS4

#EXT-X-KEY:METHOD=AES-128,URI="http://xxx.xx.x.xx/ios/keys/key.txt"

while this works for IOS4, but throws error in IOS5

#EXT-X-KEY:METHOD=AES-128,URI="http://xxx.xx.x.xx/ios/keys/key.txt",IV=0x00000000000000000000000000000000

in my case.




回答2:


For HLS on iOS5, the TARGETDURATION value is really not the target duration but needs to be the maximum duration. So it should be set to the largest segment in the file.



来源:https://stackoverflow.com/questions/7912653/encrypted-live-stream-does-not-play-in-ios5-but-plays-in-ios4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!