-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.js
36 lines (32 loc) · 1.02 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {
DjiDevice,
djiDeviceBitrates,
DjiDeviceImageStabilization,
DjiDeviceModel,
DjiDeviceResolution,
} from './dist/index.js';
/*
import { DjiDeviceScanner, DjiDiscoveredDevice } from './dist/index.js';
const { shared: scanner } = DjiDeviceScanner;
console.log('Starting DJI device scanner...');
scanner.startScanningForDevices();
scanner.on(
'deviceDiscovered',
async ({ peripheral, model, modelName }: DjiDiscoveredDevice) => {
const device = new DjiDevice();
console.log('Discovered device:', device, peripheral, model, modelName);
},
);
scanner.stopScanningForDevices();
*/
const device = new DjiDevice('id-of-device', DjiDeviceModel.osmoAction4);
console.log('Device:', device);
await device.startLiveStream(
'Wi-Fi-Name', // wi-fi name
'Wi-Fi-Password', // wi-fi password
'rtmp://1.3.3.7:1935/live/rtmp', // rtmp url
DjiDeviceResolution.r1080p, // resolution
30,
djiDeviceBitrates[djiDeviceBitrates.length - 1], // bitrate
DjiDeviceImageStabilization.RockSteadyPlus, // stabilization mode
);