Skip to content

Commit

Permalink
Add debug flag for mse players (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-bartkowiak-epam committed Jul 25, 2023
1 parent 0e269ec commit 86bb828
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 50 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ There are six media test templates:
- `Pause` - verifies if browser is capable of pausing a stream,
- `PlayRate` - verifies playback with various playback rates,
- `Seek` - executes seek operation,
- `AudioTracks` - changes audio track,
- `Subtitles` - activates text tracks and verifies its content.
- `AudioTracks` - changes audio track,
- `Subtitles` - activates text tracks and verifies its content.

During test execution, test runner logs are printed into JavaScript console and into a div below tests list.
The video under test can be observed on the right-hand side of main view.
Expand Down Expand Up @@ -152,15 +152,15 @@ Most of the URL parameters can be combined. Here's a full list of supported quer
- Single test id e.g. `testnames=DASH_FMP4_AVC_AAC__Playback`
- Multiple test ids e.g. `testnames=DASH_FMP4_AVC_AC3__Seek,DASH_FMP4_AVC_AAC__Playback,DASH_DYNAMIC`
- `exclude=ID[,ID]|ID-ID2` - exclude subsets of tests.
- `checkframes=false|true` - enable verification of video frames progress based on `video.getVideoPlaybackQuality().totalVideoFrames`.
- `loop=false|true` - enable testing selected tests continuosly in a loop.
- `stoponfailure=false|true` - tests execution will stop on the first failed test.
- `disable_log=false|true` - enable/disable logging.
- `engine_shaka=3.0.1|3.2.1|4.3.6` - select Shaka Player version. Please note it will only affect Shaka test suites.
- `engine_dashjs=3.1.1|4.4.0|4.7.0|latest` - select dash.js version. Please note it will only affect dash.js test suites.
- `engine_hlsjs=1.0.0|1.2.1|1.3.0|1.4.5` - select hls.js version. Please note it will only affect hls.js test suites.
- `profile=all|default|desktop|extended_drm` - depends of tested unit.
- `debug=true|false` - adding additional timestamps to the output log.
- `checkframes=false|true` - [default: false] enable verification of video frames progress based on `video.getVideoPlaybackQuality().totalVideoFrames`.
- `loop=false|true` - [default: false] enable testing selected tests continuosly in a loop.
- `stoponfailure=false|true` - [default: false] tests execution will stop on the first failed test.
- `disable_log=false|true` - [default: false] enable/disable logging.
- `engine_shaka=3.0.1|3.2.1|4.3.6` - [default: 3.2.1] select Shaka Player version. Please note it will only affect Shaka test suites.
- `engine_dashjs=3.1.1|4.4.0|4.7.0|latest` - [default: 4.7.0] select dash.js version. Please note it will only affect dash.js test suites.
- `engine_hlsjs=1.0.0|1.2.1|1.3.0|1.4.5` - [default: 1.4.5] select hls.js version. Please note it will only affect hls.js test suites.
- `profile=all|default|desktop|extended_drm` - [default: default] depends of tested unit.
- `debug=true|false` - [default: false] enabling the debug logs for MSE players (shaka, dash.js, hls.js) and adding additional timestamps to the output log.

### JavaScript API

Expand Down
2 changes: 1 addition & 1 deletion anyplayer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
href="/anyplayer/?player=hlsjs&url=/test-materials/hls/widevine/cenc/manifest.m3u8&drm=Widevine&drm_license=https://proxy.uat.widevine.com/proxy">
Widevine <span class="mx-3 text-dark-emphasis">[ CENC encryption ]</span></a>
<a class="list-group-item font-sm py-1px focusable"
href="/anyplayer/?player=hlsjs&url=/test-materials/hls/widevine/cbcs/manifest.mpd&drm=Widevine&drm_license=https://proxy.uat.widevine.com/proxy">
href="/anyplayer/?player=hlsjs&url=/test-materials/hls/widevine/cbcs/manifest.m3u8&drm=Widevine&drm_license=https://proxy.uat.widevine.com/proxy">
Widevine <span class="mx-3 text-dark-emphasis">[ CBCS encryption ]</span></a>
</div>
</div>
Expand Down
52 changes: 32 additions & 20 deletions patches/0001_js_mse_eme_mvt.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
From a23d4dc0509741b885c364b5f09c770f36421f61 Mon Sep 17 00:00:00 2001
From: Lukasz Rutkowski <lrutkowski.contractor@libertyglobal.com>
Date: Fri, 21 Jul 2023 16:12:47 +0200
From 296f3e299ba03246efb6eb30c570383f80dec26c Mon Sep 17 00:00:00 2001
From: Pawel Bartkowiak <pbartkowiak.contractor@libertyglobal.com>
Date: Mon, 24 Jul 2023 15:44:41 +0200
Subject: [PATCH] MVT patch

---
harness/compactTestList.js | 2 +-
harness/compactTestView.js | 34 ++++------
harness/compactTestView.js | 35 ++++------
harness/constants.js | 3 +-
harness/main.js | 51 ++++++++++++--
harness/main.js | 51 +++++++++++++--
harness/test.js | 45 ++++---------
harness/testView.js | 57 +++++++++++-----
harness/testView.js | 65 +++++++++++++-----
harness/timeout.js | 9 +++
style.css | 133 +++++++++++++++++++++++++------------
8 files changed, 214 insertions(+), 120 deletions(-)
style.css | 131 +++++++++++++++++++++++++------------
8 files changed, 222 insertions(+), 119 deletions(-)

diff --git a/harness/compactTestList.js b/harness/compactTestList.js
index 157ef5d..ba3432f 100644
Expand All @@ -28,7 +28,7 @@ index 157ef5d..ba3432f 100644
];
tr.appendChild(elems[0]);
diff --git a/harness/compactTestView.js b/harness/compactTestView.js
index 77f7b68..2689de9 100644
index 77f7b68..9ebecb8 100644
--- a/harness/compactTestView.js
+++ b/harness/compactTestView.js
@@ -1,6 +1,7 @@
Expand All @@ -39,11 +39,12 @@ index 77f7b68..2689de9 100644
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,39 +35,30 @@ var compactTestView = (function() {
@@ -34,39 +35,31 @@ var compactTestView = (function() {
if (harnessConfig.controlMediaFormatSelection) {
this.addSwitch('WebM/VP9: ', 'enablewebm');
}
+ this.addSwitch('Check frames: ', 'checkframes');
+ this.addSwitch('Debug: ', 'debug');

this.addCommand('Run All', 'run-selected', 'Run all tests in order.',
function(e) {
Expand Down Expand Up @@ -355,7 +356,7 @@ index b781e31..17631cc 100644

this.timeouts.clearAll();
diff --git a/harness/testView.js b/harness/testView.js
index c040757..5ca672e 100644
index c040757..38b826d 100644
--- a/harness/testView.js
+++ b/harness/testView.js
@@ -1,6 +1,7 @@
Expand Down Expand Up @@ -406,7 +407,21 @@ index c040757..5ca672e 100644
document.body.appendChild(createElement('div', 'testview'));

var div = document.getElementById(this.divId);
@@ -149,14 +146,42 @@ function TestView(testSuiteVer) {
@@ -144,19 +141,55 @@ function TestView(testSuiteVer) {
var wasOff = !util.stringToBoolean(e.target.innerHTML);
e.target.innerHTML = wasOff ? 'on' : 'off';
harnessConfig[id] = wasOff;
+ if (id == "debug"){
+ let queryParams = new URLSearchParams(window.location.search);
+ queryParams.set("debug", harnessConfig.debug);
+ let url = `${location.origin}${location.pathname}?` + queryParams.toString();
+ function setUrl(url) {
+ location.href = url;
+ }
+ switchDiv.lastChild.onclick = setUrl(url);
+ }
};
})(id);
switchDiv.lastChild.exec = switchDiv.lastChild.onclick;
}
for (var i = 0; i < selectors.length; ++i) {
Expand Down Expand Up @@ -435,7 +450,6 @@ index c040757..5ca672e 100644
+ }
+
+ var profilesDiv = document.getElementById('profiles');
+ console.log(Profiles)
+ var title = createElement('span', 'profiles_select', 'bold', 'Profile: ');
+ profilesDiv.appendChild(title);
+ for (var profile in Profiles) {
Expand Down Expand Up @@ -486,7 +500,7 @@ index 7c373c1..b4167ca 100644
var interval = getUniqueItem(intervals);
interval.func = func;
diff --git a/style.css b/style.css
index 79f5cb1..636deb0 100644
index 79f5cb1..3f72d89 100644
--- a/style.css
+++ b/style.css
@@ -17,12 +17,13 @@
Expand Down Expand Up @@ -722,14 +736,12 @@ index 79f5cb1..636deb0 100644
- width: 1400px;
+ height: 450px;
+ width: 800px;
}
-}
+ }
+
+ .box-right {
+ width: 600px;
+ }
+}
\ No newline at end of file
}
}
--
2.25.1
2.35.1.windows.2

30 changes: 19 additions & 11 deletions src/engines.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ class DashjsEngine extends Engine {
});

this.dashjsPlayer.initialize(video, media.src, false);
if (harnessConfig.debug) {
this.dashjsPlayer.updateSettings({
debug: {
logLevel: dashjs.Debug.LOG_LEVEL_INFO,
},
});
}

if (media.drm) {
this.dashjsPlayer.setProtectionData(media.drm.servers);
Expand Down Expand Up @@ -311,20 +318,21 @@ class HlsjsEngine extends Engine {
test.prototype.start = function (runner, video) {
var that = this;

let config = {
enableWorker: true, // enable ABR
};

if (media.widevine) {
this.hls = new Hls({
enableWorker: true, // enable ABR
lowLatencyMode: true,
backBufferLength: 90,
widevineLicenseUrl: media.drm.servers["com.widevine.alpha"].serverURL,
emeEnabled: true,
});
} else {
this.hls = new Hls({
enableWorker: true, // enable ABR
});
config.lowLatencyMode = true;
config.backBufferLength = 90;
config.widevineLicenseUrl = media.drm.servers["com.widevine.alpha"].serverURL;
config.emeEnabled = true;
}

config.debug = harnessConfig.debug;

this.hls = new Hls(config);

this.hls.loadSource(media.src);
this.hls.attachMedia(video);
this.hls.on(Hls.Events.MANIFEST_PARSED, function () {
Expand Down
26 changes: 19 additions & 7 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,44 @@

"use strict";

let debug = getQueryVariable("debug");
let shakaPlayerScript;
let dashjsPlayerScript;

if (debug == "true") {
shakaPlayerScript = "shaka-player.compiled.debug.js";
dashjsPlayerScript = "dash.all.debug.js";
} else {
shakaPlayerScript = "shaka-player.compiled.js";
dashjsPlayerScript = "dash.all.min.js";
}

var EngineVersions = {
shaka: {
versions: {
// mux.js is required by Shaka Player to support MPEG-2 TS
"3.0.1": [
"https://cdnjs.cloudflare.com/ajax/libs/mux.js/6.3.0/mux.min.js",
"https://ajax.googleapis.com/ajax/libs/shaka-player/3.0.1/shaka-player.compiled.js",
`https://ajax.googleapis.com/ajax/libs/shaka-player/3.0.1/${shakaPlayerScript}`,
],
"3.2.1": [
"https://cdnjs.cloudflare.com/ajax/libs/mux.js/6.3.0/mux.min.js",
"https://ajax.googleapis.com/ajax/libs/shaka-player/3.2.1/shaka-player.compiled.js",
`https://ajax.googleapis.com/ajax/libs/shaka-player/3.2.1/${shakaPlayerScript}`,
],
"4.3.6": [
"https://cdnjs.cloudflare.com/ajax/libs/mux.js/6.3.0/mux.min.js",
"https://ajax.googleapis.com/ajax/libs/shaka-player/4.3.6/shaka-player.compiled.js",
`https://ajax.googleapis.com/ajax/libs/shaka-player/4.3.6/${shakaPlayerScript}`,
],
},
name: "Shaka Player",
defaultVersion: "3.2.1",
},
dashjs: {
versions: {
"3.1.1": ["https://cdn.dashjs.org/v3.1.1/dash.all.min.js", "https://cdn.dashjs.org/v3.1.1/dash.mss.min.js"],
"4.4.0": ["https://cdn.dashjs.org/v4.4.0/dash.all.min.js", "https://cdn.dashjs.org/v4.4.0/dash.mss.min.js"],
"4.7.0": ["https://cdn.dashjs.org/v4.7.0/dash.all.min.js", "https://cdn.dashjs.org/v4.7.0/dash.mss.min.js"],
latest: ["https://cdn.dashjs.org/latest/dash.all.min.js", "https://cdn.dashjs.org/latest/dash.mss.min.js"],
"3.1.1": [`https://cdn.dashjs.org/v3.1.1/${dashjsPlayerScript}`, "https://cdn.dashjs.org/v3.1.1/dash.mss.min.js"],
"4.4.0": [`https://cdn.dashjs.org/v4.4.0/${dashjsPlayerScript}`, "https://cdn.dashjs.org/v4.4.0/dash.mss.min.js"],
"4.7.0": [`https://cdn.dashjs.org/v4.7.0/${dashjsPlayerScript}`, "https://cdn.dashjs.org/v4.7.0/dash.mss.min.js"],
latest: [`https://cdn.dashjs.org/latest/${dashjsPlayerScript}`, "https://cdn.dashjs.org/latest/dash.mss.min.js"],
},
name: "Dash.JS",
defaultVersion: "4.7.0",
Expand Down

0 comments on commit 86bb828

Please sign in to comment.