Skip to content

Revamp protection events and general stability enhancements

Created by: greg80303

These changes contain several major improvements to the protection system along with several minor stability-related enhancements.

  • ProtectionController now uses EventBus as its event delivery mechanism
    • MediaPlayer.depedencies.ProtectionController.events contains the list of events that are available to applications
    • Subscribe/Unsubscribe from events using ProtectionController.addEventListener and ProtectionController.removeEventListener
    • The EME demo application (samples/dash-if-reference-player/eme.html) has been updated to use the new event system
  • Previously, EventBus was a dijon singleton. Now that it is used by ProtectionController (which is not a singleton), EventBus uses a class mapping. This causes several headaches when dealing with dijon and our testing system
    • In order to avoid renaming all of the injection points for eventBus throughout the codebase, the dijon mapping was renamed to eventBusCl and a single instance is created by MediaPlayer and mapped to the old eventBus outlet name.
    • This manual mapping technique forced a manual injection of any outlets within EventBus
    • The Jasmine unit tests were updated to perform this same manual mapping performed in MediaPlayer
  • To allow applications to receive events from ProtectionControllers created by the player, MediaPlayer now supports 2 additional events (MediaPlayer.events.PROTECTION_CREATED and MediaPlayer.events.PROTECTION_DESTROYED).
  • The EME demo application has been greatly improved.
    • The protection information windows will update for media that is played normally and for media in which licenses were pre-fetched
    • A green highlight will appear around the protection information window for the currently playing media
    • The Play button in the session window will be deactivated when keys could not be pre-fetched for that media (e.g. when the media has no initialization data in the MPD)
    • The app will listen for events from the player that indicate when protection systems have been created or destroyed and it will update its protection information window set automatically
  • Several updates to the protection system teardown mechanism. This should further improve the stability of the system when switching between different media (encrypted and unecrypted) without reloading the page.
    • Even when the player did not create the protection system, we still need to "detach" the protection system from the video element when doing a reset. This was not being done previously. This includes unregistering for needkey/encrypted events and clearing MediaKeys (if allowed by the EME implementation).
  • Modified error reporting in several protection events to make them consistent with the rest of the protection system
  • Updated min files since this is quite a significant change and I would like users to be able to easily test and run with the EME demo app (which uses the min files)

Merge request reports