export type MediaSessionCreateInput = {
  streamSessionId: string;
  ownerUserId: string;
  cameraDeviceId: string;
  requesterDeviceId: string;
};

export type MediaPublishCredentials = {
  provider: string;
  mediaSessionId: string;
  publishToken: string;
  publishUrl: string;
  expiresInSeconds: number;
};

export type MediaSubscribeCredentials = {
  provider: string;
  mediaSessionId: string;
  subscribeToken: string;
  subscribeUrl: string;
  expiresInSeconds: number;
};

export type MediaSessionCreateResult = {
  provider: string;
  mediaSessionId: string;
  publishUrl: string;
  subscribeUrl: string;
};

export interface MediaProvider {
  name: string;
  createSession(input: MediaSessionCreateInput): Promise<MediaSessionCreateResult>;
  issuePublishCredentials(input: {
    mediaSessionId: string;
    cameraDeviceId: string;
    ownerUserId: string;
  }): Promise<MediaPublishCredentials>;
  issueSubscribeCredentials(input: {
    mediaSessionId: string;
    viewerDeviceId: string;
    ownerUserId: string;
  }): Promise<MediaSubscribeCredentials>;
}
