Skip to content

DRM Refactor

Created by: greg80303

Here is the very large pull request that provides a working refactor and rearchitecting of DRM support in dash.js. No large changes have been made since the architecture review teleconference that was held in December -- only bug fixes and documentation. I have tested playback of both Widevine (Chrome/Linux) and PlayReady (IE11/Windows 8.1) protected content.

The one item from the architecture review call that I did not add to the codebase was regarding "supplemental CDM data". This was described to me as "DRM-specific data that would supplement the initData passed to the createSession/generateKeyRequest API". My colleagues have done some checking and they can find no indication that the EME spec is considering standardizing this behavior. In fact, this bug seems to indicate that there is a push for eliminating DRM-specific initData alltogether. I am absolutely open for more discussion on this, but I feel that dash.js should lean towards only implementing the existing standards.

Below is the list of individual commits squashed into this single pull request:

commit e1cfef3f59cb177d464e3f494364c46d78efa200 Author: Greg Rutz g.rutz@cablelabs.com Date: Tue Jan 6 16:37:13 2015 -0700

Update BSD license text to comply with dash.js policy

commit 3e4d6811ca3d585882aeb6762ea8e2260a7fe3c2 Author: Greg Rutz g.rutz@cablelabs.com Date: Tue Jan 6 16:03:45 2015 -0700

Widevine fixes

Pass proper WV CDM message to the proxy server.

Report error message by reading body of non-200 responses

commit c0bb6c21739a95cde4756c882769342203eaf540 Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 22:20:31 2015 -0700

Fix bug in retrieving key system string

commit b3cc6f6597a1bd680c27bd94789201522397a9fe Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 22:19:42 2015 -0700

Update method documentation

commit c7dab3edcdfb1ee25cf8cbb5ac682b5bc3f37d82 Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 22:18:59 2015 -0700

Report proper error when no valid Widevine laURL

commit 929ba27017ab51b745e875934e539ce71f8ff994 Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 16:16:10 2015 -0700

Entire PSSH box should be initData

commit 69df5f897e5b779bd9c2cb4b5c7080724d6b79cd Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 16:15:52 2015 -0700

Fix keyerror message formatting and event

commit 9f57c864ab5c207450076a5d64678acbf4fbcc9a Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Jan 5 10:47:07 2015 -0700

Fix use of undefined sessionID

commit 1edb2a680018b37c763f99b7c62be6a79b9ed464 Author: Greg Rutz g.rutz@cablelabs.com Date: Sun Jan 4 14:54:54 2015 -0700

Fix incorrect refernence to closure var

commit 17c7742c29d4041bb0ad853dca80d73f0c7cb51b Author: Greg Rutz greg@gsr-tek.com Date: Sun Dec 21 22:41:07 2014 -0700

Fix JSLint compliance issues

commit f61e89e52cefe1d5491426572b2460641aa8c670 Author: Greg Rutz greg@gsr-tek.com Date: Sun Dec 21 22:18:36 2014 -0700

Cleanup from architecture review

Change ProtectionModel implementations to use object model that is consistent
with the rest of the codebase

Comment out the KeySystem and ProtectionModel interface methods since they exist
for documentation purposes only

commit c231a39147744bb46100054db9c730f8a39cd422 Author: Greg Rutz g.rutz@cablelabs.com Date: Thu Dec 18 09:44:04 2014 -0700

For now, use ContentProtection initData first

commit b20918a7a7c55ed2c00b01657f0e5fdae6bd6afb Author: Greg Rutz g.rutz@cablelabs.com Date: Thu Dec 18 09:32:37 2014 -0700

First successful PlayReady playback!

commit 56d6cd82b3d71b81eec8706e9b4ea4b3d7f715d7 Author: Greg Rutz g.rutz@cablelabs.com Date: Thu Dec 18 09:09:50 2014 -0700

More fixes

commit 2136eb86950c6ce5db44739618993aa94a03a699 Author: Greg Rutz g.rutz@cablelabs.com Date: Thu Dec 18 08:54:16 2014 -0700

More fixes for 3Feb2014

commit c2cd85ac375fff90d8f05ec1413f3fee4a7516de Author: Greg Rutz greg@gsr-tek.com Date: Wed Dec 17 22:05:47 2014 -0700

More fixes to 0.1b APIs

commit 22bc92ec5bdd2cc7578e6f2a6996e3ecfdd6c1c6 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 16:35:06 2014 -0700

Need contentType in createKeySession API

3Feb2014 EME API version requires this information

commit bb3e8ddf1d94a218057d06ea8ffa5a18820cdfcf Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 16:14:40 2014 -0700

More fixes.  Also updated ClearKey

commit cb64f98c5e3d445f12b3c287870a6967af6d54de Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 14:58:28 2014 -0700

Lots of bug fixes

commit 4c8d08cc8047d1bdfc4dd7ac828dfad7cd678e78 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 12:50:32 2014 -0700

Several bug fixes from initial testing

commit 98be1167bf5edbed2d3536ac9407d7280494e105 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 10:56:30 2014 -0700

Final changes before testing

New SessionToken base class to ensure clients have access to
sessionID and initData for each session

Event subscription for Stream

Removed unnecessary event data classes

commit 16fd4b1f3f01c27fc34fdd55fee25d4ce3d42bb6 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 09:04:02 2014 -0700

Better rename for shorter file/objects names

commit 67eae28a73030762b44d8ddba8d1844ed025a990 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 17 08:51:31 2014 -0700

Object renaming

New names better convey that these objects are event data and
not events themselves

commit 332f2533b9134b95052894ed3f0e14f8b1d85adb Author: Greg Rutz greg@gsr-tek.com Date: Tue Dec 16 23:06:12 2014 -0700

More checkpoint changes

commit a3dbd4a01964ac5d828b9a4a23d76f3a967c834f Author: Greg Rutz greg@gsr-tek.com Date: Mon Dec 15 23:00:08 2014 -0700

Move events to ProtectionController

commit e1c78849df32d593919168a75f51b81b174a19f4 Author: Greg Rutz greg@gsr-tek.com Date: Mon Dec 15 22:28:34 2014 -0700

Separate selecting key system and setting video elem

commit 9dd51cdc8c642bd3c505fe92e93efb18c8e155ec Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Dec 15 16:50:39 2014 -0700

Checkpoint commit from today's work

commit 398a13fb21757e1c028ee940a0c69849e14c366d Author: Greg Rutz greg@gsr-tek.com Date: Sun Dec 14 22:02:13 2014 -0700

Don't need to remove temp video element

commit 9fbabbef9ab0919eca21ed8285880e0290d970b2 Author: Greg Rutz greg@gsr-tek.com Date: Sun Dec 14 21:44:22 2014 -0700

KeySystem implementations in place

commit 033a6af6eec260dcf256f0af59a12886e561b4ec Author: Greg Rutz greg@gsr-tek.com Date: Sat Dec 13 13:52:07 2014 -0700

Initial PlayReady implementation is in

Cleaned up the DRM interface a little bit as well

commit 493bbffef9571e3754ba4a7e1ec3c353f2f58688 Author: Greg Rutz greg@gsr-tek.com Date: Fri Dec 12 22:58:07 2014 -0700

Move ProtectionModel base to eme directory

Also fix-up index.html js sources

commit 575c59c967c747ed4a15e6890c3a130be8c99447 Author: Greg Rutz greg@gsr-tek.com Date: Fri Dec 12 22:35:19 2014 -0700

ProtectionModel refactor complete

commit c3e45fcaa774f7f279f7e59cb84a0298254c53dc Author: Greg Rutz g.rutz@cablelabs.com Date: Fri Dec 12 17:09:40 2014 -0700

Moved 0.1b implementation into dijon model

Still need to add detection logic to Context

commit 5ffb5b0206ca85544bf259d1fb18c20c1fe9a998 Author: Greg Rutz g.rutz@cablelabs.com Date: Fri Dec 12 15:08:29 2014 -0700

Move EME event classes into the "vo" namespace

commit ea4a2d71d91df41340dcf807ea5b3a20b24797af Author: Greg Rutz g.rutz@cablelabs.com Date: Fri Dec 12 12:44:18 2014 -0700

Move protection-related files to new subdirectory

commit 481491a0b9bbc3093f469f60c4aa06576c45cd85 Author: Greg Rutz greg@gsr-tek.com Date: Wed Dec 10 23:43:59 2014 -0700

More refactor work.

Moved session management out of EME implementation classes.  This involves a lot of
magic in the 0.1b implementation since MediaKeySession objects don't exist yet.  So,
some management of sessions must remain in there.

Created separate EME interfaces for detecting KeySystem support and
selecting KeySystem

commit d43ea84ef156310432897bf90605a3aafacd2b82 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 10 17:09:15 2014 -0700

Latest checkpoint of code.  Lots of things in flux

commit ce841b7c80d5d4b3f93d749905932250e13c7357 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 10 09:44:59 2014 -0700

First cut at DRM_Base interface

commit 14e8c7691a3f54c41ae7e9a421ff3517f58a86b5 Author: Greg Rutz g.rutz@cablelabs.com Date: Tue Dec 9 16:22:44 2014 -0700

Basic detection working in Chrome and IE11

commit b7ecac7c6bd1f413e4538786be7579905f169c5e Author: Greg Rutz g.rutz@cablelabs.com Date: Tue Dec 9 12:56:21 2014 -0700

More refactoring work.

Fix problems with my object design and namespacing

Implement first API detection logic.

commit 3fcb55928f9eec7fefeb4f9f707fa58b25a4c184 Author: Greg Rutz g.rutz@cablelabs.com Date: Mon Dec 8 15:08:10 2014 -0700

Last additions to 3Feb2014 implementation

Also, moved some of the instance variables to the EME_base

commit 543cfc314c324bf664e75c6ba1a85067ebcdbb82 Author: Greg Rutz greg@gsr-tek.com Date: Thu Dec 4 11:39:11 2014 -0700

Finish 3Feb2014 EME implementation.

commit 9c063afd5961d75d0efdcd2579dfeb5983e5b008 Author: Greg Rutz g.rutz@cablelabs.com Date: Wed Dec 3 08:44:50 2014 -0700

Checkpoint check-in for EME abstraction code

Merge request reports