Skip to content
Discussion options

You must be logged in to vote

Hey @coco875 — good catch, this wasn't supported. Just added a sourceAdapter property on <movi-player> so you can plug any custom protocol straight into the element without touching MoviPlayer/Demuxer or reimplementing the UI.

import type { SourceAdapter } from 'movi-player';

class WebSocketSource implements SourceAdapter {
  private pos = 0;
  constructor(private url: string, private totalSize: number) {}

  async getSize() { return this.totalSize; }

  async read(offset: number, length: number): Promise<ArrayBuffer> {
    // your protocol here — return the requested byte range
  }

  seek(offset: number) { this.pos = offset; return offset; }
  getPosition() { return this.pos; }
  close() 

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@coco875
Comment options

@MrUjjwalG
Comment options

@coco875
Comment options

@coco875
Comment options

@MrUjjwalG
Comment options

Answer selected by coco875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants