Skip to content

Support ClearKey Encrypted HLS #34

@tiberiumihai

Description

@tiberiumihai

Description

I've packaged encrypted media files into dash and hls using MP4Box using filters to generate both manifests (dash and hls) manifest.m3u8:dual. Dual filter was introduced in GPAC v0.9.0. More info about this here: https://github.com/gpac/testsuite/blob/filters/scripts/hls-gen.sh

vgDash is working great with ClearKey DRM but I'm stuck with Hls on Safari.

I'm using both dash and hls directives:

<video ... [vgDash]="video.dashManifest"
               [vgHls]="video.hlsManifest"
               [vgDRMToken]="video.token"
               [vgDRMLicenseServer]="video.licenseServers"><track ... /></video>

And I'm changing bitrates based on this value:

  get isHlsSupported() {
    const videoElement = this.videoPlayer?.nativeElement;
    const hlsSupported = videoElement && videoElement.canPlayType("application/vnd.apple.mpegurl");
    if (hlsSupported) {
      console.log("HLS SUPPORTED BROWSER");
    }
    return hlsSupported;
  }

I see that vgDRMToken and vgDRMLicenseServer are available only for vgDash.
Is there any other way to specify ClearKey for vgHls?

I've seen this comment (video-dev/hls.js#2901 (comment)) and I think ClearKey support will be introduced in [email protected].

Expected Behavior

ClearKey Encrypted Hls to work.

Actual Behavior

Currently, the player, loads manifest.m3u8 playlist and associated segments, but can not decrypt and displays 00:00 video.

Steps to Reproduce

  1. Encrypt video and audio files
  2. Generate dash and hls manifest.m3u8:dual based on encrypted media
  3. Use [vgHls]="'http://localhost:/manifest.m3u8'"
  4. hls can not decrypt video stream. No errors in console though.

Attachments

HLS Supported in Safari

DASH Supported in Chrome

Metadata

Metadata

Labels

enhancementNew feature or requestsafariThank you, Apple. Very cool...

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions