extendable-media-recorder
Advanced tools
Comparing version 6.5.17 to 6.6.0
@@ -37,2 +37,3 @@ export const createMediaRecorderConstructor = (createNativeMediaRecorder, createNotSupportedError, createWebAudioMediaRecorder, createWebmPcmMediaRecorder, encoderRegexes, eventTargetConstructor, nativeMediaRecorderConstructor) => { | ||
this._onresume = null; | ||
this._onstart = null; | ||
this._onstop = null; | ||
@@ -107,2 +108,18 @@ } | ||
} | ||
get onstart() { | ||
return this._onstart === null ? this._onstart : this._onstart[0]; | ||
} | ||
set onstart(value) { | ||
if (this._onstart !== null) { | ||
this.removeEventListener('start', this._onstart[1]); | ||
} | ||
if (typeof value === 'function') { | ||
const boundListener = value.bind(this); | ||
this.addEventListener('start', boundListener); | ||
this._onstart = [value, boundListener]; | ||
} | ||
else { | ||
this._onstart = null; | ||
} | ||
} | ||
get onstop() { | ||
@@ -109,0 +126,0 @@ return this._onstop === null ? this._onstop : this._onstop[0]; |
@@ -120,2 +120,3 @@ import { encode, instantiate } from 'media-encoder-host'; | ||
} | ||
eventTarget.dispatchEvent(new Event('start')); | ||
const audioTracks = mediaStream.getAudioTracks(); | ||
@@ -122,0 +123,0 @@ // @todo TypeScript v4.4.2 removed the channelCount property from the MediaTrackSettings interface. |
@@ -48,2 +48,3 @@ import { encode, instantiate } from 'media-encoder-host'; | ||
}); | ||
nativeMediaRecorder.addEventListener('start', () => eventTarget.dispatchEvent(new Event('start'))); | ||
return { | ||
@@ -50,0 +51,0 @@ get mimeType() { |
@@ -10,2 +10,3 @@ import { TBlobEventHandler, TErrorEventHandler, TEventHandler, TRecordingState } from '../types'; | ||
onresume: null | TEventHandler<this>; | ||
onstart: null | TEventHandler<this>; | ||
onstop: null | TEventHandler<this>; | ||
@@ -12,0 +13,0 @@ readonly state: TRecordingState; |
import { IMediaRecorder } from '../interfaces'; | ||
import { TNativeEventTarget } from './native-event-target'; | ||
export declare type TWebAudioMediaRecorderFactory = (eventTarget: TNativeEventTarget, mediaStream: MediaStream, mimeType: string) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstop' | keyof TNativeEventTarget>; | ||
export declare type TWebAudioMediaRecorderFactory = (eventTarget: TNativeEventTarget, mediaStream: MediaStream, mimeType: string) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstart' | 'onstop' | keyof TNativeEventTarget>; | ||
//# sourceMappingURL=web-audio-media-recorder-factory.d.ts.map |
import { IMediaRecorder, IMediaRecorderConstructor } from '../interfaces'; | ||
import { TNativeEventTarget } from './native-event-target'; | ||
export declare type TWebmPcmMediaRecorderFactory = (eventTarget: TNativeEventTarget, nativeMediaRecorderConstructor: IMediaRecorderConstructor, mediaStream: MediaStream, mimeType: string) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstop' | keyof TNativeEventTarget>; | ||
export declare type TWebmPcmMediaRecorderFactory = (eventTarget: TNativeEventTarget, nativeMediaRecorderConstructor: IMediaRecorderConstructor, mediaStream: MediaStream, mimeType: string) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstart' | 'onstop' | keyof TNativeEventTarget>; | ||
//# sourceMappingURL=webm-pcm-media-recorder-factory.d.ts.map |
@@ -259,2 +259,3 @@ (function (global, factory) { | ||
_this._onresume = null; | ||
_this._onstart = null; | ||
_this._onstop = null; | ||
@@ -342,2 +343,20 @@ return _possibleConstructorReturn__default["default"](_this); | ||
}, { | ||
key: "onstart", | ||
get: function get() { | ||
return this._onstart === null ? this._onstart : this._onstart[0]; | ||
}, | ||
set: function set(value) { | ||
if (this._onstart !== null) { | ||
this.removeEventListener('start', this._onstart[1]); | ||
} | ||
if (typeof value === 'function') { | ||
var boundListener = value.bind(this); | ||
this.addEventListener('start', boundListener); | ||
this._onstart = [value, boundListener]; | ||
} else { | ||
this._onstart = null; | ||
} | ||
} | ||
}, { | ||
key: "onstop", | ||
@@ -926,2 +945,3 @@ get: function get() { | ||
eventTarget.dispatchEvent(new Event('start')); | ||
var audioTracks = mediaStream.getAudioTracks(); // @todo TypeScript v4.4.2 removed the channelCount property from the MediaTrackSettings interface. | ||
@@ -1086,2 +1106,5 @@ | ||
}); | ||
nativeMediaRecorder.addEventListener('start', function () { | ||
return eventTarget.dispatchEvent(new Event('start')); | ||
}); | ||
return { | ||
@@ -1088,0 +1111,0 @@ get mimeType() { |
@@ -26,4 +26,4 @@ { | ||
"@babel/preset-env": "^7.16.11", | ||
"@commitlint/cli": "^16.1.0", | ||
"@commitlint/config-angular": "^16.0.0", | ||
"@commitlint/cli": "^16.2.1", | ||
"@commitlint/config-angular": "^16.2.1", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
@@ -33,4 +33,4 @@ "chai": "^4.3.6", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.8.0", | ||
"eslint-config-holy-grail": "^51.0.3", | ||
"eslint": "^8.9.0", | ||
"eslint-config-holy-grail": "^52.0.1", | ||
"extendable-media-recorder-wav-encoder": "^7.0.66", | ||
@@ -43,3 +43,3 @@ "grunt": "^1.4.1", | ||
"husky": "^7.0.4", | ||
"karma": "^6.3.15", | ||
"karma": "^6.3.16", | ||
"karma-browserstack-launcher": "^1.6.0", | ||
@@ -57,7 +57,7 @@ "karma-chrome-launcher": "^3.1.0", | ||
"pretty-quick": "^3.1.3", | ||
"rollup": "^2.67.1", | ||
"rollup": "^2.67.2", | ||
"sinon": "^11.1.2", | ||
"sinon-chai": "^3.7.0", | ||
"ts-loader": "^9.2.6", | ||
"tsconfig-holy-grail": "^11.1.25", | ||
"tsconfig-holy-grail": "^11.1.26", | ||
"tslint": "^6.1.3", | ||
@@ -93,3 +93,3 @@ "tslint-config-holy-grail": "^53.2.26", | ||
"types": "build/es2019/module.d.ts", | ||
"version": "6.5.17" | ||
"version": "6.6.0" | ||
} |
@@ -23,3 +23,3 @@ import { IMediaRecorder, IMediaRecorderEventMap, IMediaRecorderOptions } from '../interfaces'; | ||
IMediaRecorder, | ||
'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstop' | keyof TNativeEventTarget | ||
'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstart' | 'onstop' | keyof TNativeEventTarget | ||
>; | ||
@@ -35,2 +35,4 @@ | ||
private _onstart: null | [TEventHandler<this>, TEventHandler<this>]; | ||
private _onstop: null | [TEventHandler<this>, TEventHandler<this>]; | ||
@@ -79,2 +81,3 @@ | ||
this._onresume = null; | ||
this._onstart = null; | ||
this._onstop = null; | ||
@@ -167,2 +170,22 @@ } | ||
get onstart(): null | TEventHandler<this> { | ||
return this._onstart === null ? this._onstart : this._onstart[0]; | ||
} | ||
set onstart(value) { | ||
if (this._onstart !== null) { | ||
this.removeEventListener('start', this._onstart[1]); | ||
} | ||
if (typeof value === 'function') { | ||
const boundListener = value.bind(this); | ||
this.addEventListener('start', boundListener); | ||
this._onstart = [value, boundListener]; | ||
} else { | ||
this._onstart = null; | ||
} | ||
} | ||
get onstop(): null | TEventHandler<this> { | ||
@@ -169,0 +192,0 @@ return this._onstop === null ? this._onstop : this._onstop[0]; |
@@ -177,2 +177,4 @@ import { encode, instantiate } from 'media-encoder-host'; | ||
eventTarget.dispatchEvent(new Event('start')); | ||
const audioTracks = mediaStream.getAudioTracks(); | ||
@@ -179,0 +181,0 @@ // @todo TypeScript v4.4.2 removed the channelCount property from the MediaTrackSettings interface. |
@@ -66,2 +66,3 @@ import { encode, instantiate } from 'media-encoder-host'; | ||
}); | ||
nativeMediaRecorder.addEventListener('start', () => eventTarget.dispatchEvent(new Event('start'))); | ||
@@ -68,0 +69,0 @@ return { |
@@ -17,2 +17,4 @@ import { TBlobEventHandler, TErrorEventHandler, TEventHandler, TRecordingState } from '../types'; | ||
onstart: null | TEventHandler<this>; | ||
onstop: null | TEventHandler<this>; | ||
@@ -19,0 +21,0 @@ |
@@ -8,2 +8,2 @@ import { IMediaRecorder } from '../interfaces'; | ||
mimeType: string | ||
) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstop' | keyof TNativeEventTarget>; | ||
) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstart' | 'onstop' | keyof TNativeEventTarget>; |
@@ -9,2 +9,2 @@ import { IMediaRecorder, IMediaRecorderConstructor } from '../interfaces'; | ||
mimeType: string | ||
) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstop' | keyof TNativeEventTarget>; | ||
) => Omit<IMediaRecorder, 'ondataavailable' | 'onerror' | 'onpause' | 'onresume' | 'onstart' | 'onstop' | keyof TNativeEventTarget>; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
271445
3772