shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.06k stars 1.33k forks source link

should I trust in mediaKeySystemAccess.getConfiguration() results? #5023

Closed andrzejbl closed 1 year ago

andrzejbl commented 1 year ago

Have you read the Tutorials? yes

Have you read the FAQ and checked for duplicate open issues?

yes What version of Shaka Player are you using? 4.3.4

Please ask your question

Hi! I'm not filling this as a potential bug because I'm a newbie in this area and not sure If I understand the basics correctly.

Why I can't see a video when using HW_SECURE_ALL? It works well only with SW_SECURE_CRYPTO

URL https://zalamo.com/gfx/drm/test2.html Browser:

Mozilla/5.0 (Linux; Android 11; motorola one vision) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Mobile Safari/537.36
v4.3.4

{
  "manifest": {
    "application/dash+xml": true,
    "video/vnd.mpeg.dash.mpd": true,
    "application/x-mpegurl": true,
    "application/vnd.apple.mpegurl": true,
    "application/x-offline-manifest": true,
    "mpd": true,
    "m3u8": true,
    "application/vnd.ms-sstr+xml": false,
    "ism": false
  },
  "media": {
    "video/mp4; codecs=\"avc1.42E01E\"": true,
    "video/mp4": true,
    "video/mp4; codecs=\"avc3.42E01E\"": true,
    "video/mp4; codecs=\"hev1.1.6.L93.90\"": true,
    "video/mp4; codecs=\"hvc1.1.6.L93.90\"": true,
    "video/mp4; codecs=\"hev1.2.4.L153.B0\"; eotf=\"smpte2084\"": true,
    "video/mp4; codecs=\"hvc1.2.4.L153.B0\"; eotf=\"smpte2084\"": true,
    "video/mp4; codecs=\"vp9\"": false,
    "video/mp4; codecs=\"vp09.00.10.08\"": true,
    "video/mp4; codecs=\"av01.0.01M.08\"": true,
    "audio/mp4; codecs=\"mp4a.40.2\"": true,
    "audio/mp4": true,
    "audio/mp4; codecs=\"ac-3\"": false,
    "audio/mp4; codecs=\"ec-3\"": false,
    "audio/mp4; codecs=\"opus\"": true,
    "audio/mp4; codecs=\"flac\"": true,
    "video/webm; codecs=\"vp8\"": true,
    "video/webm": true,
    "video/webm; codecs=\"vp9\"": true,
    "video/webm; codecs=\"vp09.00.10.08\"": true,
    "audio/webm; codecs=\"vorbis\"": true,
    "audio/webm": true,
    "audio/webm; codecs=\"opus\"": true,
    "video/mp2t; codecs=\"avc1.42E01E\"": true,
    "video/mp2t": true,
    "video/mp2t; codecs=\"avc3.42E01E\"": true,
    "video/mp2t; codecs=\"hvc1.1.6.L93.90\"": true,
    "video/mp2t; codecs=\"mp4a.40.2\"": true,
    "video/mp2t; codecs=\"ac-3\"": false,
    "video/mp2t; codecs=\"ec-3\"": false,
    "text/vtt": true,
    "application/mp4; codecs=\"wvtt\"": true,
    "application/mp4": true,
    "application/ttml+xml": true,
    "application/mp4; codecs=\"stpp\"": true,
    "audio/aac": true,
    "audio/ac3": false,
    "audio/ec3": false,
    "audio/mpeg": true
  },
  "drm": {
    "org.w3.clearkey": {
      "persistentState": false
    },
    "com.microsoft.playready": null,
    "com.microsoft.playready.recommendation": null,
    "com.apple.fps.1_0": null,
    "com.apple.fps": null,
    "com.adobe.primetime": null,
    "com.widevine.alpha": {
      "persistentState": true
    }
  },
  "offline": true
}

Dump from ShakaPlayer internals mediaKeySystemAccess.getConfiguration()

{
    "audioCapabilities": [],
    "distinctiveIdentifier": "required",
    "initDataTypes": [
        "cenc"
    ],
    "label": "",
    "persistentState": "required",
    "sessionTypes": [
        "temporary"
    ],
    "videoCapabilities": [
        {
            "contentType": "video/webm; codecs=\"vp09.00.50.08.00.02.02.02.00\"",
            "encryptionScheme": null,
            "robustness": "HW_SECURE_ALL"
        }
    ]
}
avelad commented 1 year ago

DRM providers set different levels of security. In the case of Widevine these levels are known. HW_SECURE_ALL equals L1, and SW_SECURE_CRYPTO equals L3. Depending on the implementation of your Android device, you may have access to one level of security or another.

github-actions[bot] commented 1 year ago

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.