Skip to content

🎥 Make videos programmatically with React

skip on windows

Jonny Burger8314aeef2f63
diff --git a/packages/media-parser/src/test/seeking/seek-to-byte.test.ts b/packages/media-parser/src/test/seeking/seek-to-byte.test.ts
index b1feab641c..d574199714 100644
--- a/packages/media-parser/src/test/seeking/seek-to-byte.test.ts
+++ b/packages/media-parser/src/test/seeking/seek-to-byte.test.ts
@@ -5,84 +5,86 @@ import {mediaParserController} from '../../media-parser-controller';
import {nodeReader} from '../../node';
import {parseMedia} from '../../parse-media';
-test('should not be able to seek to a byte too early', async () => {
- const controller = mediaParserController();
+if (process.platform !== 'win32') {
+ test('should not be able to seek to a byte too early', async () => {
+ const controller = mediaParserController();
- try {
- controller._experimentalSeek({
- type: 'byte',
- byte: 5,
- });
+ try {
+ controller._experimentalSeek({
+ type: 'byte',
+ byte: 5,
+ });
- await parseMedia({
- src: exampleVideos.bigBuckBunny,
- controller,
- reader: nodeReader,
- acknowledgeRemotionLicense: true,
- fields: {
- dimensions: true,
- },
- });
- throw new Error('should not complete');
- } catch (err) {
- expect((err as Error).message).toBe(
- 'Cannot seek to a byte that is not in the video section. Seeking to: 5, section: start: 48, end: 14282315',
- );
- }
-});
+ await parseMedia({
+ src: exampleVideos.bigBuckBunny,
+ controller,
+ reader: nodeReader,
+ acknowledgeRemotionLicense: true,
+ fields: {
+ dimensions: true,
+ },
+ });
+ throw new Error('should not complete');
+ } catch (err) {
+ expect((err as Error).message).toBe(
+ 'Cannot seek to a byte that is not in the video section. Seeking to: 5, section: start: 48, end: 14282315',
+ );
+ }
+ });
-test('should not be able to seek to a byte beyond the file', async () => {
- const controller = mediaParserController();
+ test('should not be able to seek to a byte beyond the file', async () => {
+ const controller = mediaParserController();
- try {
- controller._experimentalSeek({
- type: 'byte',
- byte: 1_000_000_000,
- });
+ try {
+ controller._experimentalSeek({
+ type: 'byte',
+ byte: 1_000_000_000,
+ });
- await parseMedia({
- src: exampleVideos.bigBuckBunny,
- controller,
- reader: nodeReader,
- acknowledgeRemotionLicense: true,
- fields: {
- dimensions: true,
- },
- });
- throw new Error('should not complete');
- } catch (err) {
- expect((err as Error).message).toBe(
- 'Cannot seek to a byte that is not in the video section. Seeking to: 1000000000, section: start: 48, end: 14282315',
- );
- }
-});
+ await parseMedia({
+ src: exampleVideos.bigBuckBunny,
+ controller,
+ reader: nodeReader,
+ acknowledgeRemotionLicense: true,
+ fields: {
+ dimensions: true,
+ },
+ });
+ throw new Error('should not complete');
+ } catch (err) {
+ expect((err as Error).message).toBe(
+ 'Cannot seek to a byte that is not in the video section. Seeking to: 1000000000, section: start: 48, end: 14282315',
+ );
+ }
+ });
-test('should be able to seek to a valid byte', async () => {
- const controller = mediaParserController();
+ test('should be able to seek to a valid byte', async () => {
+ const controller = mediaParserController();
- try {
- controller._experimentalSeek({
- type: 'byte',
- byte: 3224491,
- });
+ try {
+ controller._experimentalSeek({
+ type: 'byte',
+ byte: 3224491,
+ });
- await parseMedia({
- src: exampleVideos.bigBuckBunny,
- controller,
- reader: nodeReader,
- fields: {
- dimensions: true,
- },
- onVideoTrack: () => {
- return (sample) => {
- expect(sample.offset).toBe(3224491);
- controller.abort();
- };
- },
- acknowledgeRemotionLicense: true,
- });
- throw new Error('should not complete');
- } catch (err) {
- expect(hasBeenAborted(err as Error)).toBe(true);
- }
-});
+ await parseMedia({
+ src: exampleVideos.bigBuckBunny,
+ controller,
+ reader: nodeReader,
+ fields: {
+ dimensions: true,
+ },
+ onVideoTrack: () => {
+ return (sample) => {
+ expect(sample.offset).toBe(3224491);
+ controller.abort();
+ };
+ },
+ acknowledgeRemotionLicense: true,
+ });
+ throw new Error('should not complete');
+ } catch (err) {
+ expect(hasBeenAborted(err as Error)).toBe(true);
+ }
+ });
+}