@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.
Files changed (74) hide show
  1. package/README.md +0 -10
  2. package/build/components/chrome.d.ts +4 -0
  3. package/build/components/control-bar.d.ts +5 -0
  4. package/build/components/overlay.d.ts +1 -0
  5. package/build/components/progress-bar.d.ts +1 -0
  6. package/build/components/settings.d.ts +2 -0
  7. package/build/components/sound.d.ts +4 -0
  8. package/build/components/tooltip-display.d.ts +20 -0
  9. package/build/components/volume-slider.d.ts +6 -0
  10. package/build/index.d.ts +23 -48
  11. package/build/index.js +2576 -2250
  12. package/build/main.d.ts +1 -1
  13. package/build/state-machines/data-source.d.ts +27 -0
  14. package/build/state-machines/index.d.ts +33185 -0
  15. package/build/state-machines/media-properties.d.ts +45 -0
  16. package/build/state-machines/media-source.d.ts +34 -0
  17. package/build/state-machines/media.d.ts +8344 -0
  18. package/build/state-machines/subtitles.d.ts +53 -0
  19. package/build/state-machines/thumbnails.d.ts +24 -0
  20. package/build/state-machines/utils.d.ts +26 -0
  21. package/build/utils/actor-utils.d.ts +2 -0
  22. package/build/utils/colors.d.ts +8 -0
  23. package/build/utils/context.d.ts +14 -0
  24. package/build/utils/fonts.d.ts +28 -0
  25. package/build/{utils.d.ts → utils/index.d.ts} +4 -12
  26. package/build/utils/languages.d.ts +260 -0
  27. package/build/{mp4box.d.ts → utils/mp4box.d.ts} +61 -61
  28. package/build/utils/time.d.ts +2 -0
  29. package/build/utils/use-local-storage.d.ts +3 -0
  30. package/build/{use-scrub.d.ts → utils/use-scrub.d.ts} +11 -11
  31. package/build/utils/volume-utils.d.ts +17 -0
  32. package/build/utils/window-height.d.ts +2 -0
  33. package/package.json +15 -12
  34. package/src/assets/picture-in-picture.svg +5 -0
  35. package/src/components/chrome.tsx +89 -0
  36. package/src/components/control-bar.tsx +330 -0
  37. package/src/components/overlay.tsx +28 -0
  38. package/src/components/progress-bar.tsx +252 -0
  39. package/src/components/settings.tsx +269 -0
  40. package/src/components/sound.tsx +101 -0
  41. package/src/components/tooltip-display.tsx +83 -0
  42. package/src/components/volume-slider.tsx +156 -0
  43. package/src/index.tsx +145 -435
  44. package/src/main.tsx +66 -39
  45. package/src/state-machines/data-source.ts +83 -0
  46. package/src/state-machines/index.ts +5 -0
  47. package/src/state-machines/media-properties.ts +78 -0
  48. package/src/state-machines/media-source.ts +129 -0
  49. package/src/state-machines/media.ts +245 -0
  50. package/src/state-machines/subtitles.ts +247 -0
  51. package/src/state-machines/thumbnails.ts +123 -0
  52. package/src/state-machines/utils.ts +94 -0
  53. package/src/utils/actor-utils.ts +19 -0
  54. package/src/utils/colors.ts +9 -0
  55. package/src/utils/context.ts +23 -0
  56. package/src/utils/fonts.ts +156 -0
  57. package/src/{utils.ts → utils/index.ts} +2 -26
  58. package/src/utils/time.ts +16 -0
  59. package/src/utils/use-local-storage.ts +30 -0
  60. package/src/utils/volume-utils.ts +39 -0
  61. package/src/utils/window-height.ts +19 -0
  62. package/tsconfig.json +4 -2
  63. package/build/chrome/bottom.d.ts +0 -22
  64. package/build/chrome/index.d.ts +0 -28
  65. package/build/chrome/overlay.d.ts +0 -9
  66. package/build/languages.d.ts +0 -260
  67. package/build/use-local-storage.d.ts +0 -6
  68. package/src/chrome/bottom.tsx +0 -697
  69. package/src/chrome/index.tsx +0 -203
  70. package/src/chrome/overlay.tsx +0 -104
  71. package/src/use-local-storage.ts +0 -32
  72. /package/src/{languages.ts → utils/languages.ts} +0 -0
  73. /package/src/{mp4box.ts → utils/mp4box.ts} +0 -0
  74. /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;