Charactor Code of AssetId

Accoding to Table 2-4 of FairPlay Programing Guide, Asset ID in SPC is byte array.

On other hand, the chapter "EME Message Exchange" says "The AssetId can be any string you choose."

So what charactor code should I choose?


In "FPS_in_Safari_Example.html", charactor code of AssetId is like Unicode.

Its javascript code to get byte array is the below:

        function stringToArray(string) {
            var buffer = new ArrayBuffer(string.length*2); // 2 bytes for each char
            var array = new Uint16Array(buffer);
            for (var i=0, strLen=string.length; i<strLen; i++) {
                array[i] = string.charCodeAt(i);
            }
            return array;
        }


The length of Unicode is not always 2 bytes. So it will not working well because Key Server can't extract original string.

It doesn't make sense to treat Asset Id as string in Safari.


Should I pass AssetId to Key Server in the outer of SPC Message?

Hello,


Did you find a solution to this issue?

I am having a similar issue which contentid looks corrupted after i parsed it from the SPC when it comes from Safari.

But there is no problem with the ios client.

Charactor Code of AssetId
 
 
Q