0 Replies
      Latest reply on Jun 7, 2019 5:07 PM by dvyas7
      dvyas7 Level 1 Level 1 (0 points)

        I am trying to play a DRM encrypted mp4 file through a master playlist. Our servers are hosting multiple mp4s

        supporting different bitrates (12kpbs, 48kbps, 96kbps, 160kbps, 256kbps and 320kbps).

         

        Each different bitrate file is encrypted with a different content key, and the format of the contentkeyID

         

        is "skd://contentkeyid_<bitrate>". So eg: "skd://abcdefgh123_12" or "skd://abcdefgh123_96" etc:

         

        With the master playlist having autoselect set to 96kbps, whenever I feed the master playlist to the AVPlayer,

         

        it fetches the content key from the key server and starts playing 96kbps stream.

         

        Now, my question is, If the network bandwidth changes, should the AVPlayer not switch to a different file

        with higher or lower bitrate depending upon the bandwidth available?

         

        I tried simulating different network conditions using the Network Link Condition tool, the indicatedBitrate property

         

        on the AVPlayerItemAccessLogEvent  object seems to change, but the AVPlayer does not make a request to

         

        fetch the new content key for different bitrate file. This tells me that the player is not switching to a different m3u8 file.

         

        Below method is not getting called by AVPlayer under different network conditions:

         

        - contentKeySession:didProvideContentKeyRequest;

         

         

        Below are the contents of the master m3u8:

        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_12.m3u8",GROUP-ID="default-audio-group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_12",CHANNELS="1"
        
        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_48.m3u8.",GROUP-ID="default-audio-group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_48",CHANNELS="2"
        
        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_96.m3u8",GROUP-ID="default-audio-
        group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_96",AUTOSELECT=YES,CHANNELS="2"
        
        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_160.m3u8",GROUP-ID="default-audio-
        group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_160",CHANNELS="2"
        
        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_256.m3u8",GROUP-ID="default-audio-
        group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_256",CHANNELS="2"
        
        #EXT-X-MEDIA:TYPE=AUDIO,URI="fb701719be7fff0a0514d27c0c4cca41_c_320.m3u8",GROUP-ID="default-audio-
        group",NAME="fb701719be7fff0a0514d27c0c4cca41_c_320",CHANNELS="2"
        
        #EXT-X-STREAM-INF:BANDWIDTH=14715,AVERAGE-BANDWIDTH=12618,CODECS="mp4a.40.2",AUDIO="default-audio-group" fb701719be7fff0a0514d27c0c4cca41_c_12.m3u8
        
        #EXT-X-STREAM-INF:BANDWIDTH=50811,AVERAGE-BANDWIDTH=49418,CODECS="mp4a.40.2",AUDIO="default-audio-group"fb701719be7fff0a0514d27c0c4cca41_c_48.m3u8
        
        #EXT-X-STREAM-INF:BANDWIDTH=101299,AVERAGE-BANDWIDTH=98918,CODECS="mp4a.40.2",AUDIO="default-audio-group" fb701719be7fff0a0514d27c0c4cca41_c_96.m3u8
        
        #EXT-X-STREAM-INF:BANDWIDTH=174243,AVERAGE-BANDWIDTH=166777,CODECS="mp4a.40.2",AUDIO="default-audio-group"
        fb701719be7fff0a0514d27c0c4cca41_c_160.m3u8
        
        #EXT-X-STREAM-INF:BANDWIDTH=276432,AVERAGE-BANDWIDTH=267524,CODECS="mp4a.40.2",AUDIO="default-audio-group" fb701719be7fff0a0514d27c0c4cca41_c_256.m3u8
        
        #EXT-X-STREAM-INF:BANDWIDTH=344994,AVERAGE-BANDWIDTH=333661,CODECS="mp4a.40.2",AUDIO="default-audio-group"fb701719be7fff0a0514d27c0c4cca41_c_320.m3u8