Skip to content

feat: allow custom RTCPeerConnection config#88

Open
hanifanazka wants to merge 1 commit into
Eyevinn:mainfrom
hanifanazka:main
Open

feat: allow custom RTCPeerConnection config#88
hanifanazka wants to merge 1 commit into
Eyevinn:mainfrom
hanifanazka:main

Conversation

@hanifanazka

Copy link
Copy Markdown

Allow custom RTCPeerConnection configuration. This is inspired of myown need to switch encodedInsertableStreams true to cater WebRTC Insertable Streams.

This edit hasn't thoroughly tested, so advices are welcomed. Alternatively, this workaround found successful in my test:

const OriginalRTCPeerConnection = window.RTCPeerConnection;
window.RTCPeerConnection = function (config: any) {
  // Force the flag into every new connection
  const newConfig = { ...config, encodedInsertableStreams: true };
  return new OriginalRTCPeerConnection(newConfig);
} as any;

const webrtcPlayer = new WebRTCPlayer({
  video: videoRef.current,
  type: 'whep',
});

window.RTCPeerConnection = OriginalRTCPeerConnection;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant