Fix #1224 - only set non-empty MediaCapabilities on MediaKeySystemConfiguration
Created by: davemevans
It seems that passing []
as a MediaKeySystemMediaCapability
in MediaKeySystemConfiguration
causes the requestMediaKeySystemAccess
call to fail with NotSupportedError.
See #1224 (closed) and discussion on Slack today (19/9/2016) for background.
This PR checks whether the capabilities are empty and does not include them in the configuration object in that case.
I have tested this on Chrome with both clearkey and widevine. It'd be great if someone could take a look with other UA/CDM instances.