-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hello everyone, i get this error : "TypeError: client.shell is not a function". Here is my node server:
const express = require('express');
const { Readable } = require('stream');
const Adb = require('@u4/adbkit');
const app = express();
const client = Adb.createClient();
app.get("/",(req, res) => {
res.sendFile(__dirname + "/test.html");
});
app.get('/video', async (req, res) => {
const stream = client.shell('scrcpy -s R9HT10HL56R --no-display', 'device');
Adb.Utils.readAll(stream).then(output => {
const readable = new Readable();
readable.push(output);
readable.push(null);
res.set('Content-Type', 'video/mp4');
readable.pipe(res);
}).catch(err => {
console.error(err);
res.status(500).send('Error streaming video');
});
});
app.listen(3000, () => {
console.log('Server listening on port 8000');
});
If you have faced with this issue, please give a solution. Thank you.