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

Video JS | Fairplay License URL + Certificate URL doesnt get invoked in safari browser #8871

Open
Nishu2696 opened this issue Sep 18, 2024 · 0 comments
Labels
needs: triage This issue needs to be reviewed

Comments

@Nishu2696
Copy link

Nishu2696 commented Sep 18, 2024

Description

I have a DRM content [with fairplay license URL and certificate URL], and I need to integrate this in safari browser
Sometimes my license URL, certificate URL gets called and the content plays smoothly, but sometimes, my custom license URL and certificate method doesn't gets invoked, and because of this video js throws an error

video.js: 7.20.1, 
videojs-contrib-eme: 4.0.0

I have attached a code snippet, how I am trying to call my license URL for safari browser

player.src({
    src: playerSrc.src,
    type: 'application/x-mpegURL',
    withCredentials: true,
    keySystems: {
       'com.apple.fps.1_0': {
           getCertificate: function (emeOptions, callback) {
               callback(
                 null,base64DecodeUint8Array(playerSrc?.certificateData)
               );
           },
           getContentId: function (emeOptions, initData, eme) {
               fairplayLicenseUri =
                  'https://' + initData.split('skd://').pop();
               var contentId = fairplayLicenseUri.split('/').pop();
               return contentId;
          },
          getLicense: function (emeOptions, contentId, keyMessage, callback ) {
              videojs.xhr({
                 url: playerSrc.licenseUri,
                 method: 'POST',
                 responseType: 'arraybuffer',
                 body: keyMessage,
                 headers: {
                     'Content-type': 'application/octet-stream',
                 },
               },(err, response, responseBody) => {
                      if (err) {
                          callback(err);
                          return;
                      }
                      callback(null, responseBody);
                   });},},
                },
           });

Has anyone experienced something similar and found a workaround?

Reduced test case

Steps to reproduce

  1. Try to play a DRM content in safari [With Fairplay License URL + Certificate URL]
  2. Once the content ends, try to play another DRM content in safari [With Fairplay License URL + Certificate URL]
  3. Note: After the first attempt, the license URL and certificate URL calls doesnt gets triggered

Errors

No response

What version of Video.js are you using?

video.js: 7.20.1

Video.js plugins used.

videojs-contrib-eme

What browser(s) including version(s) does this occur with?

Safari 17.6

What OS(es) and version(s) does this occur with?

Mac os

@Nishu2696 Nishu2696 added the needs: triage This issue needs to be reviewed label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage This issue needs to be reviewed
Projects
None yet
Development

No branches or pull requests

1 participant