-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* screencast support (fixes #43): - add NewWindowPage concurrency mode to support opening new window, and also reusing pages - add --screencastPort cli options to enable screencasting, uses websockets to stream frames to client - concurrency: add separate 'window' concurrency for opening new window per-page in same session, useful for screencasting with multiple workers but within same session * add warning if using screencasting + more than one worker + page context, recommend 'window' * cleanup: remove debug console, bump py-wacz dependency, improve close message * README: add screencasting info to README
- Loading branch information
Showing
8 changed files
with
4,839 additions
and
4,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pywb>=2.5.0 | ||
git+https://github.com/webrecorder/pywb@main | ||
uwsgi | ||
wacz>=0.2.1 | ||
wacz>=0.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<style> | ||
#content { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
} | ||
#content img { | ||
width: 640px; | ||
height: 480px; | ||
margin: 2rem; | ||
} | ||
</style> | ||
<script> | ||
const ws = new WebSocket(window.location.origin.replace("http", "ws") + "/ws"); | ||
ws.addEventListener("message", (event) => handleMessage(event.data)); | ||
|
||
const unusedElems = []; | ||
|
||
function handleMessage(resp) { | ||
resp = JSON.parse(resp); | ||
|
||
switch (resp.msg) { | ||
case "newTarget": | ||
case "screencast": | ||
img = createImage(resp.id); | ||
if (resp.data) { | ||
setImageData(img, resp.data); | ||
} | ||
break; | ||
|
||
case "endTarget": | ||
img = unuseImage(resp.id); | ||
break; | ||
} | ||
} | ||
|
||
function setImageData(img, data) { | ||
//img.style.display = ""; | ||
img.src = "data:image/png;base64," + data; | ||
} | ||
|
||
function createImage(id) { | ||
let elem = document.getElementById(id); | ||
if (elem) { | ||
return elem; | ||
} | ||
|
||
if (unusedElems.length) { | ||
elem = unusedElems.shift(); | ||
elem.setAttribute("id", id); | ||
return elem; | ||
} | ||
|
||
elem = document.createElement("img"); | ||
elem.setAttribute("id", id); | ||
document.getElementById("content").appendChild(elem); | ||
return elem; | ||
} | ||
|
||
function unuseImage(id) { | ||
const elem = document.getElementById(id); | ||
if (!elem) { | ||
return; | ||
} | ||
//elem.style.display = "none"; | ||
unusedElems.push(elem); | ||
} | ||
</script> | ||
<head> | ||
<body> | ||
<div id="content"> | ||
</div> | ||
</body> |
Oops, something went wrong.