Skip to content

Commit

Permalink
Initialize worker on drm track to avoid error thrown (#436)
Browse files Browse the repository at this point in the history
* Add guard to worker to avoid error thrown

* Create worker if not set before

* Bump RC version
  • Loading branch information
Santiago Souto authored Sep 12, 2024
1 parent 8072bf8 commit 97f6be6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/millicast-sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/millicast-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@millicast/sdk",
"version": "0.3.0-RC-4",
"version": "0.3.0-RC-5",
"description": "SDK for building a realtime broadcaster using the Millicast platform.",
"keywords": [
"sdk",
Expand Down
3 changes: 3 additions & 0 deletions packages/millicast-sdk/src/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ export default class View extends BaseWebRTC {
logger.error('Failed to apply DRM on media Id:', mediaId, 'error is: ', error)
this.emit('error', new Error('Failed to apply DRM on media Id: ' + mediaId + ' error is: ' + error))
}
if (!this.worker) {
this.worker = new TransformWorker()
}
this.worker.addEventListener('message', (message) => {
if (message.data.event === 'complete') {
// feed the frame to DRM processing worker
Expand Down

0 comments on commit 97f6be6

Please sign in to comment.