feat: Add experimental rewrite of go2rtc live provider (MSE/WebRTC/MP4/MJPEG) (#2580)
- Closes #2556 - Closes #2450 **Key intended features:** - go2rtc compatible - 100% test coverage to significantly improve ability to test, maintain and work around browser weirdnesses (e.g. Safari). - Written from the ground up in the style of the rest of the project. **To use:** - Change `live_provider` from `go2rtc` to `go2rtc-experimental`.
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import {
|
||||
createBrowserPeerConnection,
|
||||
GO2RTC_PEER_CONNECTION_CONFIG,
|
||||
} from '../../../../../../src/components-lib/live/providers/go2rtc-experimental/adapters/peer-connection';
|
||||
|
||||
describe('peer-connection', () => {
|
||||
it('should configure two STUN servers with max-bundle', () => {
|
||||
expect(GO2RTC_PEER_CONNECTION_CONFIG).toEqual({
|
||||
bundlePolicy: 'max-bundle',
|
||||
iceServers: [
|
||||
{
|
||||
urls: ['stun:stun.l.google.com:19302', 'stun:stun.cloudflare.com:3478'],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it('should construct a real peer connection', () => {
|
||||
const RTCPeerConnectionMock = vi.fn();
|
||||
vi.stubGlobal('RTCPeerConnection', RTCPeerConnectionMock);
|
||||
|
||||
createBrowserPeerConnection(GO2RTC_PEER_CONNECTION_CONFIG);
|
||||
|
||||
expect(RTCPeerConnectionMock).toHaveBeenCalledWith(GO2RTC_PEER_CONNECTION_CONFIG);
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user