1.0.7 • Published 11 months ago

@dao42/d42paas_rtc v1.0.7

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

D42RTC

RTC Server && RTC SDK

Webapp

Debug user

http://localhost:3000/?cid=local-test&uid=1&sid=1&apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9

# simulation event
http://localhost:3000/admin/

Depend

npm install @pano.video/panortc
npm install agora-rtc-sdk-ng
npm install flv.js
npm install hls.js

Example: Rtc

import { D42RTC, Events, ID } from '@dao42/d42paas_rtc'

import AgoraRTC from 'agora-rtc-sdk-ng'
import PanoRtc from '@pano.video/panortc'

const currentID = {
  cid: "1",
  uid: "1",
  sid: "1",
}

const d42rtc = new D42RTC({
  id: currentID,
  server: "http://develop.1024paas.com",
  token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
  dep: {
    agora: AgoraRTC,
    pano: PanoRtc,
  },
})

d42rtc.join()

Example: Playback

import { Playback } from '@dao42/d42paas_rtc'

import flvjs from 'flv.js'
import Hls from 'hls.js'

const playback = new Playback(
  "http://develop.1024paas.com",
  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
  {
    hls: Hls,
    flv: flvjs,
  },
)

// Play Default player
await playback.playMedia("<mediaId>", "<HTMLVideoElement>")

// Destroy
playback.destroy()

// Get Media src, use custom player
const media = await playback.getMedia("<mediaId>")
// media: {
//    contentType:
//    url:
// }
1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.4

2 years ago

0.2.0

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.2.2

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago