Question about AES-128 encryption method mentioned here.
How exactly is this method applied over HLS media segments? Is it the MPEG-2 TS container that is encrypted (including TS/PES packet headers & PSI (!?) ) or elementary streams inside it, before packetizing them into PES payloads?
The AES-128 encryption method is encrypting the entire TS container including headers. It may seem strange if you're familiar with other systems like DVB simulcrypt, but it's very simple (or simplistic).
The SAMPLE-AES encryption method, on the other hand, only encrypts the audio and part of the video data.
Beyond that, many implementations use a nonstandard approach where the encryption method is set to NONE and a different encryption mechanism is used.