shaka-player icon indicating copy to clipboard operation
shaka-player copied to clipboard

Fairplay on safari not working

Open sridhard opened this issue 3 years ago • 3 comments

Have you read the FAQ and checked for duplicate open issues? Yes I have checked #4470 #4469 and other fairplay related isues

What version of Shaka Player are you using? Latest (4.2.1)

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? Yes

Are you using the demo app or your own custom app? Both demo app and custom apps not working

If custom app, can you reproduce the issue using our demo app? Yes

What browser and OS are you using? Mac OS, Safari

For embedded devices (smart TVs, etc.), what model and firmware version are you using? NA

What are the manifest and license server URIs? ManifestUrl: https://learnyst-content-mumbai.s3.ap-south-1.amazonaws.com/v5/schools/11075/courses/133080/paid/sdrm/1884011/audio_video/V22_P_lyst2517_cenc/stream.m3u8

License Server Url: https://4adf8ffe.drm-fairplay-licensing.axprod.net/AcquireLicense

License Certificate Url: https://fps-certs.learnyst.com/fairplay.cer

License Header: X-AxDRM-Message License Header Value: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNTIxZWU5NWQtOTUxMi00ZmE2LTk3NmEtYWQ4ZjAwZDdiNDQzIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsInZlcnNpb24iOjIsImxpY2Vuc2UiOnsiZXhwaXJhdGlvbl9kYXRldGltZSI6IjIwMjMtMTAtMDlUMDk6MDE6NTAuNzg2WiIsImFsbG93X3BlcnNpc3RlbmNlIjpmYWxzZX0sImNvbnRlbnRfa2V5c19zb3VyY2UiOnsiaW5saW5lIjpbeyJpZCI6ImZjNzgxOTAwLTAwMDAtMDAwMC0wMTEwLTc1MDEwMDEzMzA4MCIsImVuY3J5cHRlZF9rZXkiOiI5eGZ2M2Zab0pZc2pzQzl4SU5iQ3J3PT0iLCJ1c2FnZV9wb2xpY3kiOiJMc3RQb2xpY3kiLCJpdiI6ImRvTkZBQUFBQUFBQkVIVUJBQk13Z0E9PSJ9XX0sImNvbnRlbnRfa2V5X3VzYWdlX3BvbGljaWVzIjpbeyJuYW1lIjoiTHN0UG9saWN5In1dLCJsaWNlbnNlX3NlcnZlciI6eyJyZXR1cm5fbGljZW5zZV9yZXF1ZXN0X2luZm8iOnRydWV9fSwiYmVnaW5fZGF0ZSI6IjIwMjItMDktMTZUMDk6MDE6NTAuNzg4WiIsImV4cGlyYXRpb25fZGF0ZSI6IjIwMjItMTAtMTdUMDk6MDE6NTAuNzg4WiJ9.J7dVOSEOjl2SD7RXWtWBN45hW1i_g_k-jW6jTUwVA8Y

What did you do? We are using shaka player for fairplay. Shaka version 3.3.2 works fine with fairplay with no issues. We are trying to upgrade the shaka player to 4.2.1 version. In 4.2.1 version fairplay is not working. I have tries all possible combinations.

Setup-1 (Try with native player):

  1. Install shaka polyfill shaka.polyfill.installAll();
  2. Player config { drm: { servers: { 'com.apple.fps.1_0': '..........', }, advanced: { 'com.apple.fps.1_0': { 'serverCertificate': new Uint8Array(fpsCertificate) } } }, streaming: { retryParameters: { maxAttempts: 20, }, useNativeHlsOnSafari:true } }
  3. Register drm.initDataTransform

Result: "{"exceptionTrace":"{\"severity\":2,\"category\":6,\"code\":6006,\"data\":[\"The operation is not supported.\",{},null],\"handled\":false,\"message\":\"Shaka Error DRM.FAILED_TO_GENERATE_LICENSE_REQUEST (The operation is not supported.,NotSupportedError: The operation is not supported.,)\",\"stack\":\"@https://localhost:3000/static/js/main.chunk.js:131977:22\\n@https://localhost:3000/static/js/main.chunk.js:136307:42\\npromiseReactionJob@[native code]\"}","playerType":0,"errorCode":100,"subErrorCode":6006}"

Setup-2 (Try with modern EME):

  1. Install shaka polyfill shaka.polyfill.installAll();
  2. Player config { drm: { servers: { 'com.apple.fps': '..........', }, advanced: { 'com.apple.fps': { 'serverCertificate': new Uint8Array(fpsCertificate) } } }, streaming: { retryParameters: { maxAttempts: 20, }, useNativeHlsOnSafari:false } }
  3. Register drm.initDataTransform

Result: initDataTransform not triggered (with initDataType as skd). Our DRM license provider giving error saying content ID is not valid.

Setup-3 (Try with modern EME):

  1. DONT INSTALL shaka polyfill shaka.polyfill.installAll();
  2. Player config { drm: { servers: { 'com.apple.fps': '..........', }, advanced: { 'com.apple.fps': { 'serverCertificate': new Uint8Array(fpsCertificate) } } }, streaming: { retryParameters: { maxAttempts: 20, }, useNativeHlsOnSafari:false } }
  3. Register drm.initDataTransform

Result: "{"exceptionTrace":"{\"severity\":2,\"category\":6,\"code\":6001,\"data\":[],\"handled\":false,\"message\":\"Shaka Error DRM.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE ()\",\"stack\":\"@https://localhost:3000/static/js/main.chunk.js:131977:22\\n@https://localhost:3000/static/js/main.chunk.js:135964:47\\n@https://localhost:3000/static/js/main.chunk.js:129599:30\\n@https://localhost:3000/static/js/main.chunk.js:129559:28\\n@https://localhost:3000/static/js/main.chunk.js:129628:23\\n@https://localhost:3000/static/js/main.chunk.js:129664:17\\nPromise@[native code]\\n@https://localhost:3000/static/js/main.chunk.js:129659:25\\n@https://localhost:3000/static/js/main.chunk.js:129673:50\\n@https://localhost:3000/static/js/main.chunk.js:135946:57\\n@https://localhost:3000/static/js/main.chunk.js:135684:30\\n@https://localhost:3000/static/js/main.chunk.js:129599:30\\n@https://localhost:3000/static/js/main.chunk.js:129559:28\\n@https://localhost:3000/static/js/main.chunk.js:129628:23\\nb@https://localhost:3000/static/js/main.chunk.js:129652:22\\npromiseReactionJob@[native code]\"}","playerType":0,"errorCode":5,"subErrorCode":6001}"

What did you expect to happen? fairplay should work

What actually happened? fairplay not working

sridhard avatar Sep 17 '22 12:09 sridhard

Try your Setup-2, but without the initDataTransform.

multiplexer2 avatar Sep 17 '22 16:09 multiplexer2

in setup-2, initDataTransform is not triggered. Then our DRM license request is failing with reason as invalid asset/content ID.

sridhard avatar Sep 18 '22 03:09 sridhard

  1. Install shaka polyfill shaka.polyfill.installAll();

This does not install the apple media keys polyfill since v4.x. I've asked if this should be described in the docs, but never got a response. The documentation for installAll is misleading.

Try step 1 by calling shaka.polyfill.PatchedMediaKeysApple.install();.

martinstark avatar Sep 19 '22 09:09 martinstark

@NoChance777 Did adding shaka.polyfill.PatchedMediaKeysApple.install(); solve your problem?

jakubkrolikowski avatar Oct 22 '22 20:10 jakubkrolikowski

Hi @jakubkrolikowski! In combination with com.apple.fps.1_0 and native playback, version without prefix does not work.

NoChance777 avatar Oct 24 '22 06:10 NoChance777

Hi! Any update ?

JuanMorenoS avatar Nov 08 '22 01:11 JuanMorenoS

@avelad, would you please take a look and give us your thoughts?

joeyparrish avatar Nov 08 '22 18:11 joeyparrish

Hello, I am able to play my URL in ipad safari and Macbook safari. But I am not able to play in iphone safari

parthsheth2403 avatar Jan 27 '23 05:01 parthsheth2403

Same as @parthsheth2403.

Robloche avatar Mar 10 '23 15:03 Robloche

  1. Install shaka polyfill shaka.polyfill.installAll();

This does not install the apple media keys polyfill since v4.x. I've asked if this should be described in the docs, but never got a response. The documentation for installAll is misleading.

Try step 1 by calling shaka.polyfill.PatchedMediaKeysApple.install();.

Wanted to drop a note that this resolved an issue for me. Thanks.

nchu-rb avatar Jul 18 '23 19:07 nchu-rb

Does this documentation fix the issues https://shaka-player-demo.appspot.com/docs/api/tutorial-fairplay.html?

avelad avatar Aug 23 '23 10:08 avelad

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.

github-actions[bot] avatar Aug 30 '23 11:08 github-actions[bot]

  1. Install shaka polyfill shaka.polyfill.installAll();

This does not install the apple media keys polyfill since v4.x. I've asked if this should be described in the docs, but never got a response. The documentation for installAll is misleading.

Try step 1 by calling shaka.polyfill.PatchedMediaKeysApple.install();.

This solution solve the issue in my case, thanks martinstark

zisiskol avatar Oct 18 '23 14:10 zisiskol