Skip to content

Commit

Permalink
修复切换摄像头成功却提示失败
Browse files Browse the repository at this point in the history
  • Loading branch information
lzj committed Apr 8, 2020
1 parent 4b2d879 commit 318b856
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void switchCamera(Boolean isFront, boolean autoPlay, Promise promise) {
gJMVideoStreamPlayer.switchCamera(isFront, autoPlay, new JMSwitchCameraListener() {
@Override
public void onSwitchCameraHandler(boolean b, String s, long l, String s1) {
if (b && l == 0 && !TextUtils.isEmpty(s)) {
if (b && l == 0) {
promise.resolve(s);
} else {
promise.reject(String.valueOf(l), s1 != null ? s1 : "");
Expand Down
2 changes: 1 addition & 1 deletion ios/RNJimiRTMPPlayer/JMRTMPPlayerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void)didJMSmartAppEngineExit

RCT_EXPORT_METHOD(switchCamera:(BOOL)isFront autoPlay:(BOOL)bAuto resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
[gJMVideoStreamPlayer switchCamera:isFront autoPlay:bAuto handler:^(BOOL success, NSString * _Nullable url, NSInteger code, NSString * _Nullable errMsg) {
if (success && code == 0 && url) {
if (success && code == 0) {
resolve(url);
} else {
reject([NSString stringWithFormat:@"%ld", (long)code], errMsg ? errMsg : @"", nil);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-rtmp-player-jm",
"version": "1.1.5",
"version": "1.1.6",
"description": "Jimi Video Player for RTMP SDK modules and view for React Native(Android & IOS), support react native 0.57+. ",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion react-native-rtmp-player-jm.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "react-native-rtmp-player-jm"
s.version = "1.1.2"
s.version = "1.1.6"
s.summary = "Jimi RTMP Video Player SDK for React Native"

s.description = <<-DESC
Expand Down

0 comments on commit 318b856

Please sign in to comment.