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:
@@ -21,7 +21,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
await controller.play();
|
||||
await controller.playback.play();
|
||||
|
||||
expect(videoElement.play).toBeCalled();
|
||||
});
|
||||
@@ -35,7 +35,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
await controller.pause();
|
||||
await controller.playback.pause();
|
||||
|
||||
expect(videoElement.stop).toBeCalled();
|
||||
});
|
||||
@@ -140,18 +140,6 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should ignore seek', async () => {
|
||||
const controller = new JSMPEGMediaPlayerController(
|
||||
createLitElement(),
|
||||
() => mock<JSMpeg.VideoElement>(),
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
await controller.seek(10);
|
||||
|
||||
// Currently no observable side effects.
|
||||
});
|
||||
|
||||
it('should ignore set controls', async () => {
|
||||
const controller = new JSMPEGMediaPlayerController(
|
||||
createLitElement(),
|
||||
@@ -175,7 +163,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
expect(controller.isPaused()).toBeTruthy();
|
||||
expect(controller.playback.isPaused()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return false when not paused', async () => {
|
||||
@@ -189,7 +177,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
expect(controller.isPaused()).toBeFalsy();
|
||||
expect(controller.playback.isPaused()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return true when no video', () => {
|
||||
@@ -199,7 +187,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
() => mock<HTMLCanvasElement>(),
|
||||
);
|
||||
|
||||
expect(controller.isPaused()).toBeTruthy();
|
||||
expect(controller.playback.isPaused()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user