- 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`.
18 lines
775 B
TypeScript
18 lines
775 B
TypeScript
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 });
|
|
});
|
|
});
|