@uppy/screen-capture
Advanced tools
Comparing version 3.1.3 to 3.2.0
# @uppy/screen-capture | ||
## 3.2.0 | ||
Released: 2024-03-27 | ||
Included in: Uppy v3.24.0 | ||
- @uppy/screen-capture: migrate to TS (Merlijn Vos / #4965) | ||
## 3.0.2 | ||
@@ -4,0 +11,0 @@ |
@@ -0,3 +1,3 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { h } from 'preact'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Control screen capture recording. Will show record or stop button. |
@@ -40,3 +40,3 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
if (this.videoElement) { | ||
this.videoElement.srcObject = undefined; | ||
this.videoElement.srcObject = null; | ||
} | ||
@@ -43,0 +43,0 @@ } |
@@ -7,6 +7,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import RecorderScreen from "./RecorderScreen.js"; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore We don't want TS to generate types for the package.json | ||
const packageJson = { | ||
"version": "3.1.3" | ||
"version": "3.2.0" | ||
}; | ||
import locale from './locale.js'; | ||
import locale from "./locale.js"; | ||
@@ -24,9 +27,29 @@ // Check if screen capturing is supported. | ||
} | ||
/** | ||
* Screen capture | ||
*/ | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints | ||
const defaultOptions = { | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#Properties_of_shared_screen_tracks | ||
displayMediaConstraints: { | ||
video: { | ||
width: 1280, | ||
height: 720, | ||
frameRate: { | ||
ideal: 3, | ||
max: 5 | ||
}, | ||
cursor: 'motion', | ||
displaySurface: 'monitor' | ||
} | ||
}, | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints/audio | ||
userMediaConstraints: { | ||
audio: true | ||
}, | ||
preferredVideoMimeType: 'video/webm' | ||
}; | ||
export default class ScreenCapture extends UIPlugin { | ||
constructor(uppy, opts) { | ||
super(uppy, opts); | ||
super(uppy, { | ||
...defaultOptions, | ||
...opts | ||
}); | ||
this.mediaDevices = getMediaDevices(); | ||
@@ -41,31 +64,2 @@ // eslint-disable-next-line no-restricted-globals | ||
// set default options | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints | ||
const defaultOptions = { | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#Properties_of_shared_screen_tracks | ||
displayMediaConstraints: { | ||
video: { | ||
width: 1280, | ||
height: 720, | ||
frameRate: { | ||
ideal: 3, | ||
max: 5 | ||
}, | ||
cursor: 'motion', | ||
displaySurface: 'monitor' | ||
} | ||
}, | ||
// https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints/audio | ||
userMediaConstraints: { | ||
audio: true | ||
}, | ||
preferredVideoMimeType: 'video/webm' | ||
}; | ||
// merge default options with the ones set by user | ||
this.opts = { | ||
...defaultOptions, | ||
...opts | ||
}; | ||
// i18n | ||
@@ -125,3 +119,5 @@ this.i18nInit(); | ||
// into Dashboard (could be other parent UI plugin) | ||
// @ts-expect-error we can't know Dashboard types here | ||
if (this.parent && this.parent.hideAllPanels) { | ||
// @ts-expect-error we can't know Dashboard types here | ||
this.parent.hideAllPanels(); | ||
@@ -193,2 +189,5 @@ this.captureActive = false; | ||
this.selectVideoStreamSource().then(videoStream => { | ||
if (videoStream === false) { | ||
throw new Error('No video stream available'); | ||
} | ||
// Attempt to use the passed preferredVideoMimeType (if any) during recording. | ||
@@ -243,3 +242,5 @@ // If the browser doesn't support it, we'll fall back to the browser default instead | ||
// into Dashboard (could be other parent UI plugin) | ||
// @ts-expect-error we can't know Dashboard types here | ||
if (this.parent && this.parent.hideAllPanels) { | ||
// @ts-expect-error we can't know Dashboard types here | ||
this.parent.hideAllPanels(); | ||
@@ -246,0 +247,0 @@ } |
@@ -0,3 +1,4 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { h } from 'preact'; | ||
export default (() => { | ||
export default function ScreenRecIcon() { | ||
return h("svg", { | ||
@@ -20,2 +21,2 @@ className: "uppy-DashboardTab-iconScreenRec", | ||
}))); | ||
}); | ||
} |
@@ -0,8 +1,10 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { h, Component } from 'preact'; | ||
function fmtMSS(s) { | ||
// eslint-disable-next-line no-return-assign, no-param-reassign | ||
return (s - (s %= 60)) / 60 + (s > 9 ? ':' : ':0') + s; | ||
} | ||
class StopWatch extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
elapsedTime: 0 | ||
}; | ||
this.wrapperStyle = { | ||
@@ -42,2 +44,5 @@ width: '100%', | ||
}; | ||
this.state = { | ||
elapsedTime: 0 | ||
}; | ||
} | ||
@@ -63,8 +68,2 @@ startTimer() { | ||
} | ||
// eslint-disable-next-line class-methods-use-this | ||
fmtMSS(s) { | ||
// eslint-disable-next-line no-return-assign, no-param-reassign | ||
return (s - (s %= 60)) / 60 + (s > 9 ? ':' : ':0') + s; | ||
} | ||
render() { | ||
@@ -82,3 +81,3 @@ const { | ||
// second to minutes and seconds | ||
const minAndSec = this.fmtMSS(elapsedTime); | ||
const minAndSec = fmtMSS(elapsedTime); | ||
if (recording && !this.timerRunning) { | ||
@@ -85,0 +84,0 @@ this.startTimer(); |
@@ -0,3 +1,4 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { h } from 'preact'; | ||
export default (_ref => { | ||
export default function StreamStatus(_ref) { | ||
let { | ||
@@ -49,2 +50,2 @@ streamActive, | ||
}))); | ||
}); | ||
} |
@@ -0,3 +1,3 @@ | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
import { h } from 'preact'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Submit recorded video to uppy. Enabled when file is available |
{ | ||
"name": "@uppy/screen-capture", | ||
"description": "Uppy plugin that captures video from display or application.", | ||
"version": "3.1.3", | ||
"version": "3.2.0", | ||
"license": "MIT", | ||
@@ -28,7 +28,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/utils": "^5.5.2", | ||
"@uppy/utils": "^5.7.5", | ||
"preact": "^10.5.13" | ||
}, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.6.0" | ||
"@uppy/core": "^3.10.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
105008
1615
17983
1
Updated@uppy/utils@^5.7.5