Clip Web videos.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

30 linhas
880 B

  1. type ProcessEvent = { type: string, phase: string, command?: string };
  2. type ProcessEventCallback = (event: ProcessEvent) => void;
  3. type ErrorEventCallback = (event: Error) => void;
  4. type SuccessEvent = { contentType: string, content: Buffer };
  5. type SuccessEventCallback = (event: SuccessEvent) => void;
  6. export interface VideoClipEventEmitter extends NodeJS.EventEmitter {
  7. process(): void;
  8. on(eventType: 'process', callback: ProcessEventCallback): this;
  9. on(eventType: 'error', callback: ErrorEventCallback): this;
  10. on(eventType: 'end', callback: () => void): this;
  11. on(eventType: 'success', callback: SuccessEventCallback): this;
  12. }
  13. export const FILE_TYPES: Record<string, string> = {
  14. mkv: 'video/x-matroska',
  15. webm: 'video/webm',
  16. mp4: 'video/mp4',
  17. };
  18. export interface CreateBaseClipperParams {
  19. url: string;
  20. start?: number | string;
  21. end?: number | string;
  22. }