ovenplayer 0.10.38 → 0.10.40

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/README.md CHANGED
@@ -52,7 +52,7 @@ We need your help to keep and develop our open-source project, and we want to te
52
52
  We always hope that OvenPlayer will make your project a success.
53
53
 
54
54
  ## For more information
55
- * [AirenSoft Website](https://airensoft.com)
55
+ * [AirenSoft Website](https://airensoft.com)
56
56
  * About OvenMediaEngine, OvenMediaEngine Enterprise, OvenVideo, AirenBlog and more
57
57
  * [OvenPlayer Getting Started](https://airensoft.gitbook.io/ovenplayer)
58
58
  * User guide for OvenPlayer UI Customize, API Reference, Examples, and more
@@ -73,6 +73,6 @@ AirenSoft aims to make it easier for you to build a stable broadcasting/streamin
73
73
  Therefore, we will continue developing and providing the most optimized tools for smooth Sub-Second Latency Streaming.
74
74
 
75
75
  Would you please click on each link below for details:
76
- * ["JavaScript-based Live Streaming Encdoer" **OvenLiveKit**](https://github.com/AirenSoft/OvenLiveKit-Web)
76
+ * ["JavaScript-based Live Streaming Encoder" **OvenLiveKit**](https://github.com/AirenSoft/OvenLiveKit-Web)
77
77
  * ["Sub-Second Latency Streaming Server with LLHLS and WebRTC" **OvenMediaEngine**](https://github.com/AirenSoft/OvenMediaEngine)
78
78
  * ["JavaScript-based Player with LLHLS and WebRTC" **OvenPlayer**](https://github.com/AirenSoft/OvenPlayer)
@@ -0,0 +1,2 @@
1
+ !function(){function t(t,r=""){return Array.from(t,(t=>("0"+(255&t).toString(16)).slice(-2))).join(r)}function r(r){const e=t(r);return[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,24),e.slice(24,32)].join("-")}function e(r){const e=t(r);return parseInt(e,16)}function n(t,r){for(;r<t.byteLength-4;){if(0===t[r]&&0===t[r+1]&&(1===t[r+2]||0===t[r+2]&&1===t[r+3]))return r;r+=1}return-1}function a(){return new TransformStream({start(){},flush(){},async transform(a,s){(function(t){let r=0;const e=[];for(;r<t.byteLength-4;){const a=n(t,r);if(!(a>=r))break;{const s=n(t,a+(1===t[a+2]?3:4)+1);if(!(s>a)){e.push(t.subarray(a));break}e.push(t.subarray(a,s)),r=s}}return e})(new Uint8Array(a.data)).forEach((n=>{const a=1===n[2]?3:4;if(6==(31&n[a])){const s=function(t){const r=[];let e=0;const n=128===t[t.length-1]?t.length-1:t.length;for(;e<n;){let n=0;for(;255===t[e];)n+=255,e++;n+=t[e++];let a=0;for(;255===t[e];)a+=255,e++;a+=t[e++];const s=t.slice(e,e+a);return e+=a,r.push({type:n,size:a,payload:s}),{type:n,size:a,payload:s}}return r}(function(t){const r=[];for(let e=0;e<t.length;e++)e>2&&0===t[e-2]&&0===t[e-1]&&3===t[e]||r.push(t[e]);return new Uint8Array(r)}(n.subarray(a+1))),o={nalu:n,sei:s};"464d4c475241494e434f4c4f55524201"===t(s.payload.subarray(0,16))?postMessage({action:"sei",data:{...o,registered:!0,uuid:r(s.payload.subarray(0,16)),timecode:e(s.payload.subarray(16,24)),userdata:s.payload.subarray(24)}}):postMessage({action:"sei",data:{...o,registered:!1}})}})),s.enqueue(a)}})}function s({readable:t,writable:r},e){t.pipeThrough(e).pipeTo(r)}addEventListener("rtctransform",(t=>{s(t.transformer,a())})),addEventListener("message",(t=>{const{action:r}=t.data;"rtctransform"===r&&s(t.data,a())}))}();
2
+ //# sourceMappingURL=RTCTransformWorker.worker.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RTCTransformWorker.worker.worker.js","mappings":"YAoDA,SAASA,EAAYC,EAAWC,EAAY,IAC1C,OAAOC,MAAMC,KAAKH,GAAWI,IACnB,KAAc,IAAPA,GAAaC,SAAS,KAAKC,OAAO,KAChDC,KAAKN,EACV,CAQA,SAASO,EAAOR,GACd,MAAMS,EAAYV,EAAYC,GAC9B,MAAO,CACLS,EAAUH,MAAM,EAAG,GACnBG,EAAUH,MAAM,EAAG,IACnBG,EAAUH,MAAM,GAAI,IACpBG,EAAUH,MAAM,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BAAiB,WAAYC,IAC3B,MAAM,OAAEZ,GAAWY,EAAM9B,KAGlB,iBADCkB,GAEJM,EAAUM,EAAM9B,KAAMd,IAI1B,G","sources":["webpack://OvenPlayer/./src/js/api/worker/RTCTransformWorker.worker.js"],"sourcesContent":["/**\n * Created by rock on 2025. 2\n */\n\nconst OVENMEDIAENGINE_SEI_METADATA_UUID = '464d4c475241494e434f4c4f55524201';\n\nfunction removeEmulationPreventionBytes(data) {\n const rbsp = [];\n for (let i = 0; i < data.length; i++) {\n\n if (i > 2 && data[i - 2] === 0x00 && data[i - 1] === 0x00 && data[i] === 0x03) {\n continue; // skip 0x03\n }\n rbsp.push(data[i]);\n }\n return new Uint8Array(rbsp);\n}\n\nfunction parseSEIPayload(rbsp) {\n\n const messages = [];\n\n let i = 0;\n const rbspLength = rbsp[rbsp.length - 1] === 0x80 ? rbsp.length - 1 : rbsp.length;\n\n while (i < rbspLength) {\n\n let type = 0;\n while (rbsp[i] === 0xFF) {\n type += 255;\n i++;\n }\n type += rbsp[i++];\n\n let size = 0;\n while (rbsp[i] === 0xFF) {\n size += 255;\n i++;\n }\n size += rbsp[i++];\n\n const payload = rbsp.slice(i, i + size);\n i += size;\n\n messages.push({ type, size, payload });\n\n return { type, size, payload };\n }\n\n return messages;\n}\n\nfunction toHexString(byteArray, delimiter = '') {\n return Array.from(byteArray, byte => {\n return ('0' + (byte & 0xFF).toString(16)).slice(-2);\n }).join(delimiter);\n}\n\nfunction toHexArray(byteArray) {\n return Array.from(byteArray, byte => {\n return ('0' + (byte & 0xFF).toString(16)).slice(-2);\n });\n}\n\nfunction toUUID(byteArray) {\n const hexString = toHexString(byteArray);\n return [\n hexString.slice(0, 8),\n hexString.slice(8, 12),\n hexString.slice(12, 16),\n hexString.slice(16, 20),\n hexString.slice(20, 24),\n hexString.slice(24, 32)\n ].join('-');\n}\n\nfunction toTimestamp(byteArray) {\n const hexString = toHexString(byteArray);\n return parseInt(hexString, 16);\n}\n\nfunction toAsciiString(byteArray) {\n return String.fromCharCode.apply(null, byteArray);\n}\n\nfunction findNalStartIndex(frameData, offset) {\n while (offset < frameData.byteLength - 4) {\n if ((frameData[offset] === 0x00 && frameData[offset + 1] === 0x00)\n && (frameData[offset + 2] === 0x01 || (frameData[offset + 2] === 0x00 && frameData[offset + 3] === 0x01))) {\n return offset;\n } else {\n offset += 1;\n }\n }\n return -1;\n}\n\nfunction getNalus(frameData) {\n\n let offset = 0;\n const headerSize = 1;\n const nalus = [];\n\n while (offset < frameData.byteLength - 4) {\n\n const startCodeIndex = findNalStartIndex(frameData, offset);\n\n if (startCodeIndex >= offset) {\n\n const startCodeLength = frameData[startCodeIndex + 2] === 0x01 ? 3 : 4;\n const nextStartCodeIndex = findNalStartIndex(frameData, startCodeIndex + startCodeLength + headerSize);\n\n if (nextStartCodeIndex > startCodeIndex) {\n\n nalus.push(frameData.subarray(startCodeIndex, nextStartCodeIndex));\n offset = nextStartCodeIndex;\n } else {\n\n nalus.push(frameData.subarray(startCodeIndex));\n break;\n }\n } else {\n break;\n }\n }\n return nalus;\n}\n\nfunction createReceiverTransform() {\n return new TransformStream({\n start() { },\n flush() { },\n async transform(encodedFrame, controller) {\n\n const nalus = getNalus(new Uint8Array(encodedFrame.data));\n\n nalus.forEach((nalu) => {\n\n const startCodeLength = nalu[2] === 0x01 ? 3 : 4;\n const headerCodeLength = 1;\n const nalHeader = nalu[startCodeLength];\n const nalType = nalHeader & 0x1F;\n\n // NAL Type SEI\n if (nalType === 6) {\n\n const rbsp = removeEmulationPreventionBytes(nalu.subarray(startCodeLength + headerCodeLength));\n\n const parsedSei = parseSEIPayload(rbsp);\n\n const eventData = {\n nalu: nalu,\n sei: parsedSei\n };\n\n const uuid = toHexString(parsedSei.payload.subarray(0, 16));\n\n if (uuid === OVENMEDIAENGINE_SEI_METADATA_UUID) {\n\n postMessage({\n action: 'sei', data: {\n ...eventData,\n registered: true,\n uuid: toUUID(parsedSei.payload.subarray(0, 16)),\n timecode: toTimestamp(parsedSei.payload.subarray(16, 24)),\n userdata: parsedSei.payload.subarray(24)\n }\n });\n } else {\n\n postMessage({\n action: 'sei', data: {\n ...eventData,\n registered: false\n }\n });\n }\n }\n });\n\n controller.enqueue(encodedFrame);\n }\n })\n}\n\nfunction setupPipe({ readable, writable }, transform) {\n readable\n .pipeThrough(transform)\n .pipeTo(writable)\n}\n\naddEventListener('rtctransform', (event) => {\n setupPipe(event.transformer, createReceiverTransform());\n});\n\naddEventListener('message', (event) => {\n const { action } = event.data;\n\n switch (action) {\n case 'rtctransform':\n setupPipe(event.data, createReceiverTransform())\n break;\n default:\n break;\n }\n});\n"],"names":["toHexString","byteArray","delimiter","Array","from","byte","toString","slice","join","toUUID","hexString","toTimestamp","parseInt","findNalStartIndex","frameData","offset","byteLength","createReceiverTransform","TransformStream","start","flush","transform","encodedFrame","controller","nalus","startCodeIndex","nextStartCodeIndex","push","subarray","getNalus","Uint8Array","data","forEach","nalu","startCodeLength","parsedSei","rbsp","messages","i","rbspLength","length","type","size","payload","parseSEIPayload","removeEmulationPreventionBytes","eventData","sei","postMessage","action","registered","uuid","timecode","userdata","enqueue","setupPipe","readable","writable","pipeThrough","pipeTo","addEventListener","event","transformer"],"sourceRoot":""}