Socket
Socket
Sign inDemoInstall

vidar

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.3 to 0.8.4

9

CHANGELOG.md

@@ -8,2 +8,10 @@ # Changelog

## [0.8.4] - 2022-02-23
### Fixed
- **Major memory leak.**
- `Movie#play()` not resolving.
- `Movie#paused` set to false after done playing or recording.
- Movies' `currentTime` being off by a fraction of a second a few frames after playing.
- Movies' `currentTime` setter not respecting `autoRefresh`.
## [0.8.3] - 2022-01-18

@@ -197,2 +205,3 @@ ### Fixed

[0.8.4]: https://github.com/clabe45/vidar/compare/v0.8.3...v0.8.4
[0.8.3]: https://github.com/clabe45/vidar/compare/v0.8.2...v0.8.3

@@ -199,0 +208,0 @@ [0.8.2]: https://github.com/clabe45/vidar/compare/v0.8.1...v0.8.2

1

CONTRIBUTING.md

@@ -23,2 +23,3 @@ # Contributing

npm install
node node_modules/puppeteer/install.js
```

@@ -25,0 +26,0 @@

3

dist/layer/audio-source.d.ts

@@ -1,2 +0,1 @@

import { AudioContext, IAudioNode } from 'standardized-audio-context';
import { Base, BaseOptions } from './base';

@@ -6,3 +5,3 @@ declare type Constructor<T> = new (...args: unknown[]) => T;

readonly source: HTMLMediaElement;
readonly audioNode: IAudioNode<AudioContext>;
readonly audioNode: AudioNode;
playbackRate: number;

@@ -9,0 +8,0 @@ /** The audio source node for the media */

/**
* @module movie
*/
import { AudioContext } from 'standardized-audio-context';
import { Dynamic } from './util';

@@ -9,2 +8,5 @@ import { Base as BaseLayer } from './layer/index';

declare global {
interface Window {
webkitAudioContext: typeof AudioContext;
}
interface HTMLCanvasElement {

@@ -11,0 +13,0 @@ captureStream(frameRate?: number): MediaStream;

// Karma configuration
// Generated on Thu Sep 19 2019 02:05:06 GMT-0400 (Eastern Daylight Time)
process.env.CHROME_BIN = require('puppeteer').executablePath()
module.exports = function (config) {

@@ -52,4 +54,18 @@ config.set({

// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['ChromeHeadless'],
browsers: ['FirefoxHeadless'],
customLaunchers: {
'FirefoxHeadless': {
base: 'Firefox',
flags: ['-headless'],
prefs: {
'network.proxy.type': 0
}
}
},
client: {
captureConsole: true
},
// Continuous Integration mode

@@ -56,0 +72,0 @@ // if true, Karma captures browsers, runs the tests and exits

{
"name": "vidar",
"version": "0.8.3",
"version": "0.8.4",
"description": "An extendable video-editing framework for the browser and Node",

@@ -12,5 +12,2 @@ "browser": "dist/vidar-cjs.js",

},
"dependencies": {
"standardized-audio-context": "^25.1.13"
},
"devDependencies": {

@@ -33,4 +30,4 @@ "@types/dom-mediacapture-record": "^1.0.7",

"karma": "^6.1.1",
"karma-chrome-launcher": "^3.1.0",
"karma-es6-shim": "^1.0.0",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "^2.0.1",

@@ -49,3 +46,3 @@ "karma-requirejs": "^1.1.0",

"shipjs": "0.23.3",
"typedoc": "^0.20.34",
"typedoc": "^0.22.11",
"typescript": "^4.1.3"

@@ -55,3 +52,3 @@ },

"build": "rollup -c",
"doc": "rm -rf docs && npx typedoc src/vidar.ts --excludePrivate --readme none --theme minimal",
"doc": "rm -rf docs && npx typedoc src/vidar.ts --excludePrivate --readme none",
"assets": "git fetch origin example-assets:example-assets && git cherry-pick example-assets && git reset --soft HEAD^ && git reset HEAD examples/assets",

@@ -58,0 +55,0 @@ "effects": "node scripts/save-effect-samples.js",

@@ -23,4 +23,9 @@ /**

(async () => {
const browser = await puppeteer.launch()
const browser = await puppeteer.launch({
args: ['--autoplay-policy=no-user-gesture-required']
})
const page = await browser.newPage()
page.on('console', msg => {
console.log(`[CONSOLE] ${msg.text()}`)
})

@@ -27,0 +32,0 @@ await page.goto(`file://${__dirname}/gen-effect-samples.html`)

@@ -1,2 +0,1 @@

import { AudioContext, IAudioNode, IAudioDestinationNode } from 'standardized-audio-context'
import { Movie } from '../movie'

@@ -11,3 +10,3 @@ import { subscribe } from '../event'

readonly source: HTMLMediaElement
readonly audioNode: IAudioNode<AudioContext>
readonly audioNode: AudioNode
playbackRate: number

@@ -45,3 +44,3 @@ /** The audio source node for the media */

private __startTime: number
private _audioNode: IAudioNode<AudioContext>
private _audioNode: AudioNode
private _sourceStartTime: number

@@ -122,3 +121,3 @@ private _unstretchedDuration: number

const oldConnect = this._audioNode.connect.bind(this.audioNode)
this._audioNode.connect = <T extends IAudioDestinationNode<AudioContext>>(destination: T, outputIndex?: number, inputIndex?: number): AudioNode => {
this._audioNode.connect = <T extends AudioDestinationNode>(destination: T, outputIndex?: number, inputIndex?: number): AudioNode => {
this._connectedToDestination = destination === movie.actx.destination

@@ -128,3 +127,3 @@ return oldConnect(destination, outputIndex, inputIndex)

const oldDisconnect = this._audioNode.disconnect.bind(this.audioNode)
this._audioNode.disconnect = <T extends IAudioDestinationNode<AudioContext>>(destination?: T | number, output?: number, input?: number): AudioNode => {
this._audioNode.disconnect = <T extends AudioDestinationNode>(destination?: T | number, output?: number, input?: number): AudioNode => {
if (this._connectedToDestination &&

@@ -131,0 +130,0 @@ destination === movie.actx.destination)

@@ -5,3 +5,2 @@ /**

import { AudioContext } from 'standardized-audio-context'
import { subscribe, publish } from './event'

@@ -14,2 +13,6 @@ import { Dynamic, val, clearCachedValues, applyOptions, watchPublic } from './util'

declare global {
interface Window {
webkitAudioContext: typeof AudioContext
}
interface HTMLCanvasElement {

@@ -80,3 +83,7 @@ captureStream(frameRate?: number): MediaStream

// Set actx option manually, because it's readonly.
this.actx = options.actx || options.audioContext || new AudioContext()
this.actx = options.actx ||
options.audioContext ||
new AudioContext() ||
// eslint-disable-next-line new-cap
new window.webkitAudioContext()
delete options.actx

@@ -307,2 +314,3 @@

mediaRecorder.onstop = () => {
this._paused = true
this._ended = true

@@ -387,6 +395,2 @@ this._canvas = canvasCache

if (ended) {
publish(this, 'movie.ended', { movie: this, repeat: this.repeat })
// TODO: only reset currentTime if repeating
this._currentTime = 0 // don't use setter
publish(this, 'movie.timeupdate', { movie: this })
this._lastPlayed = performance.now()

@@ -396,2 +400,3 @@ this._lastPlayedOffset = 0 // this.currentTime

if (!this.repeat || this.recording) {
this._paused = true
this._ended = true

@@ -411,2 +416,8 @@ // Deactivate all layers

}
publish(this, 'movie.ended', { movie: this, repeat: this.repeat })
// TODO: only reset currentTime if repeating
this._currentTime = 0 // don't use setter
publish(this, 'movie.timeupdate', { movie: this })
}

@@ -442,4 +453,4 @@

window.requestAnimationFrame(timestamp => {
this._render(repeat, timestamp)
window.requestAnimationFrame(() => {
this._render(repeat, undefined, done)
}) // TODO: research performance cost

@@ -631,3 +642,4 @@ }

// Render single frame to match new time
this.refresh()
if (this.autoRefresh)
this.refresh()
}

@@ -634,0 +646,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc