The processor stops working after receiving the connection-change event with the state Reconnecting

Description

I am implementing an AI avatar feature using VideoProcessor. However, after encountering a network instability (receiving a connection-change event with the state Reconnecting), I noticed that the VideoProcessor no longer continues to processFrame even after I receive the Connected state again from the connection-change event.

I tried recreating the processor using createProcessor, but got the following error:

{type: 'INVALID_PARAMETERS', reason: 'You have already created this Processor', errorCode: 6121}

I also attempted to restart the existing processor, but it seems that the MessagePort inside the processor is no longer functional, as I can no longer receive any messages from it.

Web Video SDK version: 2.2.5


Video SDK Code Snippets

Listening for messages in VideoProcessor:

class AvatarProcessor extends VideoProcessor {
  constructor(port: MessagePort, options?: any) {
    super(port, options);

    port.addEventListener('message', async (e) => {
      console.log('AvatarProcessor received message:', e.data);
    });
  }

}

Where the event is sent:

  sendMessage(type, data) {
    this.processor?.port.postMessage({
      'type': type,
      'data': data
    });
  }

Device (please complete the following information):

  • Device: Mac Mini M1

  • OS: macOS 15.5

  • Browser: Chrome

  • Browser Version: 138.0.7204.157 (Official Build) (arm64)


@vic.yang Do you have any suggestions for me in this case?

Hey @namlv

Thanks for your feedback.

It’s a known issue, and we will fix it in the upcoming release.

Thanks
Vic

Thank you for your feedback.