Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/playback/.size-limit.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[
{
"path": "dist/player/core/cjs/index.min.js",
"limit": "1 s"
"limit": "800 ms"
},
{
"path": "dist/player/core/es/index.min.js",
"limit": "1 s"
"limit": "800 ms"
},
{
"path": "dist/player/core/iife/index.min.js",
"limit": "1 s"
"limit": "800 ms"
},
{
"path": "dist/player-with-worker/core/cjs/index.min.js",
"limit": "1 s"
"limit": "800 ms"
},
{
"path": "dist/player-with-worker/core/es/index.min.js",
"limit": "1 s"
"limit": "800 ms"
},
{
"path": "dist/player-with-worker/core/iife/index.min.js",
"limit": "1 s"
"limit": "800 ms"
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ChunkPlaylistParser } from '@videojs/hls-parser';

import type { IPipeline, IPipelineLoader, IPipelineLoaderDependencies } from '../types/pipeline.declarations';
import type { INetworkManager, INetworkRequest } from '../types/network.declarations';
import type { ILogger } from '../types/logger.declarations';
Expand All @@ -14,10 +13,14 @@ interface IHlsPipelineLoaderDependencies extends IPipelineLoaderDependencies {
export class HlsPipelineLoader implements IPipelineLoader {
private static hlsParserFactory_: typeof ChunkPlaylistParser | null = null;

public static setHlsParser(parser: typeof ChunkPlaylistParser): void {
public static setHlsParserFactory(parser: typeof ChunkPlaylistParser): void {
HlsPipelineLoader.hlsParserFactory_ = parser;
}

public static getHlsParserFactory(): typeof ChunkPlaylistParser | null {
return HlsPipelineLoader.hlsParserFactory_;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename getters and setter as getHlsParserFactory and setHlsParserFactory?


public static setVodPipelineFactory(): void {}

public static setLivePipelineFactory(): void {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest';
import { HlsPipelineLoader } from '../../../src/lib/pipeline-loaders/hls-pipeline-loader';
import { ChunkPlaylistParser } from '@videojs/hls-parser';

describe('hls-pipeline-loader spec', () => {
it('parser is static pipeline loader member', () => {
expect(HlsPipelineLoader.getHlsParserFactory()).toBe(null);
// set parser
HlsPipelineLoader.setHlsParserFactory(ChunkPlaylistParser);
const ChunkHlsParser = HlsPipelineLoader.getHlsParserFactory();
expect(ChunkHlsParser).toBeTypeOf('function');
const parser = ChunkHlsParser ? ChunkHlsParser.create({}) : null;
expect(parser).toBeInstanceOf(ChunkPlaylistParser);
});
});
13 changes: 13 additions & 0 deletions packages/playback/test/lib/service-locator.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ServiceLocator } from '../../src/lib/service-locator';
import { beforeEach, describe, expect, it } from 'vitest';

describe('Service locator spec', () => {
let serviceLocator: ServiceLocator;
beforeEach(() => {
serviceLocator = new ServiceLocator();
});

it('should create a service locator instance', () => {
expect(serviceLocator).toBeInstanceOf(ServiceLocator);
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this test for now?