Observable.create(new ObservableOnSubscribe<String>() {
@Override
public void subscribe(@io.reactivex.annotations.NonNull ObservableEmitter<String> emitter) throws Exception {
String videoBase64 = Tools.fileBase64String(mediaPath, "data:video/mp4;base64,");
LogUtils.Companion.err(">>>>>完成");
emitter.onNext(videoBase64 != null ? videoBase64 : "");
}
}).observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
}
@Override
public void onNext(@io.reactivex.annotations.NonNull String s) {
ToastUtils.showShort("子线程结束了:" + s);
cameraRecordCallBack(s);
}
@Override
public void onError(@io.reactivex.annotations.NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
|