AgoraIO-Community / Agora-Electron-Quickstart

Quickstart for Agora Electron SDK(Windows/macOS) https://github.com/AgoraIO/Electron-SDK
71 stars 36 forks source link

Add Inject Stream not working in electron #44

Closed silarvaibhav closed 4 years ago

silarvaibhav commented 4 years ago

When I am trying to inject stream in electron following error is coming: api addInjectStreamUrl failed. this is an error thrown by c++ addon layer. it often means sth is going wrong with this function call and it refused to do what is asked. kindly check your parameter types to see if it matches properly.

This method returns me -1

I am passing correct parameters in method: addInjectStreamUrl(url, InjectStreamConfig) It's working for us in web.

I am using following sdk/version: 1) electron@7.1.2 2) agora-electron-sdk@3.0.0-build.661

plutoless commented 4 years ago

hi, this error indicates you are giving invalid parameters. could you pls share with me the api call you used for stream injection?

silarvaibhav commented 4 years ago
this.rtc.addInjectStreamUrl(url, InjectStreamConfig)
this.rtc is object of AgoraRtcEngine

url: https://somezone.amazonaws.com/sampleVideo/ED5A8499.mp4 //this is not actual url here InjectStreamConfig: {"width":0,"height":0,"videoGop":30,"videoFramerate":15,"videoBitrate":400,"audioSampleRate":44100,"audioChannels":1}

silarvaibhav commented 4 years ago

audioBitrate is missing in InjectStreamConfig, it's working. Shouldn't default value considered for this attribute according to documentation. Thanks for your pointer.

plutoless commented 4 years ago

thanks for the suggestion. we will see if we can improve this somehow.