Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fairplay on Safari: Invalid config, wrong type for .drm.advanced.com.apple.fps.1_0 #2003

Closed
torlangballe opened this issue Jun 20, 2019 · 8 comments
Labels
status: archived Archived and locked; will not be updated type: question A question from the community

Comments

@torlangballe
Copy link

I've read #1199 and #382 (closed), but still can't get FairPlay to work on Mac with latest Safari.

Invalid config, wrong type for .drm.advanced.com.apple.fps.1_0

On MacOS 10.14.4
Safari Version 12.1 (14607.1.40.1.4)

Later I get:

Assertion Failed: missing certificate!
assert — asserts.js:46
onWebkitNeedKey_ — patchedmediakeys_apple.js:240
rebuildInitData_ — patchedmediakeys_apple.js:196

TypeError: null is not an object (evaluating 'b.byteLength')
rebuildInitData_ — patchedmediakeys_apple.js:196
onWebkitNeedKey_ — patchedmediakeys_apple.js:248
log.js:132

I tried converting the certificate with base64->ArrayBuffer, probably not the problem, same error either way.

Is this working now for everybody else?

I can send the full keyserver url and certificate if anybody wants.

My player setup is:

function initPlayer() {
    if (manifestUri !== "") {
        var video = document.getElementById('video');
        var player = new shaka.Player(video);
        player.configure('drm.servers.com\\.apple\\.fps\\.1_0', keyServerURL);
        player.configure('drm.advanced.com\\.apple\\.fps\\.1_0', zBase64ToArrayBuffer(certificate));
        window.player = player;
        player.addEventListener('error', onErrorEvent);
        player.addEventListener('buffering', onBufferingEvent);
        player.addEventListener('drmsessionupdate', onDrmsessionupdate);
        player.addEventListener('loading', onLoadingEvent);
        player.addEventListener('streaming', onStreamingEvent);
        player.addEventListener('onstatechange', onStateChangeEvent);
        player.addEventListener('emsg', onEmsgEvent);
        player.addEventListener('onstateidle', onStateIdleEvent);        
        player.addEventListener('error', onErrorEvent);
        player.load(manifestUri, null, mimeType).then(function () { // "application/dash+xml" as 3rd arg to force
            video.play();
        }).catch(onError);  // onError is executed if the asynchronous load fails.
    }
}

Tor

KeyServer URL: – "https://udrmv3-ap.kaltura.com/fps/license?custom_data=eyJjYV9zeXN0ZW0iOiJodHRwczovL3Jlc3QtYXMub3R0LmthbHR1cmEuY29tL2FwaV92My9zZXJ2aWNlL2Fzc2…" (playdrmvideo, line 25)
KeyServer Type: – "com.apple.fps.1_0" (playdrmvideo, line 26)
Manifest: – "https://tglmp01.akamaized.net/out/v1/5fecbc1b98074aa29649b72a99a26d2a/master.m3u8" (playdrmvideo, line 27)
Mime: – "application/vnd.apple.mpegurl" (playdrmvideo, line 28)
Certificate: – "MIIE4jCCA8qgAwIBAgIIM3kBaxj0lbgwDQYJKoZIhvcNAQEFBQ..." (playdrmvideo, line 29)
IndexedDB.install (shaka-player.compiled.debug.js, line 79)
InputEvent.install (shaka-player.compiled.debug.js, line 79)
mathRound.install (shaka-player.compiled.debug.js, line 79)
MediaSource.install (shaka-player.compiled.debug.js, line 79)
[Info] Patching Safari 11/12 MSE bugs. (shaka-player.compiled.debug.js, line 79)
[Info] Using Apple-prefixed EME (shaka-player.compiled.debug.js, line 79)
PiPWebkit.install (shaka-player.compiled.debug.js, line 79)
VideoPlayPromise.install (shaka-player.compiled.debug.js, line 79)
[Info] Using native VTTCue. (shaka-player.compiled.debug.js, line 79)
init (playdrmvideo.js, line 25)
[Error] Invalid config, wrong type for .drm.advanced.com.apple.fps.1_0
(anonymous function) (shaka-player.compiled.debug.js:78:204)
mergeConfigObjects (shaka-player.compiled.debug.js:981)
mergeConfigObjects (shaka-player.compiled.debug.js:980:428)
mergeConfigObjects (shaka-player.compiled.debug.js:980:428)
mergeConfigObjects (shaka-player.compiled.debug.js:987:378)
configure (shaka-player.compiled.debug.js:1066:421)
initPlayer (playdrmvideo.js:33)
initApp (playdrmvideo.js:17)
[Info] Starting attach... (shaka-player.compiled.debug.js, line 79)
[Info] Starting load of https://tglmp01.akamaized.net/out/v1/5fecbc1b98074aa29649b72a99a26d2a/master.m3u8... (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.requestMediaKeySystemAccess (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeySystemAccess (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeySystemAccess.getConfiguration (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeySystemAccess.createMediaKeys (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeys (shaka-player.compiled.debug.js, line 79)
[Info] Created MediaKeys object for key system – "com.apple.fps.1_0" (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.setMediaKeys (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.onWebkitNeedKey_ – WebKitMediaKeyNeededEvent (shaka-player.compiled.debug.js, line 79)
WebKitMediaKeyNeededEvent
[Error] Assertion Failed: missing certificate!
assert (shaka-player.compiled.debug.js:76:196)
onWebkitNeedKey_ (shaka-player.compiled.debug.js:1251:368)
[Error] TypeError: null is not an object (evaluating 'b.byteLength')
rebuildInitData_ (shaka-player.compiled.debug.js:1249:383)
onWebkitNeedKey_ (shaka-player.compiled.debug.js:1251:481)
PatchedMediaKeysApple.MediaKeys.createSession (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeySession (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.MediaKeySession.generateRequest (shaka-player.compiled.debug.js, line 79)
PatchedMediaKeysApple.onWebkitKeyError_ – Event (shaka-player.compiled.debug.js, line 79)
Event
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (favicon.ico, line 0)
PatchedMediaKeysApple.onWebkitNeedKey_ – WebKitMediaKeyNeededEvent {isTrusted: true, initData: Uint8Array, type: "webkitneedkey", …} (shaka-player.compiled.debug.js, line 79)
WebKitMediaKeyNeededEvent {isTrusted: true, initData: Uint8Array, type: "webkitneedkey", target:

@torlangballe torlangballe added the type: question A question from the community label Jun 20, 2019
@torlangballe
Copy link
Author

BTW, I pulled latest from master and built today 20 june 2019.

@ismena
Copy link
Contributor

ismena commented Jun 20, 2019

Thanks for the report! Let me bug the local fairplay expert @joeyparrish

@joeyparrish
Copy link
Member

It looks like the expected type is Uint8Array, so the ArrayBuffer is being ignored. Please try Uint8Array and see if that solves it.

@TheModMaker
Copy link
Contributor

Also the advanced configuration is an object, so you need to specify this is a server cert. It also is a Uint8Array, so you need to use that instead.

player.configure('drm.advanced.com\\.apple\\.fps\\.1_0.serverCertificate',  cert);

@ismena ismena added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 20, 2019
@torlangballe
Copy link
Author

Great, I changed to Uint8Array and added the .serverCertificate to the configuration, and I'm not getting THOSE errors anymore. It's a shame #382 is closed as #382 (comment) shows a perhaps incorrect way of doing it.

My issue now is I'm getting webkitneedkey and webkitkeyerror I think. I am not running over HDMI cable, and am not doing any recording or airplay or anything fancy. Could it be a formatting issue from the key-server?

Relevant Output:

Created MediaKeys object for key system – "com.apple.fps.1_0"
PatchedMediaKeysApple.setMediaKeys
PatchedMediaKeysApple.MediaKeys.setServerCertificate
PatchedMediaKeysApple.onWebkitNeedKey_ – WebKitMediaKeyNeededEvent {isTrusted: true, initData: Uint8Array, type: "webkitneedkey", …}
WebKitMediaKeyNeededEvent {isTrusted: true, initData: Uint8Array, type: "webkitneedkey", target:

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 21, 2019
@joeyparrish joeyparrish reopened this Jun 26, 2019
@joeyparrish
Copy link
Member

@torlangballe, I'm not sure what you mean about #382 (comment) . It shows new Uint8Array() wrapping an ArrayBuffer, right?

As for the rest, you've filed #2009, which appears to be a duplicate of #1923, so we'll continue there. Thanks!

@TheModMaker
Copy link
Contributor

@joeyparrish I just edited your comment to use Uint8Array and pass the correct config path.

@joeyparrish
Copy link
Member

Ah! Thanks, @TheModMaker, and my apologies to @torlangballe.

@shaka-project shaka-project locked and limited conversation to collaborators Aug 25, 2019
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: question A question from the community
Projects
None yet
Development

No branches or pull requests

5 participants