@vonage/media-processor 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/media-processor.es.js +444 -363
- package/dist/media-processor.min.js +1 -1
- package/dist/media-processor.static.js +444 -363
- package/dist/media-processor.umd.js +2 -2
- package/dist/types/lib/src/core/MediaProcessor.d.ts +14 -14
- package/dist/types/lib/src/core/MediaProcessorConnector.d.ts +3 -3
- package/dist/types/lib/src/core/pipeline.d.ts +1 -1
- package/dist/types/lib/src/telemetry/QosReporter.d.ts +1 -1
- package/package.json +11 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
data: ${i}`)})}logIfDebugEnabled(e,r,s){(g.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,r,s)}on(e,r){P(r),e=Array.isArray(e)?e:[e];for(const s of e)y(s),b(this,s).add(r),this.logIfDebugEnabled("subscribe",s,void 0),F(s)||this.emit(R,{eventName:s,listener:r});return this.off.bind(this,e,r)}off(e,r){P(r),e=Array.isArray(e)?e:[e];for(const s of e)y(s),b(this,s).delete(r),this.logIfDebugEnabled("unsubscribe",s,void 0),F(s)||this.emit(k,{eventName:s,listener:r})}once(e){return new Promise(r=>{const s=this.on(e,o=>{s(),r(o)})})}events(e){e=Array.isArray(e)?e:[e];for(const r of e)y(r);return Q(this,e)}async emit(e,r){y(e),this.logIfDebugEnabled("emit",e,r),Z(this,e,r);const s=b(this,e),o=d.get(this),i=[...s],n=F(e)?[]:[...o];await H,await Promise.all([...i.map(async c=>{if(s.has(c))return c(r)}),...n.map(async c=>{if(o.has(c))return c(e,r)})])}async emitSerial(e,r){y(e),this.logIfDebugEnabled("emitSerial",e,r);const s=b(this,e),o=d.get(this),i=[...s],n=[...o];await H;for(const c of i)s.has(c)&&await c(r);for(const c of n)o.has(c)&&await c(e,r)}onAny(e){return P(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),d.get(this).add(e),this.emit(R,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return Q(this)}offAny(e){P(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(k,{listener:e}),d.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const r of e)if(this.logIfDebugEnabled("clear",r,void 0),typeof r=="string"||typeof r=="symbol"){b(this,r).clear();const s=T(this,r);for(const o of s)o.finish();s.clear()}else{d.get(this).clear();for(const s of E.get(this).values())s.clear();for(const s of w.get(this).values()){for(const o of s)o.finish();s.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let r=0;for(const s of e){if(typeof s=="string"){r+=d.get(this).size+b(this,s).size+T(this,s).size+T(this).size;continue}typeof s<"u"&&y(s),r+=d.get(this).size;for(const o of E.get(this).values())r+=o.size;for(const o of w.get(this).values())r+=o.size}return r}bindMethods(e,r){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");r=j(r);for(const s of r){if(e[s]!==void 0)throw new Error(`The property \`${s}\` already exists on \`target\``);Object.defineProperty(e,s,{enumerable:!1,value:this[s].bind(this)})}}}const z=Object.getOwnPropertyNames(g.prototype).filter(t=>t!=="constructor");Object.defineProperty(g,"listenerAdded",{value:R,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(g,"listenerRemoved",{value:k,writable:!1,enumerable:!0,configurable:!1});var L=g;function K(t){return typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"}function N(t){if(K(t))return t;try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}}function W(t){return N(t).message}var ee=Object.defineProperty,re=(t,e,r)=>e in t?ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,te=(t,e,r)=>(re(t,typeof e!="symbol"?e+"":e,r),r),G=(t=>(t.automation="automation",t.test="test",t.vbc="vbc",t.video="video",t.voice="voice",t))(G||{});const se="hlg.tokbox.com/prod/logging/vcp_webrtc",oe="https://",ie=1e4;let A;const ne=new Uint8Array(16);function ae(){if(!A&&(A=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!A))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return A(ne)}const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).slice(1));function ce(t,e=0){return(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase()}const fe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),B={randomUUID:fe};function le(t,e,r){if(B.randomUUID&&!e&&!t)return B.randomUUID();t=t||{};const s=t.random||(t.rng||ae)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=s[o];return e}return ce(s)}function D(t,e){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let r=globalThis.vonage.workerizer;return r[t]||(r[t]=e),r[t]}const p=D("globals",{});var _=(t=>(t.INIT="INIT",t.FORWARD="FORWARD",t.TERMINATE="TERMINATE",t.GLOBALS_SYNC="GLOBALS_SYNC",t))(_||{});function V(t){return[ImageBitmap,ReadableStream,WritableStream].some(e=>t instanceof e)}let ue=0;function he(t,e,r,s,o){const i=ue++;return t.postMessage({id:i,type:e,functionName:r,args:s},s.filter(n=>V(n))),new Promise(n=>{o==null||o.set(i,n)})}function S(t,e){const{id:r,type:s}=t,o=Array.isArray(e)?e:[e];postMessage({id:r,type:s,result:e},o.filter(i=>V(i)))}const Y=D("workerized",{});function q(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}async function de(){if(q())S({type:_.GLOBALS_SYNC},p);else{const t=[];for(const e in Y){const{worker:r,resolvers:s}=Y[e].workerContext;r&&t.push(he(r,_.GLOBALS_SYNC,"",[p],s))}await Promise.all(t)}}function M(t,e){if(Array.isArray(e))e.splice(0,e.length);else if(typeof e=="object")for(const r in e)delete e[r];for(const r in t)Array.isArray(t[r])?(e[r]=[],M(t[r],e[r])):typeof t[r]=="object"?(e[r]={},M(t[r],e[r])):e[r]=t[r]}async function pe(t,e){const{functionName:r,args:s}=t;if(!e.instance)throw"instance not initialized";if(!r)throw"missing function name to call";if(!e.instance[r])throw`undefined function [${r}] in class ${e.instance.constructor.workerId}`;S(t,await e.instance[r](...s!=null?s:[]))}const me=D("registeredWorkers",{});function ge(t,e){if(!t.args)throw"Missing className while initializing worker";const[r,s]=t.args,o=me[r];if(o)e.instance=new o(t.args.slice(1));else throw`unknown worker class ${r}`;M(s,p),S(t,typeof e.instance!==void 0)}async function _e(t,e){const{args:r}=t;if(!e.instance)throw"instance not initialized";let s;e.instance.terminate&&(s=await e.instance.terminate(...r!=null?r:[])),S(t,s)}function ye(t){if(!t.args)throw"Missing globals while syncing";M(t.args[0],p),S(t,{})}function be(){const t={};onmessage=async e=>{const r=e.data;switch(r.type){case _.INIT:ge(r,t);break;case _.FORWARD:pe(r,t);break;case _.TERMINATE:_e(r,t);break;case _.GLOBALS_SYNC:ye(r);break}}}q()&&be();function we(t,e){return p[t]||(p[t]=e),[()=>p[t],async r=>{p[t]=r,await de()}]}function Te(t,e){return we(t,e)}const[Se,Ee]=Te("metadata");function Re(t){Ee(t)}function I(){return Se()}class U{constructor(e){te(this,"uuid",le()),this.config=e}async send(e){var r,s,o;const{appId:i,sourceType:n}=(r=I())!=null?r:{};if(!i||!n)return"metadata missing";const c=new AbortController,m=setTimeout(()=>c.abort(),ie);return await((o=(s=this.config)==null?void 0:s.fetch)!=null?o:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(e)),signal:c.signal}),clearTimeout(m),"success"}getUrl(){var e;let r=(e=I().proxyUrl)!=null?e:oe;return r+=(r.at(-1)==="/"?"":"/")+se,r}getHeaders(){return{"Content-Type":"application/json"}}buildReport(e){const r=I();return{guid:this.uuid,...e,applicationId:r.appId,timestamp:Date.now(),proxyUrl:r.proxyUrl,source:r.sourceType}}}const x="2.0.3";class ke{constructor(e){a(this,"frameTransformedCount",0);a(this,"frameFromSourceCount",0);a(this,"startAt",0);a(this,"reporter");this.config=e,this.reporter=new U(e)}async onFrameFromSource(){this.frameFromSourceCount++}get fps(){const{startAt:e,frameFromSourceCount:r}=this,o=(Date.now()-e)/1e3;return r/o}async onFrameTransformed(e={},r=!1){this.startAt===0&&(this.startAt=Date.now()),this.frameTransformedCount++;const{startAt:s,frameTransformedCount:o,frameFromSourceCount:i}=this,n=Date.now(),c=(n-s)/1e3,m=o/c,$=i/c;return r||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=n,this.reporter.config=this.config,this.reporter.send({...this.config.report,variation:"QoS",fps:$,transformedFps:m,framesTransformed:o,...e})):"success"}}var J=(t=>(t.FPS_DROP="fps_drop",t))(J||{}),X=(t=>(t.start="start",t.transform="transform",t.flush="flush",t))(X||{}),v=(t=>(t.pipeline_ended="pipeline_ended",t.pipeline_ended_with_error="pipeline_ended_with_error",t.pipeline_started="pipeline_started",t.pipeline_started_with_error="pipeline_started_with_error",t.pipeline_restarted="pipeline_restarted",t.pipeline_restarted_with_error="pipeline_restarted_with_error",t))(v||{});const Pe=500,Ae=.8;class Me extends L{constructor(r,s){super();a(this,"reporter_",new U);a(this,"reporterQos_",new ke({loggingIntervalFrameCount:Pe,report:{version:x}}));a(this,"transformerType_");a(this,"transformer_");a(this,"shouldStop_");a(this,"isFlashed_");a(this,"mediaTransformerQosReportStartTimestamp_");a(this,"videoHeight_");a(this,"videoWidth_");a(this,"trackExpectedRate_");a(this,"index_");a(this,"controller_");this.index_=s,this.transformer_=r,this.shouldStop_=!1,this.isFlashed_=!1,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in r&&(this.transformerType_=r.getTransformerType()),this.report({variation:"Create"})}setTrackExpectedRate(r){this.trackExpectedRate_=r}async start(r){if(this.controller_=r,this.transformer_&&typeof this.transformer_.start=="function")try{await this.transformer_.start(r)}catch(s){this.report({message:u.errors.transformer_start,variation:"Error",error:W(s)});const o={eventMetaData:{transformerIndex:this.index_},error:s,function:"start"};this.emit("error",o)}}async transform(r,s){var o,i,n,c;if(this.mediaTransformerQosReportStartTimestamp_===0&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),r instanceof VideoFrame&&(this.videoHeight_=(o=r==null?void 0:r.displayHeight)!=null?o:0,this.videoWidth_=(i=r==null?void 0:r.displayWidth)!=null?i:0),this.reporterQos_.onFrameFromSource(),this.transformer_)if(this.shouldStop_)console.warn("[Pipeline] flush from transform"),r.close(),this.flush(s),s.terminate();else{try{await((c=(n=this.transformer_).transform)==null?void 0:c.call(n,r,s)),this.reportQos()}catch(m){this.report({message:u.errors.transformer_transform,variation:"Error",error:W(m)});const $={eventMetaData:{transformerIndex:this.index_},error:m,function:"transform"};this.emit("error",$)}if(this.trackExpectedRate_!=-1&&this.trackExpectedRate_*Ae>this.reporterQos_.fps){const m={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}};this.emit("warn",m)}}}async flush(r){if(this.transformer_&&typeof this.transformer_.flush=="function"&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(r)}catch(s){this.report({message:u.errors.transformer_flush,variation:"Error",error:W(s)});const o={eventMetaData:{transformerIndex:this.index_},error:s,function:"flush"};this.emit("error",o)}}this.reportQos(!0),this.report({variation:"Delete"})}stop(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0}report(r){this.reporter_.send({version:x,action:"MediaTransformer",transformerType:this.transformerType_,...r})}reportQos(r=!1){this.reporterQos_.config={...this.reporterQos_.config},this.reporterQos_.onFrameTransformed({version:x,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},r)}}class Ie extends L{constructor(r){super();a(this,"transformers_");a(this,"trackExpectedRate_");this.transformers_=[],this.trackExpectedRate_=-1;for(let s=0;s<r.length;s++){let o=new Me(r[s],s);o.on("error",i=>{this.emit("error",i)}),o.on("warn",i=>{this.emit("warn",i)}),this.transformers_.push(o)}}setTrackExpectedRate(r){this.trackExpectedRate_=r;for(let s of this.transformers_)s.setTrackExpectedRate(this.trackExpectedRate_)}async start(r,s){if(!this.transformers_||this.transformers_.length===0){console.log("[Pipeline] No transformers.");return}try{let o=r;for(let i of this.transformers_)r=r.pipeThrough(new TransformStream(i));r.pipeTo(s).then(async()=>{console.log("[Pipeline] Setup."),await s.abort(),await o.cancel(),this.emit("pipelineInfo","pipeline_ended")}).catch(async i=>{r.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(n=>{console.error("[Pipeline] Error from stream transform:",n)}),await s.abort(i),await o.cancel(i),this.emit("pipelineInfo","pipeline_ended_with_error")})}catch{this.emit("pipelineInfo","pipeline_started_with_error"),this.destroy();return}this.emit("pipelineInfo","pipeline_started"),console.log("[Pipeline] Pipeline started.")}async destroy(){console.log("[Pipeline] Destroying Pipeline.");for(let r of this.transformers_)r.stop()}}class xe extends L{constructor(){super();a(this,"reporter_");a(this,"pipeline_");a(this,"transformers_");a(this,"readable_");a(this,"writable_");a(this,"trackExpectedRate_");this.reporter_=new U,this.trackExpectedRate_=-1,this.report({variation:"Create"})}setTrackExpectedRate(r){this.trackExpectedRate_=r,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)}transform(r,s){return this.readable_=r,this.writable_=s,this.transformInternal()}transformInternal(){return new Promise(async(r,s)=>{if(!this.transformers_||this.transformers_.length===0){this.report({message:u.errors.transformer_none,variation:"Error"}),s("[MediaProcessor] Need to set transformers.");return}if(!this.readable_){this.report({variation:"Error",message:u.errors.readable_null}),s("[MediaProcessor] Readable is null.");return}if(!this.writable_){this.report({variation:"Error",message:u.errors.writable_null}),s("[MediaProcessor] Writable is null.");return}let o=!1;this.pipeline_&&(o=!0,this.pipeline_.clearListeners(),this.pipeline_.destroy()),this.pipeline_=new Ie(this.transformers_),this.pipeline_.on("warn",i=>{this.emit("warn",i)}),this.pipeline_.on("error",i=>{this.emit("error",i)}),this.pipeline_.on("pipelineInfo",i=>{o&&(i==="pipeline_started"?i=v.pipeline_restarted:i==="pipeline_started_with_error"&&(i=v.pipeline_restarted_with_error)),this.emit("pipelineInfo",i)}),this.trackExpectedRate_!=-1&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_),this.pipeline_.start(this.readable_,this.writable_).then(()=>{r()}).catch(i=>{s(i)})})}setTransformers(r){return this.report({variation:"Update",message:u.updates.transformer_new}),this.transformers_=r,this.readable_&&this.writable_?this.transformInternal():Promise.resolve()}destroy(){return new Promise(async r=>{this.pipeline_&&this.pipeline_.destroy(),this.report({variation:"Delete"}),r()})}report(r){this.reporter_.send({version:x,action:"MediaProcessor",...r})}}class ve{constructor(){a(this,"processor_");a(this,"generator_");this.processor_=null,this.generator_=null}init(e){return new Promise((r,s)=>{try{this.processor_=new MediaStreamTrackProcessor(e)}catch(o){console.log(`[InsertableStreamHelper] MediaStreamTrackProcessor failed: ${o}`),s(o)}try{e.kind==="audio"?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):e.kind==="video"?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):s("kind not supported")}catch(o){console.log(`[InsertableStreamHelper] MediaStreamTrackGenerator failed: ${o}`),s(o)}r()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class Ce{constructor(e){a(this,"insertableStreamHelper_");a(this,"mediaProcessor_");this.insertableStreamHelper_=new ve,this.mediaProcessor_=e}setTrack(e){return new Promise((r,s)=>{this.insertableStreamHelper_.init(e).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{r(this.insertableStreamHelper_.getProccesorTrack())}).catch(o=>{s(o)})}).catch(o=>{s(o)})})}destroy(){return new Promise((e,r)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(s=>{r(s)}):r("no processor")})}}f.ErrorFunction=X,f.MediaProcessor=xe,f.MediaProcessorConnector=Ce,f.PipelineInfoData=v,f.VonageSourceType=G,f.WarningType=J,f.getVonageMetadata=I,f.isSupported=h,f.setVonageMetadata=Re,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(l,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(l=typeof globalThis<"u"?globalThis:l||self,_(l["media-processor"]={}))})(this,function(l){"use strict";function _(){return new Promise((t,e)=>{typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u"?e("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):t()})}class f{}f.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},f.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer",readable_null:"Readable is null",writable_null:"Writable is null"};function K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}const u=new WeakMap,T=new WeakMap,y=new WeakMap,C=Symbol("anyProducer"),D=Promise.resolve(),S=Symbol("listenerAdded"),E=Symbol("listenerRemoved");let O=!1;function m(t){if(typeof t!="string"&&typeof t!="symbol")throw new TypeError("eventName must be a string or a symbol")}function R(t){if(typeof t!="function")throw new TypeError("listener must be a function")}function g(t,e){const r=T.get(t);return r.has(e)||r.set(e,new Set),r.get(e)}function b(t,e){const r=typeof e=="string"||typeof e=="symbol"?e:C,s=y.get(t);return s.has(r)||s.set(r,new Set),s.get(r)}function X(t,e,r){const s=y.get(t);if(s.has(e))for(const i of s.get(e))i.enqueue(r);if(s.has(C)){const i=Promise.all([e,r]);for(const n of s.get(C))n.enqueue(i)}}function $(t,e){e=Array.isArray(e)?e:[e];let r=!1,s=()=>{},i=[];const n={enqueue(o){i.push(o),s()},finish(){r=!0,s()}};for(const o of e)b(t,o).add(n);return{async next(){return i?i.length===0?r?(i=void 0,this.next()):(await new Promise(o=>{s=o}),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(o){i=void 0;for(const a of e)b(t,a).delete(n);return s(),arguments.length>0?{done:!0,value:await o}:{done:!0}},[Symbol.asyncIterator](){return this}}}function G(t){if(t===void 0)return H;if(!Array.isArray(t))throw new TypeError("`methodNames` must be an array of strings");for(const e of t)if(!H.includes(e))throw typeof e!="string"?new TypeError("`methodNames` element must be a string"):new Error(`${e} is not Emittery method`);return t}const v=t=>t===S||t===E;class d{static mixin(e,r){return r=G(r),s=>{if(typeof s!="function")throw new TypeError("`target` must be function");for(const o of r)if(s.prototype[o]!==void 0)throw new Error(`The property \`${o}\` already exists on \`target\``);function i(){return Object.defineProperty(this,e,{enumerable:!1,value:new d}),this[e]}Object.defineProperty(s.prototype,e,{enumerable:!1,get:i});const n=o=>function(...a){return this[e][o](...a)};for(const o of r)Object.defineProperty(s.prototype,o,{enumerable:!1,value:n(o)});return s}}static get isDebugEnabled(){if(typeof process!="object")return O;const{env:e}=process||{env:{}};return e.DEBUG==="emittery"||e.DEBUG==="*"||O}static set isDebugEnabled(e){O=e}constructor(e={}){u.set(this,new Set),T.set(this,new Map),y.set(this,new Map),this.debug=e.debug||{},this.debug.enabled===void 0&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(r,s,i,n)=>{try{n=JSON.stringify(n)}catch{n=`Object with the following keys failed to stringify: ${Object.keys(n).join(",")}`}typeof i=="symbol"&&(i=i.toString());const o=new Date,a=`${o.getHours()}:${o.getMinutes()}:${o.getSeconds()}.${o.getMilliseconds()}`;console.log(`[${a}][emittery:${r}][${s}] Event Name: ${i}
|
|
2
|
+
data: ${n}`)})}logIfDebugEnabled(e,r,s){(d.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,r,s)}on(e,r){R(r),e=Array.isArray(e)?e:[e];for(const s of e)m(s),g(this,s).add(r),this.logIfDebugEnabled("subscribe",s,void 0),v(s)||this.emit(S,{eventName:s,listener:r});return this.off.bind(this,e,r)}off(e,r){R(r),e=Array.isArray(e)?e:[e];for(const s of e)m(s),g(this,s).delete(r),this.logIfDebugEnabled("unsubscribe",s,void 0),v(s)||this.emit(E,{eventName:s,listener:r})}once(e){return new Promise(r=>{const s=this.on(e,i=>{s(),r(i)})})}events(e){e=Array.isArray(e)?e:[e];for(const r of e)m(r);return $(this,e)}async emit(e,r){m(e),this.logIfDebugEnabled("emit",e,r),X(this,e,r);const s=g(this,e),i=u.get(this),n=[...s],o=v(e)?[]:[...i];await D,await Promise.all([...n.map(async a=>{if(s.has(a))return a(r)}),...o.map(async a=>{if(i.has(a))return a(e,r)})])}async emitSerial(e,r){m(e),this.logIfDebugEnabled("emitSerial",e,r);const s=g(this,e),i=u.get(this),n=[...s],o=[...i];await D;for(const a of n)s.has(a)&&await a(r);for(const a of o)i.has(a)&&await a(e,r)}onAny(e){return R(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),u.get(this).add(e),this.emit(S,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return $(this)}offAny(e){R(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(E,{listener:e}),u.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const r of e)if(this.logIfDebugEnabled("clear",r,void 0),typeof r=="string"||typeof r=="symbol"){g(this,r).clear();const s=b(this,r);for(const i of s)i.finish();s.clear()}else{u.get(this).clear();for(const s of T.get(this).values())s.clear();for(const s of y.get(this).values()){for(const i of s)i.finish();s.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let r=0;for(const s of e){if(typeof s=="string"){r+=u.get(this).size+g(this,s).size+b(this,s).size+b(this).size;continue}typeof s<"u"&&m(s),r+=u.get(this).size;for(const i of T.get(this).values())r+=i.size;for(const i of y.get(this).values())r+=i.size}return r}bindMethods(e,r){if(typeof e!="object"||e===null)throw new TypeError("`target` must be an object");r=G(r);for(const s of r){if(e[s]!==void 0)throw new Error(`The property \`${s}\` already exists on \`target\``);Object.defineProperty(e,s,{enumerable:!1,value:this[s].bind(this)})}}}const H=Object.getOwnPropertyNames(d.prototype).filter(t=>t!=="constructor");Object.defineProperty(d,"listenerAdded",{value:S,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(d,"listenerRemoved",{value:E,writable:!1,enumerable:!0,configurable:!1});var Z=d;const x=K(Z);function N(t){return typeof t=="object"&&t!==null&&"message"in t&&typeof t.message=="string"}function ee(t){if(N(t))return t;try{return new Error(JSON.stringify(t))}catch{return new Error(String(t))}}function F(t){return ee(t).message}var re=Object.defineProperty,te=(t,e,r)=>e in t?re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,se=(t,e,r)=>(te(t,typeof e!="symbol"?e+"":e,r),r),Q=(t=>(t.automation="automation",t.test="test",t.vbc="vbc",t.video="video",t.voice="voice",t))(Q||{});const ie="hlg.tokbox.com/prod/logging/vcp_webrtc",ne="https://",oe=1e4;let P;const ae=new Uint8Array(16);function ce(){if(!P&&(P=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!P))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(ae)}const c=[];for(let t=0;t<256;++t)c.push((t+256).toString(16).slice(1));function le(t,e=0){return(c[t[e+0]]+c[t[e+1]]+c[t[e+2]]+c[t[e+3]]+"-"+c[t[e+4]]+c[t[e+5]]+"-"+c[t[e+6]]+c[t[e+7]]+"-"+c[t[e+8]]+c[t[e+9]]+"-"+c[t[e+10]]+c[t[e+11]]+c[t[e+12]]+c[t[e+13]]+c[t[e+14]]+c[t[e+15]]).toLowerCase()}const z={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function fe(t,e,r){if(z.randomUUID&&!e&&!t)return z.randomUUID();t=t||{};const s=t.random||(t.rng||ce)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=s[i];return e}return le(s)}function L(t,e){globalThis.vonage||(globalThis.vonage={}),globalThis.vonage.workerizer||(globalThis.vonage.workerizer={});let r=globalThis.vonage.workerizer;return r[t]||(r[t]=e),r[t]}const h=L("globals",{});var p=(t=>(t.INIT="INIT",t.FORWARD="FORWARD",t.TERMINATE="TERMINATE",t.GLOBALS_SYNC="GLOBALS_SYNC",t))(p||{});function V(t){return[ImageBitmap,ReadableStream,WritableStream].some(r=>t instanceof r)}let ue=0;function he(t,e,r,s,i){const n=ue++;return t.postMessage({id:n,type:e,functionName:r,args:s},s.filter(a=>V(a))),new Promise(a=>{i==null||i.set(n,a)})}function w(t,e){const{id:r,type:s}=t,i=Array.isArray(e)?e:[e];postMessage({id:r,type:s,result:e},i.filter(n=>V(n)))}const j=L("workerized",{});function B(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}async function de(){if(B())w({type:p.GLOBALS_SYNC},h);else{const t=[];for(const e in j){const{worker:r,resolvers:s}=j[e].workerContext;r&&t.push(he(r,p.GLOBALS_SYNC,"",[h],s))}await Promise.all(t)}}function M(t,e){if(Array.isArray(e))e.splice(0,e.length);else if(typeof e=="object")for(const r in e)delete e[r];for(const r in t)Array.isArray(t[r])?(e[r]=[],M(t[r],e[r])):typeof t[r]=="object"?(e[r]={},M(t[r],e[r])):e[r]=t[r]}async function pe(t,e){const{functionName:r,args:s}=t;if(!e.instance)throw"instance not initialized";if(!r)throw"missing function name to call";if(!e.instance[r])throw`undefined function [${r}] in class ${e.instance.constructor.workerId}`;w(t,await e.instance[r](...s??[]))}const me=L("registeredWorkers",{});function ge(t,e){if(!t.args)throw"Missing className while initializing worker";const[r,s]=t.args,i=me[r];if(i)e.instance=new i(t.args.slice(1));else throw`unknown worker class ${r}`;M(s,h),w(t,typeof e.instance!==void 0)}async function _e(t,e){const{args:r}=t;if(!e.instance)throw"instance not initialized";let s;e.instance.terminate&&(s=await e.instance.terminate(...r??[])),w(t,s)}function ye(t){if(!t.args)throw"Missing globals while syncing";M(t.args[0],h),w(t,{})}function be(){const t={};onmessage=async e=>{const r=e.data;switch(r.type){case p.INIT:ge(r,t);break;case p.FORWARD:pe(r,t);break;case p.TERMINATE:_e(r,t);break;case p.GLOBALS_SYNC:ye(r);break}}}B()&&be();function we(t,e){return h[t]||(h[t]=e),[()=>h[t],async r=>{h[t]=r,await de()}]}function Te(t,e){return we(t,e)}const[Se,Ee]=Te("metadata");function Re(t){Ee(t)}function k(){return Se()}class W{constructor(e,r){se(this,"uuid"),this.config=e,this.uuid=r??fe()}async send(e){var r,s,i;const{appId:n,sourceType:o}=(r=k())!=null?r:{};if(!n||!o)return"metadata missing";const a=new AbortController,U=setTimeout(()=>a.abort(),oe);return await((i=(s=this.config)==null?void 0:s.fetch)!=null?i:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(e)),signal:a.signal}),clearTimeout(U),"success"}getUrl(){var e;let r=(e=k().proxyUrl)!=null?e:ne;return r+=(r.at(-1)==="/"?"":"/")+ie,r}getHeaders(){return{"Content-Type":"application/json"}}buildReport(e){const r=k();return{guid:this.uuid,...e,applicationId:r.appId,timestamp:Date.now(),proxyUrl:r.proxyUrl,source:r.sourceType}}}const A="2.0.4";class Pe{constructor(e,r){this.config=e,this.frameTransformedCount=0,this.frameFromSourceCount=0,this.startAt=0,this.reporter=new W(e,r)}async onFrameFromSource(){this.frameFromSourceCount++}get fps(){const{startAt:e,frameFromSourceCount:r}=this,i=(Date.now()-e)/1e3;return r/i}async onFrameTransformed(e={},r=!1){this.startAt===0&&(this.startAt=Date.now()),this.frameTransformedCount++;const{startAt:s,frameTransformedCount:i,frameFromSourceCount:n}=this,o=Date.now(),a=(o-s)/1e3,U=i/a,J=n/a;return r||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=o,this.reporter.config=this.config,this.reporter.send({...this.config.report,variation:"QoS",fps:J,transformedFps:U,framesTransformed:i,...e})):"success"}}var Y=(t=>(t.FPS_DROP="fps_drop",t))(Y||{}),q=(t=>(t.start="start",t.transform="transform",t.flush="flush",t))(q||{}),I=(t=>(t.pipeline_ended="pipeline_ended",t.pipeline_ended_with_error="pipeline_ended_with_error",t.pipeline_started="pipeline_started",t.pipeline_started_with_error="pipeline_started_with_error",t.pipeline_restarted="pipeline_restarted",t.pipeline_restarted_with_error="pipeline_restarted_with_error",t))(I||{});const Me=500,ke=.8;class Ae extends x{constructor(e,r){super(),this.reporter_=new W,this.reporterQos_=new Pe({loggingIntervalFrameCount:Me,report:{version:A}}),this.index_=r,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType()),this.report({variation:"Create"})}setTrackExpectedRate(e){this.trackExpectedRate_=e}async start(e){if(this.controller_=e,this.transformer_&&typeof this.transformer_.start=="function")try{await this.transformer_.start(e)}catch(r){this.report({message:f.errors.transformer_start,variation:"Error",error:F(r)});const s={eventMetaData:{transformerIndex:this.index_},error:r,function:"start"};this.emit("error",s)}}async transform(e,r){var s,i;if(this.mediaTransformerQosReportStartTimestamp_===0&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),e instanceof VideoFrame&&(this.videoHeight_=(e==null?void 0:e.displayHeight)??0,this.videoWidth_=(e==null?void 0:e.displayWidth)??0),this.reporterQos_.onFrameFromSource(),this.transformer_)if(this.shouldStop_)console.warn("[Pipeline] flush from transform"),e.close(),this.flush(r),r.terminate();else{try{await((i=(s=this.transformer_).transform)==null?void 0:i.call(s,e,r)),this.reportQos()}catch(n){this.report({message:f.errors.transformer_transform,variation:"Error",error:F(n)});const o={eventMetaData:{transformerIndex:this.index_},error:n,function:"transform"};this.emit("error",o)}if(this.trackExpectedRate_!=-1&&this.trackExpectedRate_*ke>this.reporterQos_.fps){const n={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}};this.emit("warn",n)}}}async flush(e){if(this.transformer_&&typeof this.transformer_.flush=="function"&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch(r){this.report({message:f.errors.transformer_flush,variation:"Error",error:F(r)});const s={eventMetaData:{transformerIndex:this.index_},error:r,function:"flush"};this.emit("error",s)}}this.reportQos(!0),this.report({variation:"Delete"})}stop(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0}report(e){this.reporter_.send({version:A,action:"MediaTransformer",transformerType:this.transformerType_,...e})}reportQos(e=!1){this.reporterQos_.config={...this.reporterQos_.config},this.reporterQos_.onFrameTransformed({version:A,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},e)}}class Ie extends x{constructor(e){super(),this.transformers_=[],this.trackExpectedRate_=-1;for(let r=0;r<e.length;r++){let s=new Ae(e[r],r);s.on("error",i=>{this.emit("error",i)}),s.on("warn",i=>{this.emit("warn",i)}),this.transformers_.push(s)}}setTrackExpectedRate(e){this.trackExpectedRate_=e;for(let r of this.transformers_)r.setTrackExpectedRate(this.trackExpectedRate_)}async start(e,r){if(!this.transformers_||this.transformers_.length===0){console.log("[Pipeline] No transformers.");return}try{let s=e;for(let i of this.transformers_)e=e.pipeThrough(new TransformStream(i));e.pipeTo(r).then(async()=>{console.log("[Pipeline] Setup."),await r.abort(),await s.cancel(),this.emit("pipelineInfo","pipeline_ended")}).catch(async i=>{e.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(n=>{console.error("[Pipeline] Error from stream transform:",n)}),await r.abort(i),await s.cancel(i),this.emit("pipelineInfo","pipeline_ended_with_error")})}catch{this.emit("pipelineInfo","pipeline_started_with_error"),this.destroy();return}this.emit("pipelineInfo","pipeline_started"),console.log("[Pipeline] Pipeline started.")}async destroy(){console.log("[Pipeline] Destroying Pipeline.");for(let e of this.transformers_)e.stop()}}class Ce extends x{constructor(){super(),this.reporter_=new W,this.trackExpectedRate_=-1,this.report({variation:"Create"})}setTrackExpectedRate(e){this.trackExpectedRate_=e,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)}transform(e,r){return this.readable_=e,this.writable_=r,this.transformInternal()}transformInternal(){return new Promise(async(e,r)=>{if(!this.transformers_||this.transformers_.length===0){this.report({message:f.errors.transformer_none,variation:"Error"}),r("[MediaProcessor] Need to set transformers.");return}if(!this.readable_){this.report({variation:"Error",message:f.errors.readable_null}),r("[MediaProcessor] Readable is null.");return}if(!this.writable_){this.report({variation:"Error",message:f.errors.writable_null}),r("[MediaProcessor] Writable is null.");return}let s=!1;this.pipeline_&&(s=!0,this.pipeline_.clearListeners(),this.pipeline_.destroy()),this.pipeline_=new Ie(this.transformers_),this.pipeline_.on("warn",i=>{this.emit("warn",i)}),this.pipeline_.on("error",i=>{this.emit("error",i)}),this.pipeline_.on("pipelineInfo",i=>{s&&(i==="pipeline_started"?i=I.pipeline_restarted:i==="pipeline_started_with_error"&&(i=I.pipeline_restarted_with_error)),this.emit("pipelineInfo",i)}),this.trackExpectedRate_!=-1&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_),this.pipeline_.start(this.readable_,this.writable_).then(()=>{e()}).catch(i=>{r(i)})})}setTransformers(e){return this.report({variation:"Update",message:f.updates.transformer_new}),this.transformers_=e,this.readable_&&this.writable_?this.transformInternal():Promise.resolve()}destroy(){return new Promise(async e=>{this.pipeline_&&this.pipeline_.destroy(),this.report({variation:"Delete"}),e()})}report(e){this.reporter_.send({version:A,action:"MediaProcessor",...e})}}class Oe{constructor(){this.processor_=null,this.generator_=null}init(e){return new Promise((r,s)=>{try{this.processor_=new MediaStreamTrackProcessor(e)}catch(i){console.log(`[InsertableStreamHelper] MediaStreamTrackProcessor failed: ${i}`),s(i)}try{e.kind==="audio"?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):e.kind==="video"?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):s("kind not supported")}catch(i){console.log(`[InsertableStreamHelper] MediaStreamTrackGenerator failed: ${i}`),s(i)}r()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class ve{constructor(e){this.insertableStreamHelper_=new Oe,this.mediaProcessor_=e}setTrack(e){return new Promise((r,s)=>{this.insertableStreamHelper_.init(e).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{r(this.insertableStreamHelper_.getProccesorTrack())}).catch(i=>{s(i)})}).catch(i=>{s(i)})})}destroy(){return new Promise((e,r)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(s=>{r(s)}):r("no processor")})}}l.ErrorFunction=q,l.MediaProcessor=Ce,l.MediaProcessorConnector=ve,l.PipelineInfoData=I,l.VonageSourceType=Q,l.WarningType=Y,l.getVonageMetadata=k,l.isSupported=_,l.setVonageMetadata=Re,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Pipeline, { EventDataMap } from
|
|
2
|
-
import Emittery from
|
|
3
|
-
import { MediaProcessorInterface } from
|
|
1
|
+
import Pipeline, { EventDataMap } from "./pipeline";
|
|
2
|
+
import Emittery from "emittery";
|
|
3
|
+
import { MediaProcessorInterface } from "./MediaProcessorInterface";
|
|
4
4
|
import { Reporter } from "@vonage/js-onewebrtc-telemetry";
|
|
5
5
|
/**
|
|
6
6
|
* Media processor class holding and running insertable streams pipeline.
|
|
@@ -36,17 +36,17 @@ declare class MediaProcessor extends Emittery<EventDataMap> implements MediaProc
|
|
|
36
36
|
trackExpectedRate_: number;
|
|
37
37
|
constructor();
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
* Sets the expected rate of the track per second.
|
|
40
|
+
* The media processor will use this number for calculating drops in the rate.
|
|
41
|
+
* This could happen when the transformation will take more time than expected.
|
|
42
|
+
* This will not cause an error, just warning to the client.
|
|
43
|
+
* Mostly:
|
|
44
|
+
* Video: 30 frames per second
|
|
45
|
+
* Audio: 50 audio data per second for OPUS
|
|
46
|
+
* In case of increased frame dropping rate a warning will be emitted according to info [here](/docs/intro#errors-and-warnings-listener).
|
|
47
|
+
* ***This is an optional method.***
|
|
48
|
+
* @param trackExpectedRate - number holds the predicted track rate.
|
|
49
|
+
*/
|
|
50
50
|
setTrackExpectedRate(trackExpectedRate: number): void;
|
|
51
51
|
/**
|
|
52
52
|
* Starts running the tranformation logic performed by the media processor instance.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import InsertableStreamHelper from
|
|
2
|
-
import { MediaProcessorConnectorInterface } from
|
|
3
|
-
import { MediaProcessorInterface } from
|
|
1
|
+
import InsertableStreamHelper from "./InsertableStreamHelper";
|
|
2
|
+
import { MediaProcessorConnectorInterface } from "./MediaProcessorConnectorInterface";
|
|
3
|
+
import { MediaProcessorInterface } from "./MediaProcessorInterface";
|
|
4
4
|
/**
|
|
5
5
|
* Helper class implementing the media Media Processor Connector Interface.
|
|
6
6
|
* This class should always be created on the application main thread and it should be used by Vonage SDKs.
|
|
@@ -15,7 +15,7 @@ export declare class QosReporter {
|
|
|
15
15
|
private frameFromSourceCount;
|
|
16
16
|
private startAt;
|
|
17
17
|
private reporter;
|
|
18
|
-
constructor(config: QosReporterConfig);
|
|
18
|
+
constructor(config: QosReporterConfig, reporterId?: string);
|
|
19
19
|
onFrameFromSource(): Promise<void>;
|
|
20
20
|
get fps(): number;
|
|
21
21
|
onFrameTransformed(report?: Partial<SendableReport>, forceSend?: boolean): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/media-processor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"author": "Guy Mininberg <guy.mininberg@vonage.com>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Guy Mininberg <guy.mininberg@vonage.com>",
|
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
"nexmo"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "npm-run-all build:js build:static doc",
|
|
19
|
+
"build": "npm-run-all build:js build:static build:doc",
|
|
20
20
|
"build:js": "vite build && tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
21
21
|
"build:dev": "vite build --mode development && tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
22
22
|
"build:static": "node ./scripts/build-static.js && minify ./dist/media-processor.static.js > ./dist/media-processor.min.js ",
|
|
23
|
-
"doc": "typedoc --excludePrivate --excludeProtected --disableSources --out dist/docs lib/main.ts",
|
|
23
|
+
"build:doc": "typedoc --excludePrivate --excludeProtected --disableSources --out dist/docs lib/main.ts",
|
|
24
24
|
"dev": "vite",
|
|
25
|
+
"prettify": "prettier . --write",
|
|
25
26
|
"preview": "vite preview",
|
|
26
|
-
"test": "vitest --run"
|
|
27
|
+
"test": "vitest --threads=false --run",
|
|
28
|
+
"test:install": "",
|
|
29
|
+
"version:local": "node -pe 'require(\"./package.json\").version'",
|
|
30
|
+
"version:published": "npm show @vonage/media-processor version"
|
|
27
31
|
},
|
|
28
32
|
"dependencies": {
|
|
29
33
|
"@types/dom-mediacapture-transform": "^0.1.2",
|
|
@@ -31,11 +35,10 @@
|
|
|
31
35
|
"@types/node": "^17.0.10",
|
|
32
36
|
"@types/offscreencanvas": "^2019.6.4",
|
|
33
37
|
"@types/uuid": "^8.3.4",
|
|
34
|
-
"@vonage/js-onewebrtc-telemetry": "1.1.
|
|
35
|
-
"axios": "^0.25.0",
|
|
38
|
+
"@vonage/js-onewebrtc-telemetry": "1.1.4",
|
|
36
39
|
"emittery": "^0.10.1",
|
|
37
40
|
"typescript-optional": "3.0.0-alpha.3",
|
|
38
|
-
"uuid": "
|
|
41
|
+
"uuid": "^9.0.0"
|
|
39
42
|
},
|
|
40
43
|
"files": [
|
|
41
44
|
"dist"
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"rimraf": "^3.0.2",
|
|
67
70
|
"typedoc": "^0.22.12",
|
|
68
71
|
"typescript": "^4.6.2",
|
|
69
|
-
"vite": "^
|
|
72
|
+
"vite": "^4.1.3",
|
|
70
73
|
"vitest": "^0.24.3"
|
|
71
74
|
},
|
|
72
75
|
"repository": "https://github.com/Vonage/vonage-media-transformers-samples",
|