mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-16 16:18:30 +00:00
Add files via upload
This commit is contained in:
parent
2411804868
commit
6e504a7f65
10
index.html
10
index.html
@ -57,7 +57,7 @@
|
||||
<link rel="stylesheet" href="./main.css?ver=152" />
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.min.js"></script>
|
||||
<style id="lightbox-animations" type="text/css"></style>
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<!-- <link rel="manifest" href="manifest.json" /> -->
|
||||
<!-- ios support
|
||||
<link rel="apple-touch-icon" href="images/icons/icon-72x72.png" />
|
||||
<link rel="apple-touch-icon" href="images/icons/icon-96x96.png" />
|
||||
@ -79,7 +79,7 @@
|
||||
<link itemprop="url" href="./media/vdoNinja_logo_full.png" />
|
||||
</span>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/CodecsHandler.js?ver=37"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=350"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=367"></script>
|
||||
<input id="zoomSlider" type="range" style="display: none;" />
|
||||
<div id="header">
|
||||
|
||||
@ -1932,7 +1932,7 @@
|
||||
|
||||
|
||||
var session = WebRTC.Media; // session is a required global variable if configuring manually. Run before loading main.js but after webrtc.js.
|
||||
session.version = "20.6";
|
||||
session.version = "20.7";
|
||||
session.streamID = session.generateStreamID(); // randomly generates a streamID for this session. You can set your own programmatically if needed
|
||||
|
||||
session.defaultPassword = "someEncryptionKey123"; // Change this password if self-deploying for added security/privacy
|
||||
@ -1998,11 +1998,11 @@
|
||||
// session.lowBitrateCutoff = 300; // Set a minimum bitrate (in kbps) before the stream is hidden. Useful for IRL streams maybe
|
||||
</script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/aes.js"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=261"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=263"></script>
|
||||
<!--
|
||||
// If you wish to change branding, blank offers a good clean start.
|
||||
<script type="text/javascript" id="main-js" src="./main.js" data-translation="blank"></script>
|
||||
-->
|
||||
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=299"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=301"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
99
lib.js
99
lib.js
@ -1622,7 +1622,7 @@ function updateQueue(adding=false){
|
||||
playtone();
|
||||
}
|
||||
getById("queuebutton").classList.remove("shake");
|
||||
setTimeout(function(){getById("queuebutton").classList.add("shake");},0);
|
||||
setTimeout(function(){getById("queuebutton").classList.add("shake");},10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4437,7 +4437,7 @@ async function jumptoroom2() {
|
||||
} else {
|
||||
getById("videoname1").focus();
|
||||
getById("videoname1").classList.remove("shake");
|
||||
setTimeout(function(){getById("videoname1").classList.add("shake");},0);
|
||||
setTimeout(function(){getById("videoname1").classList.add("shake");},10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4473,7 +4473,7 @@ async function jumptoroom(event = null) {
|
||||
} else {
|
||||
getById("joinroomID").focus();
|
||||
getById("joinroomID").classList.remove("shake");
|
||||
setTimeout(function(){getById("joinroomID").classList.add("shake");},0);
|
||||
setTimeout(function(){getById("joinroomID").classList.add("shake");},10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -10111,7 +10111,7 @@ function createRoom(roomname = false) {
|
||||
|
||||
getById("videoname1").focus();
|
||||
getById("videoname1").classList.remove("shake");
|
||||
setTimeout(function(){getById("videoname1").classList.add("shake");},0);
|
||||
setTimeout(function(){getById("videoname1").classList.add("shake");},10);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -19476,7 +19476,11 @@ function requestBasicPermissions(constraint = {video: true, audio: true}) {
|
||||
//permission denied in browser
|
||||
if (!(session.cleanOutput)) {
|
||||
setTimeout(function() {
|
||||
warnUser("Permissions denied. Please ensure you have allowed the mic/camera permissions.");
|
||||
if (window.obsstudio){
|
||||
warnUser("Permissions denied.\n\nTo access the camera or microphone from within OBS, please refer to:\n<a href='https://docs.vdo.ninja/guides/share-webcam-from-inside-obs'>docs.vdo.ninja/guides/share-webcam-from-inside-obs</a>.");
|
||||
} else {
|
||||
warnUser("Permissions denied. Please ensure you have allowed the mic/camera permissions.");
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
return;
|
||||
@ -20915,19 +20919,25 @@ async function recordVideo(target, event, videoKbps = false) { // event.currentT
|
||||
return;
|
||||
}
|
||||
|
||||
const {readable, writable} = new TransformStream({
|
||||
transform: (chunk, ctrl) => chunk.arrayBuffer().then(b => ctrl.enqueue(new Uint8Array(b)))
|
||||
});
|
||||
readable.pipeTo(streamSaver.createWriteStream(filename + '.webm'));
|
||||
|
||||
var writer = writable.getWriter();
|
||||
video.recorder.writer = writer;
|
||||
video.recorder.stop = function() {
|
||||
video.recorder.stop = function(restart = false, notify = false) {
|
||||
if (!video.recording) {
|
||||
errorlog("ALREADY STOPPED");
|
||||
updateLocalRecordButton(UUID, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (notify){
|
||||
if (!session.cleanOutput){
|
||||
warnUser("A local recording has stopped unexpectedly.");
|
||||
}
|
||||
if (session.beepToNotify){
|
||||
playtone();
|
||||
|
||||
}
|
||||
target.classList.remove("shake");
|
||||
setTimeout(function(target){target.classList.add("shake");},10, target);
|
||||
}
|
||||
|
||||
video.recording = false;
|
||||
updateLocalRecordButton(UUID, -2);
|
||||
try {
|
||||
@ -20967,6 +20977,14 @@ async function recordVideo(target, event, videoKbps = false) { // event.currentT
|
||||
delete(video1.recording);
|
||||
}, 1200, writer, UUID, video);
|
||||
};
|
||||
|
||||
const {readable, writable} = new TransformStream({
|
||||
transform: (chunk, ctrl) => chunk.arrayBuffer().then(b => ctrl.enqueue(new Uint8Array(b)))
|
||||
});
|
||||
var writer = writable.getWriter();
|
||||
readable.pipeTo(streamSaver.createWriteStream(filename.toString() + '.webm', video.recorder.stop));
|
||||
video.recorder.writer = writer;
|
||||
pokeIframeAPI("recording-started");
|
||||
|
||||
let options = {};
|
||||
|
||||
@ -21085,7 +21103,18 @@ function updateRemoteRecordButton(UUID, recorder) {
|
||||
var elements = document.querySelectorAll('[data-action-type="recorder-remote"][data--u-u-i-d="' + UUID + '"]');
|
||||
if (elements[0]) {
|
||||
var time = parseInt(recorder) || 0;
|
||||
if (time == -3) {
|
||||
if (time == -4) {
|
||||
if (!session.cleanOutput){
|
||||
warnUser("A remote recording has stopped unexpectedly.\n\nDid a user cancel the file downlaod?");
|
||||
}
|
||||
if (session.beepToNotify){
|
||||
playtone();
|
||||
}
|
||||
elements[0].classList.add("pressed");
|
||||
elements[0].classList.remove("shake");
|
||||
elements[0].innerHTML = '<i class="las la-stop-circle"></i> stopping...';
|
||||
setTimeout(function(ele){ele.classList.add("shake");},10,elements[0]);
|
||||
} else if (time == -3) {
|
||||
elements[0].classList.remove("pressed");
|
||||
elements[0].disabled = true;
|
||||
elements[0].innerHTML = '<i class="lab la-apple"></i> Not Supported';
|
||||
@ -21094,7 +21123,6 @@ function updateRemoteRecordButton(UUID, recorder) {
|
||||
warnUser('The remote browser does not support recording.\n\nPerhaps try local recording instead.');
|
||||
}, 0);
|
||||
}
|
||||
|
||||
} else if (time == -2) {
|
||||
elements[0].classList.add("pressed");
|
||||
elements[0].innerHTML = '<i class="las la-stop-circle"></i> stopping...';
|
||||
@ -21337,16 +21365,7 @@ function recordLocalVideo(action = null, videoKbps = 6000, remote=false) { // ev
|
||||
|
||||
filename += "_" + timestamp.toString();
|
||||
|
||||
const {readable, writable} = new TransformStream({
|
||||
transform: (chunk, ctrl) => chunk.arrayBuffer().then(b => ctrl.enqueue(new Uint8Array(b)))
|
||||
});
|
||||
readable.pipeTo(streamSaver.createWriteStream(filename.toString() + '.webm'));
|
||||
|
||||
var writer = writable.getWriter();
|
||||
video.recorder.writer = writer;
|
||||
pokeIframeAPI("recording-started");
|
||||
|
||||
video.recorder.stop = function(restart = false) {
|
||||
video.recorder.stop = function(restart = false, notify=false) {
|
||||
if (!remote){
|
||||
if (restart){
|
||||
if (getById("recordLocalbutton").dataset.state == 2) {
|
||||
@ -21363,6 +21382,17 @@ function recordLocalVideo(action = null, videoKbps = 6000, remote=false) { // ev
|
||||
getById("recordLocalbutton").dataset.state = "0";
|
||||
getById("recordLocalbutton").style.backgroundColor = "";
|
||||
getById("recordLocalbutton").innerHTML = '<i class="toggleSize my-float las la-dot-circle" ></i>';
|
||||
if (notify){
|
||||
if (!session.cleanOutput){
|
||||
warnUser("A recording has stopped unexpectedly.");
|
||||
}
|
||||
if (session.beepToNotify){
|
||||
playtone();
|
||||
|
||||
}
|
||||
getById("recordLocalbutton").classList.remove("shake");
|
||||
setTimeout(function(){getById("recordLocalbutton").classList.add("shake");},10);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!video.recording) {
|
||||
@ -21410,7 +21440,11 @@ function recordLocalVideo(action = null, videoKbps = 6000, remote=false) { // ev
|
||||
try {
|
||||
if (session.directorUUID) {
|
||||
var msg = {};
|
||||
msg.recorder = -2;
|
||||
if (notify){
|
||||
msg.recorder = -4; // user aborted
|
||||
} else {
|
||||
msg.recorder = -2;
|
||||
}
|
||||
for (var i = 0;i<session.directorList.length;i++){
|
||||
msg.UUID = session.directorList[i];
|
||||
session.sendMessage(msg, msg.UUID);
|
||||
@ -21420,10 +21454,19 @@ function recordLocalVideo(action = null, videoKbps = 6000, remote=false) { // ev
|
||||
errorlog(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const {readable, writable} = new TransformStream({
|
||||
transform: (chunk, ctrl) => chunk.arrayBuffer().then(b => ctrl.enqueue(new Uint8Array(b)))
|
||||
});
|
||||
var writer = writable.getWriter();
|
||||
readable.pipeTo(streamSaver.createWriteStream(filename.toString() + '.webm', video.recorder.stop));
|
||||
video.recorder.writer = writer;
|
||||
pokeIframeAPI("recording-started");
|
||||
|
||||
let options = {};
|
||||
|
||||
if (videoKbps) {
|
||||
var tryCodec = false;
|
||||
if (session.recordingVideoCodec){
|
||||
|
||||
25
main.js
25
main.js
@ -2621,6 +2621,11 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
}
|
||||
}
|
||||
|
||||
if (urlParams.has("bypass")){
|
||||
session.bypass = true;
|
||||
session.customWSS = true;
|
||||
}
|
||||
|
||||
if (urlParams.has('osc') || urlParams.has('api')) {
|
||||
if (urlParams.get('osc') || urlParams.get('api')) {
|
||||
session.api = urlParams.get('osc') || urlParams.get('api');
|
||||
@ -3200,7 +3205,7 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
|
||||
if (isIFrame) { // reduce CPU load if not needed. //iframe API
|
||||
window.onmessage = function(e) { // iFRAME support
|
||||
log(e);
|
||||
//log(e);
|
||||
try {
|
||||
if ("function" in e.data) { // these are calling in-app functions, with perhaps a callback -- TODO: add callbacks
|
||||
var ret = null;
|
||||
@ -3211,6 +3216,10 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
ret.innerHTML = e.data.value;
|
||||
} else if (e.data.function === "publishScreen") {
|
||||
ret = publishScreen();
|
||||
} else if (e.data.function === "routeMessage"){
|
||||
try {
|
||||
session.ws.onmessage({data: e.data.value});
|
||||
} catch(e){warnlog("handshake not yet setup");}
|
||||
} else if (e.data.function === "eval") {
|
||||
eval(e.data.value); // eval == evil ; feedback welcomed
|
||||
}
|
||||
@ -3819,11 +3828,20 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
|
||||
// Warns user about network going down
|
||||
window.addEventListener("offline", function (e) {
|
||||
warnlog("connection lost");
|
||||
if ((session.view) && (session.permaid === false)) {
|
||||
log("VDO.Ninja has no network connectivity and can't work properly." );
|
||||
} else if (session.scene !== false) {
|
||||
log("VDO.Ninja has no network connectivity and can't work properly." );
|
||||
} else if (!session.cleanOutput) {
|
||||
if (iOS || iPad){
|
||||
for (var UUID in session.pcs){
|
||||
session.pcs[UUID].close();
|
||||
delete(session.pcs[UUID]);
|
||||
session.applySoloChat();
|
||||
applySceneState();
|
||||
}
|
||||
}
|
||||
warnUser("Network connection lost.");
|
||||
} else {
|
||||
log("VDO.Ninja has no network connectivity and can't work properly.");
|
||||
@ -3831,7 +3849,10 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
});
|
||||
|
||||
window.addEventListener("online", function (e) {
|
||||
log("Back ONLINE");
|
||||
closeModal();
|
||||
session.ping();
|
||||
|
||||
});
|
||||
|
||||
function updateConnectionStatus() {
|
||||
@ -4121,7 +4142,7 @@ setTimeout(function(){ // lazy load
|
||||
script.onload = function() {
|
||||
var script = document.createElement('script');
|
||||
document.head.appendChild(script);
|
||||
script.src = "./thirdparty/StreamSaver.js"; // dynamically load this only if its needed. Keeps loading time down.
|
||||
script.src = "./thirdparty/StreamSaver.js?t="+Date.now(); // dynamically load this only if its needed. Keeps loading time down.
|
||||
};
|
||||
script.src = "./thirdparty/polyfill.min.js"; // dynamically load this only if its needed. Keeps loading time down.
|
||||
},0);
|
||||
Loading…
x
Reference in New Issue
Block a user