Unoficial Node.js SDK for skyway-webrtc-gateway
Suppot
- [○] Raspberry Pi 3
- [×] Raspberry Pi Zero W
Required
$ sudo apt update
$ sudo apt -y upgrade
$ sudo apt install -y autoconf automake libtool
$ sudo apt install -y gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
$ wget https://github.com/thaytan/gst-rpicamsrc/archive/master.zip
$ unzip master.zip
$ cd gst-rpicamsrc-master
$ ./autogen.sh --prefix=/usr --libdir=/usr/lib/arm-linux-gnueabihf/
$ make
$ sudo make install
Install GateWay
Dwonload GateWay & Save to ~/.skyway
$ curl -L -o ~/.skyway/gateway_linux_arm --create-dirs https://github.com/skyway/skyway-webrtc-gateway/releases/download/0.0.4/gateway_linux_arm
$ chmod +x ~/.skyway/gateway_linux_arm
Install this Module
$ npm init -y
$ npm i skyway-gateway
Exsample
'use strict';const SkyWay = ; const options = apikey: `My SkyWay API Key` // API KEY peer_id: processargv2 camera: 'RASPI' // RASPI or USB codec: 'H264' //VP8 or H264 // targetHost: '', // domain: '', const skyway = options;async { await skyway; //skyway-gateway path const peerData = await skywaystart; console; skyway;};
$ node app.js hogehoge
- you can test this page
https://n0bisuke.github.io/skyway-webrtc-gateway-sdk-node.js/?apikey=<APIKEY>&peerid=<PeerID>
EX) https://n0bisuke.github.io/skyway-webrtc-gateway-sdk-node.js/?apikey=7f92eda4-ece8-4e8c-b20b-xxxxxxx&peerid=hogehoge
other
frontend sample
SkyWay JS SDK Tutorial call send message
python -m SimpleHTTPServer 8080
- use data channel
'use strict';const SkyWay = ; const options = apikey: `My SkyWay API Key` peerid: processargv2 const skyway = options;async { await skyway; await skywaystart; // not use media -> {media: faluse}}; skyway;
- use gpio
'use strict';const SkyWay = ; const options = apikey: `My SkyWay API Key` peerid: processargv2 const skyway = options;async { await skyway await skywaystart}; const Gpio = Gpio;const led = 20 'out'; skyway;