We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我用的是推流端的示例代码,再第二次点击开始按钮的时候接收端就接收不到推流了,能麻烦看下是什么问题吗,谢谢。 就是调用了stop()方法之后再调用start()方法就推流不上去了,程序没有报错。
The text was updated successfully, but these errors were encountered:
因为停止推流之后,推流线程被停止了。所以这样 原始代码 ` /** * 停止发布 */ public void stopPublish() { Runnable runnable = new Runnable() { @OverRide public void run() { mRtmpPublisher.stop(); isPublish = false;
loop = false; if (workThread != null) { workThread.interrupt(); } } }; mRunnables.add(runnable); }
`
我的修改方式是:MediaPublisher.init()这个方法由startPublish()调用。 ` /** * 发布 */ public void starPublish() { if (isPublish) { return; }
init(); if (videoParams == null || audioParams == null) { Log.w(TAG, "video param or audio param is null"); return; } Runnable runnable = new Runnable() { @Override public void run() { //初始化 int ret = mRtmpPublisher.init(mConfig.publishUrl, videoParams.previewWidth, videoParams.previewHeight, mConfig.timeOut); if (ret < 0) { Log.e(TAG, "连接失败"); return; } isPublish = true; } }; mRunnables.add(runnable); }
Sorry, something went wrong.
No branches or pull requests
我用的是推流端的示例代码,再第二次点击开始按钮的时候接收端就接收不到推流了,能麻烦看下是什么问题吗,谢谢。
就是调用了stop()方法之后再调用start()方法就推流不上去了,程序没有报错。
The text was updated successfully, but these errors were encountered: