@banou/media-player 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/build/components/chrome.d.ts +4 -0
- package/build/components/control-bar.d.ts +5 -0
- package/build/components/overlay.d.ts +1 -0
- package/build/components/progress-bar.d.ts +1 -0
- package/build/components/settings.d.ts +2 -0
- package/build/components/sound.d.ts +4 -0
- package/build/components/tooltip-display.d.ts +20 -0
- package/build/components/volume-slider.d.ts +6 -0
- package/build/index.d.ts +23 -48
- package/build/index.js +2576 -2250
- package/build/main.d.ts +1 -1
- package/build/state-machines/data-source.d.ts +27 -0
- package/build/state-machines/index.d.ts +33185 -0
- package/build/state-machines/media-properties.d.ts +45 -0
- package/build/state-machines/media-source.d.ts +34 -0
- package/build/state-machines/media.d.ts +8344 -0
- package/build/state-machines/subtitles.d.ts +53 -0
- package/build/state-machines/thumbnails.d.ts +24 -0
- package/build/state-machines/utils.d.ts +26 -0
- package/build/utils/actor-utils.d.ts +2 -0
- package/build/utils/colors.d.ts +8 -0
- package/build/utils/context.d.ts +14 -0
- package/build/utils/fonts.d.ts +28 -0
- package/build/{utils.d.ts → utils/index.d.ts} +4 -12
- package/build/utils/languages.d.ts +260 -0
- package/build/{mp4box.d.ts → utils/mp4box.d.ts} +61 -61
- package/build/utils/time.d.ts +2 -0
- package/build/utils/use-local-storage.d.ts +3 -0
- package/build/{use-scrub.d.ts → utils/use-scrub.d.ts} +11 -11
- package/build/utils/volume-utils.d.ts +17 -0
- package/build/utils/window-height.d.ts +2 -0
- package/package.json +15 -12
- package/src/assets/picture-in-picture.svg +5 -0
- package/src/components/chrome.tsx +89 -0
- package/src/components/control-bar.tsx +330 -0
- package/src/components/overlay.tsx +28 -0
- package/src/components/progress-bar.tsx +252 -0
- package/src/components/settings.tsx +269 -0
- package/src/components/sound.tsx +101 -0
- package/src/components/tooltip-display.tsx +83 -0
- package/src/components/volume-slider.tsx +156 -0
- package/src/index.tsx +145 -435
- package/src/main.tsx +66 -39
- package/src/state-machines/data-source.ts +83 -0
- package/src/state-machines/index.ts +5 -0
- package/src/state-machines/media-properties.ts +78 -0
- package/src/state-machines/media-source.ts +129 -0
- package/src/state-machines/media.ts +245 -0
- package/src/state-machines/subtitles.ts +247 -0
- package/src/state-machines/thumbnails.ts +123 -0
- package/src/state-machines/utils.ts +94 -0
- package/src/utils/actor-utils.ts +19 -0
- package/src/utils/colors.ts +9 -0
- package/src/utils/context.ts +23 -0
- package/src/utils/fonts.ts +156 -0
- package/src/{utils.ts → utils/index.ts} +2 -26
- package/src/utils/time.ts +16 -0
- package/src/utils/use-local-storage.ts +30 -0
- package/src/utils/volume-utils.ts +39 -0
- package/src/utils/window-height.ts +19 -0
- package/tsconfig.json +4 -2
- package/build/chrome/bottom.d.ts +0 -22
- package/build/chrome/index.d.ts +0 -28
- package/build/chrome/overlay.d.ts +0 -9
- package/build/languages.d.ts +0 -260
- package/build/use-local-storage.d.ts +0 -6
- package/src/chrome/bottom.tsx +0 -697
- package/src/chrome/index.tsx +0 -203
- package/src/chrome/overlay.tsx +0 -104
- package/src/use-local-storage.ts +0 -32
- /package/src/{languages.ts → utils/languages.ts} +0 -0
- /package/src/{mp4box.ts → utils/mp4box.ts} +0 -0
- /package/src/{use-scrub.ts → utils/use-scrub.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
type MediaPropertiesEvents = {
|
|
2
|
+
type: 'PLAY';
|
|
3
|
+
} | {
|
|
4
|
+
type: 'PAUSE';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'SET_TIME';
|
|
7
|
+
value: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'SET_VOLUME';
|
|
10
|
+
muted: boolean;
|
|
11
|
+
volume: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'SET_PLAYBACK_RATE';
|
|
14
|
+
playbackRate: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'DESTROY';
|
|
17
|
+
};
|
|
18
|
+
type MediaPropertiesEmittedEvents = {
|
|
19
|
+
type: 'PLAYING';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'PAUSED';
|
|
22
|
+
} | {
|
|
23
|
+
type: 'TIME_UPDATE';
|
|
24
|
+
currentTime: number;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'VOLUME_UPDATE';
|
|
27
|
+
muted: boolean;
|
|
28
|
+
volume: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'PLAYBACK_RATE_UPDATE';
|
|
31
|
+
playbackRate: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'DURATION_UPDATE';
|
|
34
|
+
duration: number;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'SEEKING';
|
|
37
|
+
currentTime: number;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'ENDED';
|
|
40
|
+
};
|
|
41
|
+
type MediaPropertiesInput = {
|
|
42
|
+
videoElement: HTMLVideoElement;
|
|
43
|
+
};
|
|
44
|
+
declare const _default: import("xstate").CallbackActorLogic<MediaPropertiesEvents, MediaPropertiesInput, MediaPropertiesEmittedEvents>;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { makeRemuxer } from 'libav-wasm';
|
|
2
|
+
type MediaSourceEvents = ({
|
|
3
|
+
type: 'METADATA';
|
|
4
|
+
} & Awaited<ReturnType<Awaited<ReturnType<typeof makeRemuxer>>['init']>>) | {
|
|
5
|
+
type: 'TIMESTAMP_OFFSET';
|
|
6
|
+
timestampOffset: number;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'DATA';
|
|
9
|
+
data: ArrayBuffer;
|
|
10
|
+
};
|
|
11
|
+
type MediaSourceEmittedEvents = {
|
|
12
|
+
type: 'SOURCE_BUFFER_READY';
|
|
13
|
+
} | {
|
|
14
|
+
type: 'SOURCE_OPEN';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'SOURCE_ENDED';
|
|
17
|
+
} | {
|
|
18
|
+
type: 'SOURCE_ERROR';
|
|
19
|
+
} | {
|
|
20
|
+
type: 'NEED_DATA';
|
|
21
|
+
};
|
|
22
|
+
export type MediaSourceOptions = {
|
|
23
|
+
preEvictionTime?: number;
|
|
24
|
+
postEvictionTime?: number;
|
|
25
|
+
bufferTargetTime?: number;
|
|
26
|
+
};
|
|
27
|
+
type MediaSourceInput = {
|
|
28
|
+
videoElement: HTMLVideoElement;
|
|
29
|
+
preEvictionTime?: number;
|
|
30
|
+
postEvictionTime?: number;
|
|
31
|
+
bufferTargetTime?: number;
|
|
32
|
+
};
|
|
33
|
+
declare const _default: import("xstate").CallbackActorLogic<MediaSourceEvents, MediaSourceInput, MediaSourceEmittedEvents>;
|
|
34
|
+
export default _default;
|