mirror of
https://github.com/SrIzan10/vdo.ninja.git
synced 2026-05-01 11:05:24 +00:00
WHEP PATCH tweak; media to file recording fix
This commit is contained in:
5
thirdparty/StreamSaver.js
vendored
5
thirdparty/StreamSaver.js
vendored
@@ -98,7 +98,7 @@ function streamSaverFunction(){
|
||||
}
|
||||
|
||||
channel.port1.onmessage = evt => {
|
||||
console.log(evt);
|
||||
//console.log(evt);
|
||||
// Service worker sent us a link that we should open.
|
||||
if (evt.data.download) {
|
||||
// Special treatment for popup...
|
||||
@@ -213,7 +213,7 @@ function streamSaverFunction(){
|
||||
WritableStream: global.WritableStream || ponyfill.WritableStream,
|
||||
supported: true,
|
||||
version: { full: '2.0.7', major: 2, minor: 0, dot: 7 },
|
||||
mitm: './thirdparty/mitm.html?v=3'
|
||||
mitm: './thirdparty/mitm.html?v=4'
|
||||
}
|
||||
|
||||
//console.log(streamSaver);
|
||||
@@ -232,6 +232,7 @@ function streamSaverFunction(){
|
||||
iframe.loaded = false
|
||||
iframe.name = 'iframe'
|
||||
iframe.isIframe = true
|
||||
iframe.credentialless = true
|
||||
iframe.postMessage = (...args) => iframe.contentWindow.postMessage(...args)
|
||||
iframe.addEventListener('load', () => {
|
||||
iframe.loaded = true
|
||||
|
||||
7
thirdparty/mitm.html
vendored
7
thirdparty/mitm.html
vendored
@@ -41,7 +41,7 @@ let scope = ''
|
||||
|
||||
function registerWorker() {
|
||||
return navigator.serviceWorker.getRegistration('./').then(swReg => {
|
||||
return swReg || navigator.serviceWorker.register('sw.js', { scope: './' })
|
||||
return swReg || navigator.serviceWorker.register('sw.js?v=2', { scope: './' })
|
||||
}).then(swReg => {
|
||||
const swRegTmp = swReg.installing || swReg.waiting
|
||||
|
||||
@@ -63,6 +63,11 @@ function registerWorker() {
|
||||
function onMessage (event) {
|
||||
let { data, ports, origin } = event
|
||||
|
||||
// Ignore messages other than from iframe parent (e.g. extensions)
|
||||
if (event.source !== window.parent) {
|
||||
return
|
||||
}
|
||||
|
||||
// It's important to have a messageChannel, don't want to interfere
|
||||
// with other simultaneous downloads
|
||||
if (!ports || !ports.length) {
|
||||
|
||||
Reference in New Issue
Block a user