0.5.6 • Published 4 years ago

video-provider-interface v0.5.6

Weekly downloads
17
License
ISC
Repository
github
Last release
4 years ago

Video Provider Interface

List of supported providers

  • daily.co
  • twilio
  • Jitsi (In progress)

npm install --save video-provider-interface

import VideoProvider from 'video-provider-interface';
const VP = new VideoProvider(VideoProviderLibrary, 'videoProverName');

daily co:

import DailyIframe from '@daily-co/daily-js';
import VideoProvider from 'video-provider-interface';
...
const newCallObject = DailyIframe.createCallObject();
const VP = new VideoProvider(newCallObject, 'dailyco');

twilio:

const Video = require('twilio-video');
import VideoProvider from 'video-provider-interface';
...
const VP = new VideoProvider(Video, 'twilio');

for a custom provider you can always import VideoInterface

import { VideoInterface } from 'video-provider-interface';

class MyCustomProvider extends VideoInterface {}

methods:

  • join(config: any): void; // VP.join({url: dailyCoURL})
  • leave(): void;
  • destroy(): void;
  • startScreenShare(): void;
  • stopScreenShare(): void;
  • participants(): Participant[];
  • meetingState(): string;
  • cycleCamera(): void;

join

dailyco:

VP.join({ url: 'urlToRoom' });

twilio:

VP.join({ token: 'token', roomName: 'roomName' });

Events

To listen an event you must use

VP.on('event-name', callback);
VP.once('event-name-only-once', callback);

supported events:

  • joined
  • left
  • participant-joined
  • participant-updated
  • participant-left
  • error
  • devices-changed

unsubscribe from an event

VP.off('event-name', callback);

clear all events

VP.clearListeners();

Utils

LoggerCallBack

VP.logger([eventList], (event, provider, props) => {
  console.log(event, providers, props);
});

Features supported

EE = Everyone Else

FeatureFunction NameDailyCoTwilioJitsi
Joinjoin(config):heavy_check_mark::heavy_check_mark::soon:
Leaveleave():heavy_check_mark::heavy_check_mark::soon:
Mute CamerasetLocalVideo(Boolean):heavy_check_mark::heavy_check_mark::soon:
Mute AudiosetLocalAudio(Boolean):heavy_check_mark::heavy_check_mark::soon:
Cycle CameracycleCamera():heavy_check_mark::heavy_check_mark::soon:
start ScreenSharestartScreenShare():heavy_check_mark::heavy_check_mark::soon:
List Video devicesgetVideoDevices():heavy_check_mark::heavy_check_mark::soon:
List Audio devicesgetAudioDevices():heavy_check_mark::heavy_check_mark::soon:
Select CameraselectCamera(deviceId):heavy_check_mark::soon::soon:
Select AudioselectAudio(deviceId):heavy_check_mark::soon::soon:
mute EE AudiomuteEEAudio():soon::soon::soon:
mute EE VideomuteEEVideo():soon::soon::soon:
kick outkick(id):soon::soon::soon:
Adjust VolumesetVolume(level):soon::soon::soon:
Active Speaker ModesetActiveSpeakerView(level):soon::soon::soon:
Present Custom Video StreamsendCustomStream(streamMedia,presenter):soon::heavy_check_mark::soon:
0.5.6

4 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago