"react-native": "^0.59.6",
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
}
dependencies {
compile "com.facebook.react:react-native:+" // From node_modules
compile 'com.ksyun.media:libksyplayer-arm64:2.2.4'
compile 'com.ksyun.media:libksyplayer-x86:2.2.4'
compile 'com.ksyun.media:libksyplayer-armv7a:2.2.4'
compile 'com.ksyun.media:libksyplayer-java:2.2.4'
}
> Task :app:processDebugManifest FAILED
Z:\phone-app\android\app\src\debug\AndroidManifest.xml:11:7-34 Error:
Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:7-34
is also present at [:react-native-ksyvideo] AndroidManifest.xml:19:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-138 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:11:7-34
is also present at [:react-native-ksyvideo] AndroidManifest.xml:19:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-138 to override.
'ws://10.0.2.2:8080/'
. Если интересует, то делал так:const WebSocket = require('ws');
const wss = new WebSocket.Server({
port: 8080,
perMessageDeflate: {
zlibDeflateOptions: {
// See zlib defaults.
chunkSize: 1024,
memLevel: 7,
level: 3
},
zlibInflateOptions: {
chunkSize: 10 * 1024
},
// Other options settable:
clientNoContextTakeover: true, // Defaults to negotiated value.
serverNoContextTakeover: true, // Defaults to negotiated value.
serverMaxWindowBits: 10, // Defaults to negotiated value.
// Below options specified as default values.
concurrencyLimit: 10, // Limits zlib concurrency for perf.
threshold: 1024 // Size (in bytes) below which messages
// should not be compressed.
}
});
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
const {type: messageType} = JSON.parse(message);
console.log("type", messageType);
console.log('received: %s', message);
ws.send('reply from server : ' + message)
});
ws.send('something');
});
ffmpeg -f dshow -i video="screen-capture-recorder" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -c:a aac -ar 44100 -f flv rtmp://localhost/live/STREAM_NAME
const spawn = require('child_process').spawn;
const command = spawn('ffmpeg', [
// '-f', 'dshow',
// '-i', 'video="screen-capture-recorder"',
'-f', 'gdigrab',
'-preset', 'ultrafast',
'-vcodec', 'libx264',
'-tune', 'zerolatency',
'-b:v', '900k',
'-c:a', 'aac',
'-ar', '44100',
'-f', 'flv',
'rtmp://localhost/live/STREAM_NAME'
]);
command.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
command.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
command.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
stderr: Output #0, flv, to 'rtmp://localhost/live/STREAM_NAME':
stderr: Output file #0 does not contain any stream
child process exited with code 1