@vonage/media-processor 1.0.0
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/LICENSE +201 -0
- package/README.md +9 -0
- package/dist/docs/.nojekyll +1 -0
- package/dist/docs/assets/highlight.css +85 -0
- package/dist/docs/assets/icons.css +1043 -0
- package/dist/docs/assets/icons.png +0 -0
- package/dist/docs/assets/icons@2x.png +0 -0
- package/dist/docs/assets/main.js +52 -0
- package/dist/docs/assets/search.js +1 -0
- package/dist/docs/assets/style.css +1413 -0
- package/dist/docs/assets/widgets.png +0 -0
- package/dist/docs/assets/widgets@2x.png +0 -0
- package/dist/docs/classes/MediaProcessor.html +17 -0
- package/dist/docs/classes/MediaProcessorConnector.html +12 -0
- package/dist/docs/index.html +15 -0
- package/dist/docs/interfaces/MediaProcessorConnectorInterface.html +10 -0
- package/dist/docs/interfaces/MediaProcessorInterface.html +11 -0
- package/dist/docs/modules.html +16 -0
- package/dist/media-processor.es.js +1602 -0
- package/dist/media-processor.umd.js +2 -0
- package/dist/types/main.d.ts +8 -0
- package/dist/types/src/core/InsertableStreamHelper.d.ts +10 -0
- package/dist/types/src/core/MediaProcessor.d.ts +58 -0
- package/dist/types/src/core/MediaProcessorConnector.d.ts +79 -0
- package/dist/types/src/core/MediaProcessorConnectorInterface.d.ts +17 -0
- package/dist/types/src/core/MediaProcessorInterface.d.ts +16 -0
- package/dist/types/src/core/pipeline.d.ts +26 -0
- package/dist/types/src/telemetry/Key.d.ts +8 -0
- package/dist/types/src/telemetry/Reporter.d.ts +67 -0
- package/dist/types/src/utils/package-json.d.ts +4 -0
- package/dist/types/src/utils/utils.d.ts +6 -0
- package/package.json +50 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(w,A){typeof exports=="object"&&typeof module!="undefined"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(w=typeof globalThis!="undefined"?globalThis:w||self,A(w["media-processor"]={}))})(this,function(w){"use strict";function A(){return new Promise((t,e)=>{typeof MediaStreamTrackProcessor=="undefined"||typeof MediaStreamTrackGenerator=="undefined"?e("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):t()})}class P{}P.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},P.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer"};var q={exports:{}},te=function(e,r){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(r,n)}},Ae=te,S=Object.prototype.toString;function J(t){return Array.isArray(t)}function W(t){return typeof t=="undefined"}function Me(t){return t!==null&&!W(t)&&t.constructor!==null&&!W(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ne(t){return S.call(t)==="[object ArrayBuffer]"}function $e(t){return S.call(t)==="[object FormData]"}function Ue(t){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ne(t.buffer),e}function ke(t){return typeof t=="string"}function De(t){return typeof t=="number"}function se(t){return t!==null&&typeof t=="object"}function $(t){if(S.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Le(t){return S.call(t)==="[object Date]"}function He(t){return S.call(t)==="[object File]"}function Be(t){return S.call(t)==="[object Blob]"}function ie(t){return S.call(t)==="[object Function]"}function Fe(t){return se(t)&&ie(t.pipe)}function Ie(t){return S.call(t)==="[object URLSearchParams]"}function je(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function qe(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function V(t,e){if(!(t===null||typeof t=="undefined"))if(typeof t!="object"&&(t=[t]),J(t))for(var r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}function z(){var t={};function e(n,i){$(t[i])&&$(n)?t[i]=z(t[i],n):$(n)?t[i]=z({},n):J(n)?t[i]=n.slice():t[i]=n}for(var r=0,s=arguments.length;r<s;r++)V(arguments[r],e);return t}function Je(t,e,r){return V(e,function(n,i){r&&typeof n=="function"?t[i]=Ae(n,r):t[i]=n}),t}function We(t){return t.charCodeAt(0)===65279&&(t=t.slice(1)),t}var p={isArray:J,isArrayBuffer:ne,isBuffer:Me,isFormData:$e,isArrayBufferView:Ue,isString:ke,isNumber:De,isObject:se,isPlainObject:$,isUndefined:W,isDate:Le,isFile:He,isBlob:Be,isFunction:ie,isStream:Fe,isURLSearchParams:Ie,isStandardBrowserEnv:qe,forEach:V,merge:z,extend:Je,trim:je,stripBOM:We},N=p;function ae(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var oe=function(e,r,s){if(!r)return e;var n;if(s)n=s(r);else if(N.isURLSearchParams(r))n=r.toString();else{var i=[];N.forEach(r,function(l,y){l===null||typeof l=="undefined"||(N.isArray(l)?y=y+"[]":l=[l],N.forEach(l,function(d){N.isDate(d)?d=d.toISOString():N.isObject(d)&&(d=JSON.stringify(d)),i.push(ae(y)+"="+ae(d))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e},Ve=p;function U(){this.handlers=[]}U.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1},U.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},U.prototype.forEach=function(e){Ve.forEach(this.handlers,function(s){s!==null&&e(s)})};var ze=U,Qe=p,Ge=function(e,r){Qe.forEach(e,function(n,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(e[r]=n,delete e[i])})},ue=function(e,r,s,n,i){return e.config=r,s&&(e.code=s),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},Xe=ue,le=function(e,r,s,n,i){var o=new Error(e);return Xe(o,r,s,n,i)},Ke=le,Ye=function(e,r,s){var n=s.config.validateStatus;!s.status||!n||n(s.status)?e(s):r(Ke("Request failed with status code "+s.status,s.config,null,s.request,s))},k=p,Ze=k.isStandardBrowserEnv()?function(){return{write:function(r,s,n,i,o,u){var l=[];l.push(r+"="+encodeURIComponent(s)),k.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),k.isString(i)&&l.push("path="+i),k.isString(o)&&l.push("domain="+o),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),er=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},rr=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e},tr=er,nr=rr,sr=function(e,r){return e&&!tr(r)?nr(e,r):r},Q=p,ir=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],ar=function(e){var r={},s,n,i;return e&&Q.forEach(e.split(`
|
|
2
|
+
`),function(u){if(i=u.indexOf(":"),s=Q.trim(u.substr(0,i)).toLowerCase(),n=Q.trim(u.substr(i+1)),s){if(r[s]&&ir.indexOf(s)>=0)return;s==="set-cookie"?r[s]=(r[s]?r[s]:[]).concat([n]):r[s]=r[s]?r[s]+", "+n:n}}),r},fe=p,or=fe.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function n(i){var o=i;return e&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=n(window.location.href),function(o){var u=fe.isString(o)?n(o):o;return u.protocol===s.protocol&&u.host===s.host}}():function(){return function(){return!0}}();function G(t){this.message=t}G.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},G.prototype.__CANCEL__=!0;var D=G,L=p,ur=Ye,lr=Ze,fr=oe,dr=sr,cr=ar,hr=or,X=le,pr=B,mr=D,de=function(e){return new Promise(function(s,n){var i=e.data,o=e.headers,u=e.responseType,l;function y(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}L.isFormData(i)&&delete o["Content-Type"];var a=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(d+":"+E)}var m=dr(e.baseURL,e.url);a.open(e.method.toUpperCase(),fr(m,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function Oe(){if(!!a){var _="getAllResponseHeaders"in a?cr(a.getAllResponseHeaders()):null,x=!u||u==="text"||u==="json"?a.responseText:a.response,R={data:x,status:a.status,statusText:a.statusText,headers:_,config:e,request:a};ur(function(re){s(re),y()},function(re){n(re),y()},R),a=null}}if("onloadend"in a?a.onloadend=Oe:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(Oe)},a.onabort=function(){!a||(n(X("Request aborted",e,"ECONNABORTED",a)),a=null)},a.onerror=function(){n(X("Network Error",e,null,a)),a=null},a.ontimeout=function(){var x=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",R=e.transitional||pr.transitional;e.timeoutErrorMessage&&(x=e.timeoutErrorMessage),n(X(x,e,R.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",a)),a=null},L.isStandardBrowserEnv()){var xe=(e.withCredentials||hr(m))&&e.xsrfCookieName?lr.read(e.xsrfCookieName):void 0;xe&&(o[e.xsrfHeaderName]=xe)}"setRequestHeader"in a&&L.forEach(o,function(x,R){typeof i=="undefined"&&R.toLowerCase()==="content-type"?delete o[R]:a.setRequestHeader(R,x)}),L.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),u&&u!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(l=function(_){!a||(n(!_||_&&_.type?new mr("canceled"):_),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l))),i||(i=null),a.send(i)})},c=p,ce=Ge,vr=ue,yr={"Content-Type":"application/x-www-form-urlencoded"};function he(t,e){!c.isUndefined(t)&&c.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function _r(){var t;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(t=de),t}function wr(t,e,r){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var H={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:_r(),transformRequest:[function(e,r){return ce(r,"Accept"),ce(r,"Content-Type"),c.isFormData(e)||c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)?e:c.isArrayBufferView(e)?e.buffer:c.isURLSearchParams(e)?(he(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):c.isObject(e)||r&&r["Content-Type"]==="application/json"?(he(r,"application/json"),wr(e)):e}],transformResponse:[function(e){var r=this.transitional||H.transitional,s=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,i=!s&&this.responseType==="json";if(i||n&&c.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?vr(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};c.forEach(["delete","get","head"],function(e){H.headers[e]={}}),c.forEach(["post","put","patch"],function(e){H.headers[e]=c.merge(yr)});var B=H,br=p,Tr=B,gr=function(e,r,s){var n=this||Tr;return br.forEach(s,function(o){e=o.call(n,e,r)}),e},pe=function(e){return!!(e&&e.__CANCEL__)},me=p,K=gr,Er=pe,Sr=B,Pr=D;function Y(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Pr("canceled")}var Rr=function(e){Y(e),e.headers=e.headers||{},e.data=K.call(e,e.data,e.headers,e.transformRequest),e.headers=me.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),me.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||Sr.adapter;return r(e).then(function(n){return Y(e),n.data=K.call(e,n.data,n.headers,e.transformResponse),n},function(n){return Er(n)||(Y(e),n&&n.response&&(n.response.data=K.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})},v=p,ve=function(e,r){r=r||{};var s={};function n(a,d){return v.isPlainObject(a)&&v.isPlainObject(d)?v.merge(a,d):v.isPlainObject(d)?v.merge({},d):v.isArray(d)?d.slice():d}function i(a){if(v.isUndefined(r[a])){if(!v.isUndefined(e[a]))return n(void 0,e[a])}else return n(e[a],r[a])}function o(a){if(!v.isUndefined(r[a]))return n(void 0,r[a])}function u(a){if(v.isUndefined(r[a])){if(!v.isUndefined(e[a]))return n(void 0,e[a])}else return n(void 0,r[a])}function l(a){if(a in r)return n(e[a],r[a]);if(a in e)return n(void 0,e[a])}var y={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l};return v.forEach(Object.keys(e).concat(Object.keys(r)),function(d){var E=y[d]||i,m=E(d);v.isUndefined(m)&&E!==l||(s[d]=m)}),s},ye={version:"0.25.0"},Nr=ye.version,Z={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){Z[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var _e={};Z.transitional=function(e,r,s){function n(i,o){return"[Axios v"+Nr+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return function(i,o,u){if(e===!1)throw new Error(n(o," has been removed"+(r?" in "+r:"")));return r&&!_e[o]&&(_e[o]=!0,console.warn(n(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,u):!0}};function Cr(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var s=Object.keys(t),n=s.length;n-- >0;){var i=s[n],o=e[i];if(o){var u=t[i],l=u===void 0||o(u,i,t);if(l!==!0)throw new TypeError("option "+i+" must be "+l);continue}if(r!==!0)throw Error("Unknown option "+i)}}var Or={assertOptions:Cr,validators:Z},we=p,xr=oe,be=ze,Te=Rr,F=ve,ge=Or,C=ge.validators;function M(t){this.defaults=t,this.interceptors={request:new be,response:new be}}M.prototype.request=function(e,r){if(typeof e=="string"?(r=r||{},r.url=e):r=e||{},!r.url)throw new Error("Provided config url is not valid");r=F(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var s=r.transitional;s!==void 0&&ge.assertOptions(s,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(i=i&&m.synchronous,n.unshift(m.fulfilled,m.rejected))});var o=[];this.interceptors.response.forEach(function(m){o.push(m.fulfilled,m.rejected)});var u;if(!i){var l=[Te,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),u=Promise.resolve(r);l.length;)u=u.then(l.shift(),l.shift());return u}for(var y=r;n.length;){var a=n.shift(),d=n.shift();try{y=a(y)}catch(E){d(E);break}}try{u=Te(y)}catch(E){return Promise.reject(E)}for(;o.length;)u=u.then(o.shift(),o.shift());return u},M.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=F(this.defaults,e),xr(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},we.forEach(["delete","get","head","options"],function(e){M.prototype[e]=function(r,s){return this.request(F(s||{},{method:e,url:r,data:(s||{}).data}))}}),we.forEach(["post","put","patch"],function(e){M.prototype[e]=function(r,s,n){return this.request(F(n||{},{method:e,url:r,data:s}))}});var Ar=M,Mr=D;function O(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var r=this;this.promise.then(function(s){if(!!r._listeners){var n,i=r._listeners.length;for(n=0;n<i;n++)r._listeners[n](s);r._listeners=null}}),this.promise.then=function(s){var n,i=new Promise(function(o){r.subscribe(o),n=o}).then(s);return i.cancel=function(){r.unsubscribe(n)},i},t(function(n){r.reason||(r.reason=new Mr(n),e(r.reason))})}O.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},O.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]},O.prototype.unsubscribe=function(e){if(!!this._listeners){var r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}},O.source=function(){var e,r=new O(function(n){e=n});return{token:r,cancel:e}};var $r=O,Ur=function(e){return function(s){return e.apply(null,s)}},kr=p,Dr=function(e){return kr.isObject(e)&&e.isAxiosError===!0},Ee=p,Lr=te,I=Ar,Hr=ve,Br=B;function Se(t){var e=new I(t),r=Lr(I.prototype.request,e);return Ee.extend(r,I.prototype,e),Ee.extend(r,e),r.create=function(n){return Se(Hr(t,n))},r}var b=Se(Br);b.Axios=I,b.Cancel=D,b.CancelToken=$r,b.isCancel=pe,b.VERSION=ye.version,b.all=function(e){return Promise.all(e)},b.spread=Ur,b.isAxiosError=Dr,q.exports=b,q.exports.default=b;var Fr=q.exports;class f{isEmpty(){return!this.isPresent()}static of(e){if(e!=null)return new Pe(e);throw new TypeError("The passed value was null or undefined.")}static ofNonNull(e){return f.of(e)}static ofNullable(e){return e!=null?new Pe(e):new Re}static empty(){return new Re}static from(e){switch(e.kind){case"present":return f.of(e.value);case"empty":return f.empty();default:throw new TypeError("The passed value was not an Option type.")}}}class Pe extends f{constructor(e){super();this.payload=e}isPresent(){return!0}get(){return this.payload}ifPresent(e){e(this.payload)}ifPresentOrElse(e,r){e(this.payload)}filter(e){return e(this.payload)?this:f.empty()}map(e){const r=e(this.payload);return f.ofNullable(r)}flatMap(e){return e(this.payload)}or(e){return this}orElse(e){return this.payload}orElseGet(e){return this.payload}orElseThrow(e){return this.payload}orNull(){return this.payload}orUndefined(){return this.payload}toOption(){return{kind:"present",value:this.payload}}matches(e){return e.present(this.payload)}toJSON(e){return this.payload}}class Re extends f{isPresent(){return!1}constructor(){super()}get(){throw new TypeError("The optional is not present.")}ifPresent(e){}ifPresentOrElse(e,r){r()}filter(e){return this}map(e){return f.empty()}flatMap(e){return f.empty()}or(e){return e()}orElse(e){return e}orElseGet(e){return this.orElse(e())}orElseThrow(e){throw e()}orNull(){return null}orUndefined(){}toOption(){return{kind:"empty"}}matches(e){return e.empty()}toJSON(e){return null}}const Ir="1.0.0";let Ne;function jr(t){Ne=t}function qr(){return Ne}class T{constructor(){const e=qr();this._report={action:f.empty(),applicationId:f.ofNullable(e!==void 0?e.appId:null),timestamp:Date.now(),fps:f.empty(),framesTransformed:f.empty(),guid:f.empty(),highestFrameTransformCpu:f.empty(),message:f.empty(),source:f.ofNullable(e!==void 0?e.sourceType:null),transformedFps:f.empty(),transformerType:f.empty(),variation:f.empty(),videoHeight:f.empty(),videoWidth:f.empty(),version:Ir}}action(e){return this._report.action=f.ofNullable(e),this}framesTransformed(e){return this._report.framesTransformed=f.ofNullable(e),this}fps(e){return this._report.fps=f.ofNullable(e),this}guid(e){return this._report.guid=f.ofNullable(e),this}message(e){return this._report.message=f.ofNullable(e),this}transformedFps(e){return this._report.transformedFps=f.ofNullable(e),this}transformerType(e){return this._report.transformerType=f.ofNullable(e),this}variation(e){return this._report.variation=f.ofNullable(e),this}videoHeight(e){return this._report.videoHeight=f.ofNullable(e),this}videoWidth(e){return this._report.videoWidth=f.ofNullable(e),this}build(){return this._report}}const Jr=t=>JSON.stringify(t,(e,r)=>{if(r!==null)return r});class g{static report(e){return new Promise((r,s)=>{let n=Fr.create(),i={timeout:1e4,timeoutErrorMessage:"Request timeout",headers:{"Content-Type":"application/json"}};const o="https://hlg.tokbox.com/prod/logging/vcp_webrtc";n.post(o,Jr(e),i).then(u=>{console.log(u),r("success")}).catch(u=>{console.log(u),s(u)})})}}var j,Wr=new Uint8Array(16);function Vr(){if(!j&&(j=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!j))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return j(Wr)}var zr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Qr(t){return typeof t=="string"&&zr.test(t)}for(var h=[],ee=0;ee<256;++ee)h.push((ee+256).toString(16).substr(1));function Gr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(h[t[e+0]]+h[t[e+1]]+h[t[e+2]]+h[t[e+3]]+"-"+h[t[e+4]]+h[t[e+5]]+"-"+h[t[e+6]]+h[t[e+7]]+"-"+h[t[e+8]]+h[t[e+9]]+"-"+h[t[e+10]]+h[t[e+11]]+h[t[e+12]]+h[t[e+13]]+h[t[e+14]]+h[t[e+15]]).toLowerCase();if(!Qr(r))throw TypeError("Stringified UUID is invalid");return r}function Ce(t,e,r){t=t||{};var s=t.random||(t.rng||Vr)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){r=r||0;for(var n=0;n<16;++n)e[r+n]=s[n];return e}return Gr(s)}const Xr=500;class Kr{constructor(e){this.uuid_=Ce(),this.framesTransformed_=0,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.framesFromSource_=0,this.fps_=0,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType());const r=new T().action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Create").build();g.report(r)}async start(e){if(this.transformer_&&typeof this.transformer_.start=="function")try{await this.transformer_.start(e)}catch{const s=new T().action("MediaTransformer").guid(this.uuid_).message(P.errors.transformer_start).transformerType(this.transformerType_).variation("Error").build();g.report(s)}}async transform(e,r){var s,n,i,o;if(this.mediaTransformerQosReportStartTimestamp_===0&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),this.videoHeight_=(s=e==null?void 0:e.displayHeight)!=null?s:0,this.videoWidth_=(n=e==null?void 0:e.displayWidth)!=null?n:0,++this.framesFromSource_,this.transformer_)if(this.shouldStop_)e.close(),this.flush(r),r.terminate();else try{await((o=(i=this.transformer_).transform)==null?void 0:o.call(i,e,r)),++this.framesTransformed_,this.framesTransformed_===Xr&&this.mediaTransformerQosReport()}catch{const l=new T().action("MediaTransformer").guid(this.uuid_).message(P.errors.transformer_transform).transformerType(this.transformerType_).variation("Error").build();g.report(l)}}async flush(e){if(this.transformer_&&typeof this.transformer_.flush=="function"&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch{const n=new T().action("MediaTransformer").guid(this.uuid_).message(P.errors.transformer_transform).transformerType(this.transformerType_).variation("Error").build();g.report(n)}}this.mediaTransformerQosReport();const r=new T().action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Delete").build();g.report(r)}stop(){console.log("[Pipeline] Stop stream."),this.shouldStop_=!0}mediaTransformerQosReport(){let e=(Date.now()-this.mediaTransformerQosReportStartTimestamp_)/1e3,r=this.framesFromSource_/e,s=this.framesTransformed_/e;const n=new T().action("MediaTransformer").fps(r).transformedFps(s).framesTransformed(this.framesTransformed_).guid(this.uuid_).transformerType(this.transformerType_).videoHeight(this.videoHeight_).videoWidth(this.videoWidth_).variation("QoS").build();g.report(n),this.mediaTransformerQosReportStartTimestamp_=0,this.framesFromSource_=0,this.framesTransformed_=0}}class Yr{constructor(e){this.transformers_=[];for(let r of e)this.transformers_.push(new Kr(r))}async start(e,r){if(!this.transformers_||this.transformers_.length===0){console.log("[Pipeline] No transformers.");return}try{let s=e;for(let n of this.transformers_)e=e.pipeThrough(new TransformStream(n));e.pipeTo(r).then(async()=>{console.log("[Pipeline] Setup."),await r.abort(),await s.cancel()}).catch(async n=>{e.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(i=>{console.error("[Pipeline] Error from stream transform:",i)}),await r.abort(n),await s.cancel(n)})}catch{this.destroy();return}console.log("[Pipeline] Pipeline started.")}async destroy(){console.log("[Pipeline] Destroying Pipeline.");for(let e of this.transformers_)e.stop()}}class Zr{constructor(){this.uuid_=Ce();const e=new T().action("MediaProcessor").guid(this.uuid_).variation("Create").build();g.report(e)}transform(e,r){return this.readable_=e,this.writable_=r,this.transformInternal()}transformInternal(){return new Promise((e,r)=>{if(!this.transformers_||this.transformers_.length===0){const s=new T().action("MediaProcessor").guid(this.uuid_).message(P.errors.transformer_none).variation("Error").build();g.report(s),r("[MediaProcessor] Need to set transformers.")}this.pipeline_&&this.pipeline_.destroy(),this.pipeline_=new Yr(this.transformers_),this.pipeline_.start(this.readable_,this.writable_).then(()=>{e()}).catch(s=>{r(s)})})}setTransformers(e){const r=new T().action("MediaProcessor").guid(this.uuid_).message(P.updates.transformer_new).variation("Update").build();return g.report(r),this.transformers_=e,this.readable_&&this.writable_?this.transformInternal():Promise.resolve()}destroy(){return new Promise(e=>{this.pipeline_&&this.pipeline_.destroy();const r=new T().action("MediaProcessor").guid(this.uuid_).variation("Delete").build();g.report(r),e()})}}class et{constructor(){this.processor_=null,this.generator_=null}init(e){return new Promise((r,s)=>{try{this.processor_=new MediaStreamTrackProcessor(e)}catch(n){console.log(`[InsertableStreamHelper] MediaStreamTrackProcessor failed: ${n}`),s(n)}try{e.kind==="audio"?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):e.kind==="video"?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):s("kind not supported")}catch(n){console.log(`[InsertableStreamHelper] MediaStreamTrackGenerator failed: ${n}`),s(n)}r()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class rt{constructor(e){this.insertableStreamHelper_=new et,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(n=>{s(n)})}).catch(n=>{s(n)})})}destroy(){return new Promise((e,r)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(s=>{r(s)}):r("no processor")})}}w.MediaProcessor=Zr,w.MediaProcessorConnector=rt,w.isSupported=A,w.setMetadata=jr,Object.defineProperty(w,"__esModule",{value:!0}),w[Symbol.toStringTag]="Module"});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { isSupported } from './src/utils/utils';
|
|
2
|
+
import MediaProcessor from './src/core/MediaProcessor';
|
|
3
|
+
import MediaProcessorConnector from './src/core/MediaProcessorConnector';
|
|
4
|
+
import { setMetadata } from './src/telemetry/Reporter';
|
|
5
|
+
export type { MediaProcessorConnectorInterface } from './src/core/MediaProcessorConnectorInterface';
|
|
6
|
+
export type { MediaProcessorInterface } from './src/core/MediaProcessorInterface';
|
|
7
|
+
export type { VonageMetadata, VonageSourceType } from './src/telemetry/Reporter';
|
|
8
|
+
export { isSupported, MediaProcessor, MediaProcessorConnector, setMetadata };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare class InsertableStreamHelper {
|
|
2
|
+
processor_: any;
|
|
3
|
+
generator_: any;
|
|
4
|
+
constructor();
|
|
5
|
+
init(track: MediaStreamTrack): Promise<void>;
|
|
6
|
+
getReadable(): ReadableStream;
|
|
7
|
+
getWriteable(): WritableStream;
|
|
8
|
+
getProccesorTrack(): any;
|
|
9
|
+
}
|
|
10
|
+
export default InsertableStreamHelper;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Pipeline from './pipeline';
|
|
2
|
+
/**
|
|
3
|
+
* Media processor class holding and running the media processing logic.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* let mediaProcessor: MediaProcessor = new MediaProcessor();
|
|
9
|
+
* let transformers: Array<Transformer> = [];
|
|
10
|
+
* transformers.push(new CanvasTransform());
|
|
11
|
+
* mediaProcessor.setTransformers(transformers);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class MediaProcessor {
|
|
15
|
+
/**
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
uuid_: string;
|
|
19
|
+
/**
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
pipeline_: Pipeline;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
transformers_: Array<Transformer>;
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
readable_: ReadableStream;
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
*/
|
|
34
|
+
writable_: WritableStream;
|
|
35
|
+
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Starts running the tranformation logic performed by the media processor instance.
|
|
38
|
+
*
|
|
39
|
+
* @param readable Readable stream associated to the media source being processed.
|
|
40
|
+
* @param writable Writable stream associated to the resulting media once processed.
|
|
41
|
+
*/
|
|
42
|
+
transform(readable: ReadableStream, writable: WritableStream): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
transformInternal(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Sets an array of transfromer instances that will be hold and ran by the media processor instance.
|
|
49
|
+
*
|
|
50
|
+
* @param transformers An array of transformer instances.
|
|
51
|
+
*/
|
|
52
|
+
setTransformers(transformers: Array<Transformer>): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Stops running the tranformation logic performed by the media processor instance.
|
|
55
|
+
*/
|
|
56
|
+
destroy(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export default MediaProcessor;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import InsertableStreamHelper from './InsertableStreamHelper';
|
|
2
|
+
import { MediaProcessorConnectorInterface } from './MediaProcessorConnectorInterface';
|
|
3
|
+
import { MediaProcessorInterface } from './MediaProcessorInterface';
|
|
4
|
+
/**
|
|
5
|
+
* Helper class implementing the media processor connector interface.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* let mediaProcessor: MediaProcessor = new MediaProcessor();
|
|
11
|
+
* let transformers: Array<Transformer> = [];
|
|
12
|
+
* transformers.push(new CanvasTransform());
|
|
13
|
+
* mediaProcessor.setTransformers(transformers);
|
|
14
|
+
*
|
|
15
|
+
* let connector: MediaProcessorConnector = new MediaProcessorConnector(mediaProcessor);
|
|
16
|
+
* source_.setMediaProcessorConnector(connector);
|
|
17
|
+
*
|
|
18
|
+
* // ...
|
|
19
|
+
*
|
|
20
|
+
* setMediaProcessorConnector(mediaProcessorConnector: MediaProcessorConnectorInterface): Promise<void> {
|
|
21
|
+
* return new Promise<void>(async (resolve, reject) => {
|
|
22
|
+
* this.mediaProcessorConnector_ = mediaProcessorConnector;
|
|
23
|
+
* if (!this.stream_)
|
|
24
|
+
* {
|
|
25
|
+
* console.log('[CameraSource] Requesting camera.');
|
|
26
|
+
* reject("no stream")
|
|
27
|
+
* }
|
|
28
|
+
* this.mediaProcessorConnector_.setTrack(this.videoTrack_).then(newTrack => {
|
|
29
|
+
* let processedStream = new MediaStream();
|
|
30
|
+
* processedStream.addTrack(newTrack);
|
|
31
|
+
* this.sink_.setMediaStream(processedStream);
|
|
32
|
+
* resolve();
|
|
33
|
+
* })
|
|
34
|
+
* .catch(e => {
|
|
35
|
+
* reject(e)
|
|
36
|
+
* })
|
|
37
|
+
* });
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* // ...
|
|
41
|
+
*
|
|
42
|
+
* async stopMediaProcessorConnector() {
|
|
43
|
+
* if(this.mediaProcessorConnector_){
|
|
44
|
+
* this.mediaProcessorConnector_.destroy().then(() => {
|
|
45
|
+
* let processedStream = new MediaStream();
|
|
46
|
+
* processedStream.addTrack(this.videoTrack_);
|
|
47
|
+
* this.sink_.setMediaStream(processedStream);
|
|
48
|
+
* })
|
|
49
|
+
* .catch(e => {
|
|
50
|
+
* console.error(e);
|
|
51
|
+
* });
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare class MediaProcessorConnector implements MediaProcessorConnectorInterface {
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
insertableStreamHelper_: InsertableStreamHelper;
|
|
61
|
+
/**
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
mediaProcessor_: MediaProcessorInterface;
|
|
65
|
+
constructor(vonageMediaProcessor: MediaProcessorInterface);
|
|
66
|
+
/**
|
|
67
|
+
* Sets the media stream track instance to be processed.
|
|
68
|
+
*
|
|
69
|
+
* @param track MeadiaStreamTrack (audio or video) to be processed.
|
|
70
|
+
*
|
|
71
|
+
* @returns Promise<MediaStreamTrack> MeadiaStreamTrack instance already processed.
|
|
72
|
+
*/
|
|
73
|
+
setTrack(track: MediaStreamTrack): Promise<MediaStreamTrack>;
|
|
74
|
+
/**
|
|
75
|
+
* Stops the media processing being performed.
|
|
76
|
+
*/
|
|
77
|
+
destroy(): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
export default MediaProcessorConnector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface definition for media processor connector instances.
|
|
3
|
+
*/
|
|
4
|
+
export interface MediaProcessorConnectorInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Sets the media stream track instance to be processed.
|
|
7
|
+
*
|
|
8
|
+
* @param track MeadiaStreamTrack (audio or video) to be processed.
|
|
9
|
+
*
|
|
10
|
+
* @returns Promise<MediaStreamTrack> MeadiaStreamTrack instance already processed.
|
|
11
|
+
*/
|
|
12
|
+
setTrack(track: MediaStreamTrack): Promise<MediaStreamTrack>;
|
|
13
|
+
/**
|
|
14
|
+
* Stops the media processing being performed.
|
|
15
|
+
*/
|
|
16
|
+
destroy(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface definition for media processor instances.
|
|
3
|
+
*/
|
|
4
|
+
export interface MediaProcessorInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Starts running the tranformation logic performed by the media processor instance.
|
|
7
|
+
*
|
|
8
|
+
* @param readable Readable stream associated to the media source being processed.
|
|
9
|
+
* @param writable Writable stream associated to the resulting media once processed.
|
|
10
|
+
*/
|
|
11
|
+
transform(readable: ReadableStream, writable: WritableStream): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Stops running the tranformation logic performed by the media processor instance.
|
|
14
|
+
*/
|
|
15
|
+
destroy(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare class InternalTransformer implements Transformer {
|
|
2
|
+
uuid_: string;
|
|
3
|
+
transformerType_: string;
|
|
4
|
+
fps_: number;
|
|
5
|
+
framesTransformed_: number;
|
|
6
|
+
transformer_: Transformer;
|
|
7
|
+
shouldStop_: boolean;
|
|
8
|
+
isFlashed_: boolean;
|
|
9
|
+
framesFromSource_: number;
|
|
10
|
+
mediaTransformerQosReportStartTimestamp_: number;
|
|
11
|
+
videoHeight_: number;
|
|
12
|
+
videoWidth_: number;
|
|
13
|
+
constructor(transformer: Transformer);
|
|
14
|
+
start(controller: TransformStreamDefaultController): Promise<void>;
|
|
15
|
+
transform(frame: any, controller: TransformStreamDefaultController): Promise<void>;
|
|
16
|
+
flush(controller: TransformStreamDefaultController): Promise<void>;
|
|
17
|
+
stop(): void;
|
|
18
|
+
mediaTransformerQosReport(): void;
|
|
19
|
+
}
|
|
20
|
+
declare class Pipeline {
|
|
21
|
+
transformers_: Array<InternalTransformer>;
|
|
22
|
+
constructor(transformers: Array<Transformer>);
|
|
23
|
+
start(readable: ReadableStream, writeable: WritableStream): Promise<void>;
|
|
24
|
+
destroy(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export default Pipeline;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Optional } from 'typescript-optional';
|
|
2
|
+
export declare type VonageSourceType = 'automation' | 'test' | 'vbc' | 'video' | 'voice';
|
|
3
|
+
/**
|
|
4
|
+
* Specifies the addional information being sent with the telemetry collected by the library.
|
|
5
|
+
*/
|
|
6
|
+
export declare type VonageMetadata = {
|
|
7
|
+
/**
|
|
8
|
+
* Type of source using the library.
|
|
9
|
+
*/
|
|
10
|
+
sourceType: VonageSourceType;
|
|
11
|
+
/**
|
|
12
|
+
* Some string identifier identifying the application using the library.
|
|
13
|
+
*/
|
|
14
|
+
appId: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Sets some metadata for telemetry.
|
|
18
|
+
*
|
|
19
|
+
* @param metadata Specifies the addional information being sent with the telemetry collected by the library.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* const metadata: VonageMetadata = {
|
|
25
|
+
* appId: 'vonage-media-processor-example',
|
|
26
|
+
* sourceType: 'test'
|
|
27
|
+
* };
|
|
28
|
+
* setMetadata(metadata);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function setMetadata(metadata: VonageMetadata): void;
|
|
32
|
+
interface Report {
|
|
33
|
+
action: Optional<string>;
|
|
34
|
+
applicationId: Optional<string>;
|
|
35
|
+
timestamp: number;
|
|
36
|
+
fps: Optional<number>;
|
|
37
|
+
framesTransformed: Optional<number>;
|
|
38
|
+
guid: Optional<string>;
|
|
39
|
+
highestFrameTransformCpu: Optional<number>;
|
|
40
|
+
message: Optional<string>;
|
|
41
|
+
source: Optional<string>;
|
|
42
|
+
transformedFps: Optional<number>;
|
|
43
|
+
transformerType: Optional<string>;
|
|
44
|
+
variation: Optional<string>;
|
|
45
|
+
videoHeight: Optional<number>;
|
|
46
|
+
videoWidth: Optional<number>;
|
|
47
|
+
version: string;
|
|
48
|
+
}
|
|
49
|
+
declare class ReportBuilder {
|
|
50
|
+
private readonly _report;
|
|
51
|
+
constructor();
|
|
52
|
+
action(action: string): this;
|
|
53
|
+
framesTransformed(framesTransformed: number): this;
|
|
54
|
+
fps(fps: number): this;
|
|
55
|
+
guid(guid: string): this;
|
|
56
|
+
message(message: string): this;
|
|
57
|
+
transformedFps(transformedFps: number): this;
|
|
58
|
+
transformerType(transformerType: string): this;
|
|
59
|
+
variation(variation: string): this;
|
|
60
|
+
videoHeight(videoHeight: number): this;
|
|
61
|
+
videoWidth(videoWidth: number): this;
|
|
62
|
+
build(): Report;
|
|
63
|
+
}
|
|
64
|
+
declare class Reporter {
|
|
65
|
+
static report(report: Report): Promise<any>;
|
|
66
|
+
}
|
|
67
|
+
export { Report, ReportBuilder, Reporter };
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vonage/media-processor",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"author": "Guy Mininberg <guy.mininberg@vonage.com>",
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Guy Mininberg <guy.mininberg@vonage.com>",
|
|
7
|
+
"Jose Olivera <joseantonio.oliveraortega@vonage.com>"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "npm-run-all build:js doc",
|
|
11
|
+
"build:js": "node ./scripts/package-json.js && tsc && vite build && tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
12
|
+
"build:dev": "node ./scripts/package-json.js && tsc && vite build --mode development && tsc --declaration --emitDeclarationOnly --outDir dist/types",
|
|
13
|
+
"doc": "typedoc --excludePrivate --excludeProtected --disableSources --out dist/docs lib/main.ts",
|
|
14
|
+
"dev": "node ./scripts/package-json.js && vite",
|
|
15
|
+
"preview": "vite preview"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@types/emscripten": "^1.39.6",
|
|
19
|
+
"@types/offscreencanvas": "^2019.6.4",
|
|
20
|
+
"@types/uuid": "^8.3.4",
|
|
21
|
+
"@types/node": "^17.0.10",
|
|
22
|
+
"@types/dom-mediacapture-transform": "^0.1.2",
|
|
23
|
+
"axios": "^0.25.0",
|
|
24
|
+
"typescript-optional": "3.0.0-alpha.3",
|
|
25
|
+
"uuid": "~8.3.2"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"types": "./dist/types/main.d.ts",
|
|
31
|
+
"main": "./dist/media-processor.umd.js",
|
|
32
|
+
"module": "./dist/media-processor.es.js",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"import": "./dist/media-processor.es.js",
|
|
36
|
+
"require": "./dist/media-processor.umd.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@tsconfig/node12": "^1.0.1",
|
|
41
|
+
"typescript": "^4.5.4",
|
|
42
|
+
"vite": "^2.7.2",
|
|
43
|
+
"npm-run-all": "^4.1.5",
|
|
44
|
+
"typedoc": "^0.22.12"
|
|
45
|
+
},
|
|
46
|
+
"repository": "https://github.com/vonage/media-processor",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org"
|
|
49
|
+
}
|
|
50
|
+
}
|