зеркало из https://github.com/mozilla/js_mse_eme.git
Added tip license delay test for no clear start H264 and VP9 streams.
Change-Id: I3625ac6d8fc224ffad905ecdfd56086c0df3b0f6
This commit is contained in:
Родитель
61ffdf23b8
Коммит
f83f811451
|
@ -24,6 +24,7 @@ EMEHandler.prototype.init = function(video, licenseManager) {
|
|||
this.keyUnusable = false;
|
||||
this.keyCount = 0;
|
||||
this.keySessions = [];
|
||||
this.licenseDelay = 10; // In milliseconds.
|
||||
|
||||
video.addEventListener('encrypted', this.onEncrypted.bind(this));
|
||||
|
||||
|
@ -88,8 +89,11 @@ EMEHandler.prototype.onMessage = function(event) {
|
|||
|
||||
var keySession = event.target;
|
||||
var message = event.message;
|
||||
var licenseDelay = this.licenseDelay;
|
||||
this.licenseManager.acquireLicense(message, function(license) {
|
||||
setTimeout(function() {
|
||||
keySession.update(license);
|
||||
}, licenseDelay);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ var Media = (function() {
|
|||
0x7e, 0x57, 0xd0, 0x0d, 0x1e, 0xd0, 0x0d, 0x1e])}],
|
||||
VideoStreamYTCenc: ['media/oops_cenc-20121114-145-no-clear-start.mp4', 39980507, 242.71, {
|
||||
'mimeType': 'video/mp4; codecs="avc1.4d401f"',
|
||||
'video_id': '03681262dc412c06',
|
||||
'widevine_signature': '9C4BE99E6F517B51FED1F0B3B31966D3C5DAB9D6.6A1F30BB35F3A39A4CA814B731450D4CBD198FFD',
|
||||
'key': util.createUint8ArrayFromJSArray([233, 122, 210, 133, 203, 93, 59, 228,
|
||||
167, 150, 27, 122, 246, 145, 112, 218])}],
|
||||
VideoTinyStreamYTCenc: ['media/oops_cenc-20121114-145-143.mp4', 7229257, 30.03, {
|
||||
|
|
|
@ -200,6 +200,40 @@ testWidevineH264MultiMediaKeySessions.prototype.start = function(runner, video)
|
|||
};
|
||||
|
||||
|
||||
var createWidevineLicenseDelayTest = function(videoStream) {
|
||||
var test = createEmeTest(
|
||||
'WidevineLicenseDelay' + videoStream.codec + 'Video', 'Widevine');
|
||||
test.prototype.title = 'Test if we can play video encrypted with Widevine ' +
|
||||
'encryption with no clear start and 5 seconds license delay.';
|
||||
test.prototype.start = function(runner, video) {
|
||||
var testEmeHandler = this.emeHandler;
|
||||
var audioStream = Media.AAC.AudioNormal;
|
||||
try {
|
||||
setupMse(video, runner, videoStream, audioStream);
|
||||
var licenseManager = new LicenseManager(video, videoStream,
|
||||
LicenseManager.WIDEVINE);
|
||||
testEmeHandler.init(video, licenseManager);
|
||||
testEmeHandler.licenseDelay = 5000;
|
||||
} catch(err) {
|
||||
runner.fail(err);
|
||||
}
|
||||
video.addEventListener('timeupdate', function onTimeUpdate(e) {
|
||||
if (!video.paused && video.currentTime >= 15 &&
|
||||
!testEmeHandler.keyUnusable) {
|
||||
video.removeEventListener('timeupdate', onTimeUpdate);
|
||||
runner.checkGE(video.currentTime, 15, 'currentTime');
|
||||
runner.succeed();
|
||||
}
|
||||
});
|
||||
video.play();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
createWidevineLicenseDelayTest(Media.H264.VideoStreamYTCenc);
|
||||
createWidevineLicenseDelayTest(Media.VP9.VideoHighSubSampleEnc);
|
||||
|
||||
|
||||
var createWidevineVideoTest = function(videoStream, desc) {
|
||||
var test = createEmeTest('Widevine' + desc + 'Video', 'Widevine Video Formats');
|
||||
test.prototype.title =
|
||||
|
|
Загрузка…
Ссылка в новой задаче