Skip to content

Commit

Permalink
Kev testing AES128 cbc on fMP4 HEVC
Browse files Browse the repository at this point in the history
  • Loading branch information
kevleyski committed Sep 4, 2024
1 parent 1eda8c0 commit e0fa568
Show file tree
Hide file tree
Showing 17 changed files with 6,092 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test/frag.m4s
test/kevs
test/kevs*
4 changes: 4 additions & 0 deletions Source/Python/test/demo/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
38 changes: 38 additions & 0 deletions Source/Python/test/demo/basic-usage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<html>
<head>
<title>Hls.js demo - basic usage</title>
</head>

<body>
<script src="../dist/hls.js"></script>

<center>
<h1>Hls.js demo - basic usage</h1>
<video height="600" id="video" controls></video>
</center>

<script>
var video = document.getElementById('video');
if (Hls.isSupported()) {
var hls = new Hls({
debug: true,
});
hls.loadSource('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8');
hls.attachMedia(video);
hls.on(Hls.Events.MEDIA_ATTACHED, function () {
video.muted = true;
video.play();
});
}
// hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element through the `src` property.
// This is using the built-in support of the plain video element, without using hls.js.
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8';
video.addEventListener('canplay', function () {
video.play();
});
}
</script>
</body>
</html>
68 changes: 68 additions & 0 deletions Source/Python/test/demo/benchmark.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title></title>
</head>
<body>
<script src="../dist/hls.js"></script>
<video id="video" controls></video>
<script>
function parseQuery(queryString) {
var query = {};
var pairs = (
queryString[0] === '?' ? queryString.slice(1) : queryString
).split('&');
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
query[decodeURIComponent(pair[0])] = decodeURIComponent(
pair[1] || ''
);
}
return query;
}

/* get stream from query string */
function getParameterByName(name) {
var query = parseQuery(window.location.search);
return query.hasOwnProperty(name) ? query[name] : undefined;
}

var stream =
getParameterByName('stream') ||
'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8';
</script>
<script>
if (Hls.isSupported()) {
var video = document.getElementById('video');
var hls = new Hls();
hls.loadSource(stream);
hls.attachMedia(video);
hls.on(Hls.Events.MEDIA_ATTACHED, function () {
video.muted = true;
video.play();
});
}
</script>
<script>
var video = document.getElementById('video');
window.onload = function () {
var i = 0;
var el = document.getElementById('update');
function foo() {
i++;
el.innerHTML =
'animation:' +
i +
',decoded:' +
video.webkitDecodedFrameCount +
',dropped:' +
video.webkitDroppedFrameCount;
window.requestAnimationFrame(foo);
}
foo();
};
</script>
<div id="update"></div>
</body>
</html>
Loading

0 comments on commit e0fa568

Please sign in to comment.