@ylink-sdk/mobile-web 0.1.9-beta.1 → 0.1.9-beta.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/style.css +1 -1
- package/dist/ylink-sdk-mobile.umd.js +70 -70
- package/package.json +1 -1
- package/dist/e30037b8/VERSION +0 -6
- package/dist/e30037b8/libipvp-simd.d.ts +0 -474
- package/dist/e30037b8/libipvp-simd.js +0 -3267
- package/dist/e30037b8/libipvp-simd.prod.d.ts +0 -474
- package/dist/e30037b8/libipvp-simd.prod.js +0 -184
- package/dist/e30037b8/libipvp-simd.prod.wasm +0 -0
- package/dist/e30037b8/libipvp-simd.wasm +0 -0
- package/dist/e30037b8/libipvp.d.ts +0 -474
- package/dist/e30037b8/libipvp.js +0 -3267
- package/dist/e30037b8/libipvp.prod.d.ts +0 -474
- package/dist/e30037b8/libipvp.prod.js +0 -184
- package/dist/e30037b8/libipvp.prod.wasm +0 -0
- package/dist/e30037b8/libipvp.wasm +0 -0
- package/dist/e30037b8/librtc.d.ts +0 -438
- package/dist/e30037b8/librtc.global.js +0 -5863
- package/dist/e30037b8/librtc.global.prod.js +0 -15
- package/dist/e30037b8/libsfu-simd.d.ts +0 -767
- package/dist/e30037b8/libsfu-simd.js +0 -4822
- package/dist/e30037b8/libsfu-simd.prod.d.ts +0 -767
- package/dist/e30037b8/libsfu-simd.prod.js +0 -209
- package/dist/e30037b8/libsfu-simd.prod.wasm +0 -0
- package/dist/e30037b8/libsfu-simd.wasm +0 -0
- package/dist/e30037b8/libsfu.d.ts +0 -767
- package/dist/e30037b8/libsfu.js +0 -4822
- package/dist/e30037b8/libsfu.prod.d.ts +0 -767
- package/dist/e30037b8/libsfu.prod.js +0 -209
- package/dist/e30037b8/libsfu.prod.wasm +0 -0
- package/dist/e30037b8/libsfu.wasm +0 -0
- package/dist/e30037b8/libsvc-simd-m1.d.ts +0 -767
- package/dist/e30037b8/libsvc-simd-m1.js +0 -4921
- package/dist/e30037b8/libsvc-simd-m1.prod.d.ts +0 -767
- package/dist/e30037b8/libsvc-simd-m1.prod.js +0 -209
- package/dist/e30037b8/libsvc-simd-m1.prod.wasm +0 -0
- package/dist/e30037b8/libsvc-simd-m1.wasm +0 -0
- package/dist/e30037b8/libsvc-simd.d.ts +0 -767
- package/dist/e30037b8/libsvc-simd.js +0 -4857
- package/dist/e30037b8/libsvc-simd.prod.d.ts +0 -767
- package/dist/e30037b8/libsvc-simd.prod.js +0 -209
- package/dist/e30037b8/libsvc-simd.prod.wasm +0 -0
- package/dist/e30037b8/libsvc-simd.wasm +0 -0
- package/dist/e30037b8/libsvc.d.ts +0 -767
- package/dist/e30037b8/libsvc.js +0 -4857
- package/dist/e30037b8/libsvc.prod.d.ts +0 -767
- package/dist/e30037b8/libsvc.prod.js +0 -209
- package/dist/e30037b8/libsvc.prod.wasm +0 -0
- package/dist/e30037b8/libsvc.wasm +0 -0
- package/dist/e30037b8/native-audio-worker.global.js +0 -1583
- package/dist/e30037b8/native-audio-worker.global.prod.js +0 -15
- package/dist/e30037b8/native-video-worker.global.js +0 -1960
- package/dist/e30037b8/native-video-worker.global.prod.js +0 -15
- package/dist/e30037b8/worklet-audio-worker.global.js +0 -900
- package/dist/e30037b8/worklet-audio-worker.global.prod.js +0 -15
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function e(e,t,s,n){return new(s||(s=Promise))((function(r,i){function a(e){try{h(n.next(e))}catch(t){i(t)}}function o(e){try{h(n.throw(e))}catch(t){i(t)}}function h(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(a,o)}h((n=n.apply(e,t||[])).next())}))}function t(t){return(s,n)=>{let r=-1;const i=i=>e(this,void 0,void 0,(function*(){if(i<=r)return;r=i;let e=t[i];return i===t.length&&(e=n),e?e.length>1?e(s,a):(yield e(s,a),a()):void 0})),a=()=>i(r+1);return a()}}class s{constructor(e,t){this.middleware=[],this.pipe=t||Math.random().toString(36).slice(3),this.channel=e}get valid(){return this.channel.has(this.pipe)}implement(t,s){const n=(n,r)=>e(this,void 0,void 0,(function*(){const{method:e,params:i,status:a,required:o,attached:h={}}=n.data;if(t!==e)return r();let c=!1;const l=[],u={},f=e=>{c||(c=!0,this.channel.send(Object.assign(Object.assign(Object.assign({},n.data),{params:void 0,attached:u}),e),l))},p={transfer:(...e)=>(o&&l.push(...e),p),resolve:e=>{o?f({resolve:e,status:a+1}):c=!0},reject:e=>{o?f({status:a-1,reject:e}):c=!0},set:(e,t)=>(o&&(u[e]=t),p),get:e=>h[e]};try{Date.now();yield s(p,i,n.ports)}catch(d){c||p.reject(`${d}`)}n.data.touched=!0,c||(yield r())}));this.middleware.unshift(n);return()=>{const e=this.middleware.findIndex((e=>e===n));~e&&this.middleware.splice(e,1)}}reject(e=""){this.channel.reject(this,e)}as(){return this}callback(){return(s,n)=>e(this,void 0,void 0,(function*(){const{pipe:e,status:r}=s.data;return e!==this.pipe||r?n():t(this.middleware)(s,n)}))}toString(){return`${this.pipe}`}}class n{constructor(e,t){this.sequence=0,this.pendings=new Map,this.pipe=t||Math.random().toString(36).slice(3),this.channel=e,this.accepted=r()}get ready(){return this.accepted.promise}get valid(){return this.channel.has(this.pipe)}make(t){const s=[],n={},i=t=>e(this,void 0,void 0,(function*(){try{yield this.ready}catch(e){throw e}})),a=(e,r)=>{this.channel.send({pipe:this.pipe,sequence:++this.sequence,timestamp:Date.now(),method:t,status:0,params:e,required:r,attached:n},s)},o={transfer:(...e)=>(s.push(...e),o),post:(...t)=>e(this,void 0,void 0,(function*(){yield i(),a(t)})),invoke:(...t)=>e(this,void 0,void 0,(function*(){yield i(),a(t,!0);const e=r();return this.pendings.set(this.sequence,e),e.promise})),set:(e,t)=>(n[e]=t,o),get:e=>n[e]};return o}break(e=""){this.channel.break(this,e),this.pendings.forEach((e=>e.reject("broken"))),this.pendings.clear(),this.accepted.reject("broken"),this.accepted.promise=Promise.reject("broken"),this.accepted.promise.catch(i)}callback(){return(t,s)=>e(this,void 0,void 0,(function*(){const{pipe:e,sequence:n,status:r,reject:i,resolve:a}=t.data;if(e!==this.pipe)return s();if(!r)return s();const o=this.pendings.get(n);o&&(r<0?o.reject(i):o.resolve(a),this.pendings.delete(n))}))}toString(){return`${this.pipe}`}}function r(){const e={};return e.promise=new Promise(((t,s)=>{e.resolve=t,e.reject=s})),e.promise.catch(i),e}const i=()=>{};class a{constructor(e){this.remotes=new Map,this.receivers=new Map,this.pendingReceivers=new Set;const s=e.onmessage;this.transport=e,this.transport.onmessage=e=>{const{data:n,ports:r=[]}=e;if(o(n)){if(/^mojo/.test(n)){const[,t]=n.split(":"),r=this.receivers.get(`${t}`);return r?(this.send(`accept:${r}`),this.oninvitation&&this.oninvitation(t,r),void(r.onready&&r.onready())):(this.pendingReceivers.add(t),this.oninvitation&&this.oninvitation(t),void(this.pendingReceivers.has(t)&&s&&s.call(this.transport,e)))}if(/^accept/.test(n)){const[,e]=n.split(":"),t=this.remotes.get(e);if(!t)return;return t.accepted.resolve(),void(t.onaccept&&t.onaccept())}if(/^reject/.test(n)){const[,e,t="rejected"]=n.split(":"),s=this.remotes.get(e);if(!s)return;return this.remotes.delete(e),s.accepted.reject(t),void(s.onreject&&s.onreject(t))}if(/^break/.test(n)){const[,e,t="breaked"]=n.split(":");if(this.pendingReceivers.has(e))return void this.pendingReceivers.delete(e);const s=this.receivers.get(e);if(!s)return;return this.receivers.delete(e),void(s.onbreak&&s.onbreak(t))}return s?void s.call(this.transport,e):void 0}const i={data:n,ports:r};t([...Array.from(this.remotes.values()).map((e=>e.callback())),...Array.from(this.receivers.values()).map((e=>e.callback()))])(i,(()=>{s&&s.call(this.transport,e)}))}}fork(){return new a(this.transport)}has(e){return this.remotes.has(e)||this.receivers.has(e)}close(){this.remotes.forEach((e=>e.break())),this.remotes.clear(),this.receivers.forEach((e=>e.reject())),this.receivers.clear(),this.transport.onmessage=null,this.transport=null}send(e,t){this.transport.postMessage(e,t)}reject(e,t=""){this.send(`reject:${e}:${t}`),this.receivers.delete(`${e}`)}break(e,t=""){this.remotes.has(`${e}`)&&(this.send(`break:${e}:${t}`),this.remotes.delete(`${e}`))}remote(e){const t=new n(this,e&&`${e}`);return this.remotes.set(`${t}`,t),this.send(`mojo:${t}`),t}receiver(e){e&&this.receivers.has(`${e}`);const t=new s(this,e&&`${e}`);return this.receivers.set(`${t}`,t),this.pendingReceivers.has(`${t}`)&&(this.send(`accept:${t}`),this.pendingReceivers.delete(`${t}`),t.onready&&t.onready()),t}}const o=e=>"string"==typeof e;class h{constructor(e){const{length:t,numberOfChannels:s=1,sampleRate:n}=e;let{data:r}=e;this.length=t,this.numberOfChannels=s,this.sampleRate=n,this.duration=t/n,r&&r.length&&r[0].length||(r=[...Array(s)].map((()=>new Float32Array(t)))),this.data=r}static From(e){const{sampleRate:t,numberOfChannels:s,length:n}=e,r=[...Array(s).keys()].map((t=>e.getChannelData(t).slice()));return new h({length:n,numberOfChannels:s,sampleRate:t,data:r})}static Copy(e,t){const{numberOfChannels:s}=e,{numberOfChannels:n}=t;for(let r=0;r<s;r++)e.copyToChannel(t.getChannelData(Math.min(r,n-1)),r)}static Clip(e,t,s){const{sampleRate:n,numberOfChannels:r}=e,i=h.Data(e,t,s),{length:a}=i[0];return new h({length:a,numberOfChannels:r,sampleRate:n,data:i})}static Data(e,t,s){return[...Array(e.numberOfChannels)].map(((n,r)=>e.getChannelData(r).subarray(t,s)))}static Builder(e){const{length:t,numberOfChannels:s,sampleRate:n}=e;return{length:t,numberOfChannels:s,sampleRate:n,data:h.Data(e)}}copyFromChannel(e,t=0,s=0){if(t>=this.numberOfChannels)return;const n=this.getChannelData(t);if(s>=n.length)return;const r=n.subarray(s);e.set(r.subarray(0,Math.min(r.length,e.length)))}copyToChannel(e,t=0,s=0){if(t>=this.numberOfChannels)return;const n=this.getChannelData(t);if(s>=this.length)return;const r=Math.min(this.length-s,e.length),i=e.subarray(0,r);n.set(i,s)}getChannelData(e){return this.data[e]}}var c,l;!function(e){e[e.kVadActive=0]="kVadActive",e[e.kVadPassive=1]="kVadPassive",e[e.kVadUnknown=2]="kVadUnknown"}(c||(c={})),function(e){e[e.kNormalSpeech=0]="kNormalSpeech",e[e.kPLC=1]="kPLC",e[e.kCNG=2]="kCNG",e[e.kPLCCNG=3]="kPLCCNG",e[e.kCodecPLC=4]="kCodecPLC",e[e.kUndefined=5]="kUndefined"}(l||(l={}));class u{constructor(e){this.buffer=e.buffer,this.timestamp=e.timestamp,this.elapsedTimeMs=e.elapsedTimeMs,this.ntpTimeMs=e.ntpTimeMs,this.vad=e.vad||c.kVadUnknown,this.speech=e.speech||l.kUndefined}get sampleRate(){return this.buffer.sampleRate}get samples(){return this.buffer.length}get channels(){return this.buffer.numberOfChannels}get duration(){return this.buffer.duration}}function f(e,t=0,s,n=0,r=s.length){const{numberOfChannels:i}=e,{numberOfChannels:a}=s;for(let o=0;o<i;o++){const i=s.getChannelData(Math.min(o,a-1)).subarray(n,n+r);e.copyToChannel(i,o,t)}}class p{constructor(){this.queue=[],this.total=0,this.offset=0}get length(){return this.total}clear(){this.queue.length=0,this.total=0,this.offset=0}shift(){if(!this.total)return;return this.pull(this.queue[0].samples-this.offset)}push(e){const t=e=>{this.queue.push(e),this.total+=e.samples};if(!this.onpush)return void t(e);const{samples:s,callback:n,factory:r,reshape:i=!1}=this.onpush;let{reshaper:a}=this.onpush;for(i?(a||(a=function(e,t,s){let n,r=0;return i=>{const{samples:a,channels:o,sampleRate:c}=i;let l=0;for(;l<a;){const p=e-r,d=Math.min(a-l,p);p||(t(n),n=null),n||(n=s?s(e):new u({buffer:new h({length:e,numberOfChannels:o,sampleRate:c})}),r=0),f(n.buffer,r,i.buffer,l,d),l+=d,r+=d}}}(s,t,r),this.onpush.reshaper=a),a(e)):t(e);this.total-this.offset>=s;)n(i?this.shift():this.pull(s,r&&r(s)))}pull(e,t){if(e<=0)return;if(this.onpull){const{samples:t,callback:s,eager:n}=this.onpull;for(;this.total<Math.max(t,e)*(n?2:1);){const t=s(this.total,e);if(!t)break;this.queue.push(t),this.total+=t.samples}}if(this.total<e)return;let s=0,{offset:n}=this;for(;s<e;){const r=this.queue.shift(),i=r.samples-n,a=e-s,o=Math.min(i,a);if(i){if(!t&&!s&&i>=a){const e=h.Clip(r.buffer,n,n+a);t=new u({buffer:e}),i>a?(n+=o,this.queue.unshift(r)):n=0;break}if(!t){const s=new h({length:e,numberOfChannels:r.channels,sampleRate:r.sampleRate});t=new u({buffer:s})}if(f(t.buffer,s,r.buffer,n,o),s+=o,i>a){n+=o,this.queue.unshift(r);break}if(n=0,this.onpull){const{drain:e}=this.onpull;e&&e(r)}}}return this.total-=e,this.offset=n,t}}class d extends AudioWorkletProcessor{constructor({processorOptions:e={}}){super(),this.bufferPool=[],this.bufferSize=e.bufferSize||sampleRate/100*3,this.channel=new a(this.port),this.receiver=this.channel.receiver("worklet-audio-transport-host"),this.receiver.implement("setup",((e,[t=!1],[s,r])=>{if(s){if(n(),!r)return this.host=new a(s),this.processor=this.host.remote("worklet-audio-processor-host"),void e.resolve();this.sinkref=t,this.sourceHost=new a(s),this.source=this.sourceHost.remote("worklet-audio-source-host"),this.sinkHost=new a(r),this.sink=this.sinkHost.remote("worklet-audio-sink-host"),e.resolve()}else e.resolve()}));const t=e=>{e&&e.break()},s=e=>{e&&(e.transport.close(),e.close())},n=()=>{this.host=s(this.host),this.processor=t(this.processor),this.sourceHost=s(this.sourceHost),this.source=t(this.source),this.sinkHost=s(this.sinkHost),this.sink=t(this.sink)};this.processor=this.channel.remote("worklet-audio-processor-host"),this.inputBuffer=new p,this.outputBuffer=new p;const r=e=>{if(!e)return;const t=new h(e),s=new u({buffer:t}),{outputBuffer:n,bufferSize:r,processor:i}=this;n.push(s);const a=n.total;a>2*r&&i&&i.make("processdelay").post(a),this.sinkref&&this.source&&this.source.make("onref").post(e)};this.inputBuffer.onpush={samples:this.bufferSize,reshape:!0,factory:e=>{const t=this.bufferPool.shift();if(!t||t.buffer.length!==e){const t=new h({length:e,numberOfChannels:this.channels,sampleRate:sampleRate});return new u({buffer:t})}for(;this.bufferPool.length>4;)this.bufferPool.pop();return t},callback:e=>{const t=h.Builder(e.buffer),{processor:s,source:n}=this;s&&s.make("process").transfer(...t.data.map((e=>e.buffer))).invoke(t).then(r).catch((()=>{})),n&&n.make("onpush").transfer(...t.data.map((e=>e.buffer))).post(t)}};let i=!1;this.outputBuffer.onpull={samples:this.bufferSize,callback:()=>{if(i)return;const{sink:e,bufferSize:t,channels:s}=this;e&&(e.make("onpull").invoke(t,s,sampleRate).then(r).finally((()=>i=!1)),i=!0)},drain:e=>{this.bufferPool.push(e)}}}process(e,t){const s=e[0],n=t[0];if(!n.length)return!0;const r=n.length,i=n[0].length;this.channels=r,this.inputBuffer.push(new u({buffer:new h({length:i,numberOfChannels:r,sampleRate:sampleRate,data:s})}));const a=new u({buffer:new h({length:i,numberOfChannels:r,sampleRate:sampleRate,data:n})});return this.outputBuffer.pull(i,a)?this.lastsample=n.map((e=>e[e.length-1])):this.lastsample&&n.forEach(((e,t)=>e.fill(this.lastsample[t]))),!0}}registerProcessor("worklet-audio-transport",d)}();
|