영상 연결 기능

미디어 서버에 영상 송신

  • 예시

index.js
const stream = await navigator.mediaDevices.getUserMedia({ video: true });

await knowledgetalk.publishVideo('cam', stream);

  • 타입

publishvideo(
    type: 'cam';
    stream: MediaStream;
): Promise<boolean>;

  • 요청 상세

Parameter
Description
Example

type

'cam'

'cam'

stream

서버와 연결할 영상 스트림

MediaStream

  • 응답 상세 성공 시 true, 실패 시 false

미디어 서버에 영상 수신

  • 예시

  • 타입

  • 요청 상세

Parameter
Description
Example

userId

상대방의 유저 아이디

'kpoint123'

type

'cam'

  • 응답 상세

성공 시 상대방 video stream 리턴, 실패 시 false 리턴

P2P 영상 전송

  • 예시

  • 타입

  • 요청 상세

Parameter
Description
Example

userId

영상을 받을 상대방 유저 아이디

'kpoint123'

type

'cam'

'cam'

stream

영상 스트림

MediaStream

  • 응답 상세

    성공 시 true, 실패 시 false 리턴

피어 종료

  • 예시

  • 타입

  • 요청 상세

Parameter
Description
Example

target

종료할 피어의 아이디

'kpoint123'

type

cam / screen 구분

'cam'

  • 응답 상세

    성공 시 true, 실패 시 false 리턴

영상 정보 변경

  • 예시

  • 타입

  • 요청 상세

Parameter
Description
Example

stream

새로 변경될 영상 스트림

MediaStream

target

p2p인 경우 상대방 USER ID

'kpoint123'

  • 응답 상세

    성공 시 true, 실패 시 false

Last updated