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:
+17
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { LiveEdgeTracker } from '../../../../../../../src/components-lib/live/providers/go2rtc-experimental/utils/live-edge-tracker';
|
||||
import { createStatus } from './test-utils';
|
||||
|
||||
describe('LiveEdgeTracker', () => {
|
||||
it('should use the seek strategy on WebKit', () => {
|
||||
const tracker = new LiveEdgeTracker({ webkit: true });
|
||||
// Far behind: the WebKit strategy seeks to the default 3s hold-back.
|
||||
expect(tracker.next(createStatus(20, 13))).toEqual({ action: 'seek', seconds: 17 });
|
||||
});
|
||||
|
||||
it('should use the playback-rate strategy on other browsers', () => {
|
||||
const tracker = new LiveEdgeTracker({ webkit: false });
|
||||
expect(tracker.next(createStatus(20, 18))).toEqual({ action: 'rate', rate: 1 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user