omikit-plugin 4.0.2 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +654 -37
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/omikitplugin/OmiLocalCameraView.kt +94 -0
- package/android/src/main/java/com/omikitplugin/OmiRemoteCameraView.kt +117 -0
- package/android/src/main/java/com/omikitplugin/OmikitPluginModule.kt +24 -17
- package/android/src/main/java/com/omikitplugin/OmikitPluginPackage.kt +11 -8
- package/ios/CallProcess/CallManager.swift +99 -29
- package/ios/Library/OmikitPlugin.m +18 -0
- package/ios/Library/OmikitPlugin.swift +233 -1
- package/ios/OmikitPlugin-Bridging-Header.h +1 -0
- package/ios/OmikitPlugin.xcodeproj/project.pbxproj +4 -4
- package/ios/VideoCall/OmiLocalCameraViewBridge.m +14 -0
- package/ios/VideoCall/OmiLocalCameraViewManager.swift +41 -0
- package/ios/VideoCall/OmiRemoteCameraViewBridge.m +14 -0
- package/ios/VideoCall/OmiRemoteCameraViewManager.swift +40 -0
- package/lib/commonjs/NativeOmikitPlugin.js +2 -1
- package/lib/commonjs/NativeOmikitPlugin.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/omi_audio_type.js +5 -7
- package/lib/commonjs/omi_audio_type.js.map +1 -1
- package/lib/commonjs/omi_call_state.js +5 -3
- package/lib/commonjs/omi_call_state.js.map +1 -1
- package/lib/commonjs/omi_local_camera.js +19 -17
- package/lib/commonjs/omi_local_camera.js.map +1 -1
- package/lib/commonjs/omi_remote_camera.js +20 -17
- package/lib/commonjs/omi_remote_camera.js.map +1 -1
- package/lib/commonjs/omi_start_call_status.js +5 -24
- package/lib/commonjs/omi_start_call_status.js.map +1 -1
- package/lib/commonjs/omikit.js +56 -3
- package/lib/commonjs/omikit.js.map +1 -1
- package/lib/commonjs/types/index.d.js.map +1 -1
- package/lib/module/NativeOmikitPlugin.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/omi_audio_type.js +4 -7
- package/lib/module/omi_audio_type.js.map +1 -1
- package/lib/module/omi_call_state.js +4 -3
- package/lib/module/omi_call_state.js.map +1 -1
- package/lib/module/omi_local_camera.js +19 -18
- package/lib/module/omi_local_camera.js.map +1 -1
- package/lib/module/omi_remote_camera.js +20 -18
- package/lib/module/omi_remote_camera.js.map +1 -1
- package/lib/module/omi_start_call_status.js +4 -24
- package/lib/module/omi_start_call_status.js.map +1 -1
- package/lib/module/omikit.js +49 -1
- package/lib/module/omikit.js.map +1 -1
- package/lib/module/types/index.d.js.map +1 -1
- package/omikit-plugin.podspec +1 -1
- package/package.json +2 -11
- package/react-native.config.js +14 -0
- package/src/NativeOmikitPlugin.ts +1 -0
- package/src/omi_call_state.tsx +1 -0
- package/src/omi_local_camera.tsx +15 -19
- package/src/omi_remote_camera.tsx +16 -19
- package/src/omikit.tsx +63 -0
- package/src/types/index.d.ts +344 -62
- package/android/src/main/java/com/omikitplugin/FLLocalCameraModule.kt +0 -34
- package/android/src/main/java/com/omikitplugin/FLLocalCameraView.kt +0 -44
- package/android/src/main/java/com/omikitplugin/FLRemoteCameraModule.kt +0 -37
- package/android/src/main/java/com/omikitplugin/FLRemoteCameraView.kt +0 -23
- package/ios/VideoCall/FLLocalCameraView.m +0 -17
- package/ios/VideoCall/FLLocalCameraView.swift +0 -44
- package/ios/VideoCall/FLRemoteCameraView.m +0 -18
- package/ios/VideoCall/FLRemoteCameraView.swift +0 -124
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
package com.omikitplugin
|
|
2
|
-
|
|
3
|
-
import android.view.Surface
|
|
4
|
-
import android.view.TextureView
|
|
5
|
-
import android.widget.LinearLayout
|
|
6
|
-
import com.facebook.react.bridge.Promise
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
9
|
-
import com.facebook.react.bridge.ReactMethod
|
|
10
|
-
import vn.vihat.omicall.omisdk.OmiClient
|
|
11
|
-
import vn.vihat.omicall.omisdk.videoutils.ScaleManager
|
|
12
|
-
import vn.vihat.omicall.omisdk.videoutils.Size
|
|
13
|
-
|
|
14
|
-
class FLLocalCameraModule(reactContext: ReactApplicationContext, localViewManager: FLLocalCameraView) :
|
|
15
|
-
ReactContextBaseJavaModule(reactContext) {
|
|
16
|
-
|
|
17
|
-
var cameraView: LinearLayout
|
|
18
|
-
lateinit var localViewManager : FLLocalCameraView
|
|
19
|
-
|
|
20
|
-
override fun getName(): String {
|
|
21
|
-
return "FLLocalCameraModule"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
init {
|
|
25
|
-
cameraView = localViewManager.localView
|
|
26
|
-
this.localViewManager = localViewManager
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@ReactMethod
|
|
30
|
-
fun refresh(promise: Promise) {
|
|
31
|
-
this.localViewManager.refreshTexture()
|
|
32
|
-
promise.resolve(true)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
package com.omikitplugin
|
|
2
|
-
|
|
3
|
-
import android.view.Surface
|
|
4
|
-
import android.view.TextureView
|
|
5
|
-
import android.widget.LinearLayout
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
-
import com.facebook.react.uimanager.SimpleViewManager
|
|
8
|
-
import com.facebook.react.uimanager.ThemedReactContext
|
|
9
|
-
import vn.vihat.omicall.omisdk.OmiClient
|
|
10
|
-
import vn.vihat.omicall.omisdk.videoutils.ScaleManager
|
|
11
|
-
import vn.vihat.omicall.omisdk.videoutils.Size
|
|
12
|
-
|
|
13
|
-
class FLLocalCameraView(private val context: ReactApplicationContext) :
|
|
14
|
-
SimpleViewManager<LinearLayout>() {
|
|
15
|
-
val localView : LinearLayout = LinearLayout(context)
|
|
16
|
-
private val cameraView : TextureView = TextureView(context)
|
|
17
|
-
|
|
18
|
-
init {
|
|
19
|
-
localView.addView(cameraView)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
override fun getName(): String {
|
|
23
|
-
return "FLLocalCameraView"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
override fun createViewInstance(p0: ThemedReactContext): LinearLayout {
|
|
27
|
-
return localView
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
fun localViewInstance(): LinearLayout {
|
|
31
|
-
return localView
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
fun refreshTexture() {
|
|
35
|
-
cameraView.surfaceTexture?.let {
|
|
36
|
-
// OmiClient.getInstance().setupLocalVideoFeed(Surface(it))
|
|
37
|
-
ScaleManager.adjustAspectRatio(
|
|
38
|
-
cameraView,
|
|
39
|
-
Size(cameraView.width, cameraView.height),
|
|
40
|
-
Size(1280, 720)
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
package com.omikitplugin
|
|
2
|
-
|
|
3
|
-
import android.view.Surface
|
|
4
|
-
import android.view.TextureView
|
|
5
|
-
import com.facebook.react.bridge.Promise
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
8
|
-
import com.facebook.react.bridge.ReactMethod
|
|
9
|
-
import vn.vihat.omicall.omisdk.OmiClient
|
|
10
|
-
import vn.vihat.omicall.omisdk.videoutils.ScaleManager
|
|
11
|
-
import vn.vihat.omicall.omisdk.videoutils.Size
|
|
12
|
-
|
|
13
|
-
class FLRemoteCameraModule(reactContext: ReactApplicationContext, remoteViewManager: FLRemoteCameraView) :
|
|
14
|
-
ReactContextBaseJavaModule(reactContext) {
|
|
15
|
-
|
|
16
|
-
var cameraView: TextureView
|
|
17
|
-
|
|
18
|
-
override fun getName(): String {
|
|
19
|
-
return "FLRemoteCameraModule"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
init {
|
|
23
|
-
cameraView = remoteViewManager.remoteView
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@ReactMethod
|
|
27
|
-
fun refresh(promise: Promise) {
|
|
28
|
-
cameraView.surfaceTexture?.let {
|
|
29
|
-
// OmiClient.instance.setupIncomingVideoFeed(Surface(it))
|
|
30
|
-
ScaleManager.adjustAspectRatio(cameraView,
|
|
31
|
-
Size(cameraView.width, cameraView.height),
|
|
32
|
-
Size(1280,720)
|
|
33
|
-
)
|
|
34
|
-
promise.resolve(true)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
package com.omikitplugin
|
|
2
|
-
|
|
3
|
-
import android.view.TextureView
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
|
-
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
|
-
|
|
8
|
-
class FLRemoteCameraView(private val context: ReactApplicationContext) :
|
|
9
|
-
SimpleViewManager<TextureView>() {
|
|
10
|
-
val remoteView : TextureView = TextureView(context)
|
|
11
|
-
|
|
12
|
-
override fun getName(): String {
|
|
13
|
-
return "FLRemoteCameraView"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
override fun createViewInstance(p0: ThemedReactContext): TextureView {
|
|
17
|
-
return remoteView
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
fun localViewInstance(): TextureView {
|
|
21
|
-
return remoteView
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FLLocalCameraView.m
|
|
3
|
-
// omikit-plugin
|
|
4
|
-
//
|
|
5
|
-
// Created by PRO 2019 16' on 03/04/2023.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <React/RCTBridgeModule.h>
|
|
10
|
-
#import <React/RCTViewManager.h>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@interface RCT_EXTERN_MODULE(FLLocalCameraView, RCTViewManager)
|
|
14
|
-
RCT_EXTERN_METHOD(refresh:
|
|
15
|
-
(RCTPromiseResolveBlock)resolve
|
|
16
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
-
@end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LocalCameraView.swift
|
|
3
|
-
// omicall_flutter_plugin
|
|
4
|
-
//
|
|
5
|
-
// Created by PRO 2019 16' on 15/02/2023.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import Foundation
|
|
9
|
-
import React
|
|
10
|
-
import UIKit
|
|
11
|
-
import OmiKit
|
|
12
|
-
|
|
13
|
-
@objc(FLLocalCameraView)
|
|
14
|
-
class FLLocalCameraView: RCTViewManager {
|
|
15
|
-
|
|
16
|
-
private var _view: OMIVideoPreviewView
|
|
17
|
-
|
|
18
|
-
override init() {
|
|
19
|
-
_view = OMIVideoPreviewView.init()
|
|
20
|
-
super.init()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
override class func requiresMainQueueSetup() -> Bool {
|
|
24
|
-
return true
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override func view() -> UIView! {
|
|
28
|
-
return _view
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@objc(refresh:withRejecter:)
|
|
32
|
-
func refresh(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
33
|
-
setupViews()
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
func setupViews() {
|
|
37
|
-
DispatchQueue.main.async {[weak self] in
|
|
38
|
-
guard let self = self else { return }
|
|
39
|
-
if let videoView = CallManager.shareInstance().getLocalPreviewView(frame: self._view.frame) {
|
|
40
|
-
self._view.setView(videoView)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// FLRemoteCameraView.m
|
|
3
|
-
// omikit-plugin
|
|
4
|
-
//
|
|
5
|
-
// Created by PRO 2019 16' on 10/04/2023.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
#import <React/RCTBridgeModule.h>
|
|
10
|
-
#import <React/RCTViewManager.h>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@interface RCT_EXTERN_MODULE(FLRemoteCameraView, RCTViewManager)
|
|
14
|
-
RCT_EXTERN_METHOD(refresh:
|
|
15
|
-
(RCTPromiseResolveBlock)resolve
|
|
16
|
-
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
-
@end
|
|
18
|
-
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
//// LocalCameraView.swift
|
|
3
|
-
//// omicall_flutter_plugin
|
|
4
|
-
////
|
|
5
|
-
//// Created by PRO 2019 16' on 15/02/2023.
|
|
6
|
-
////
|
|
7
|
-
import Foundation
|
|
8
|
-
import React
|
|
9
|
-
import UIKit
|
|
10
|
-
import OmiKit
|
|
11
|
-
|
|
12
|
-
@objc(FLRemoteCameraView)
|
|
13
|
-
class FLRemoteCameraView: RCTViewManager {
|
|
14
|
-
|
|
15
|
-
private var _view: OMIVideoPreviewView
|
|
16
|
-
|
|
17
|
-
override init() {
|
|
18
|
-
_view = OMIVideoPreviewView.init()
|
|
19
|
-
super.init()
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
override class func requiresMainQueueSetup() -> Bool {
|
|
23
|
-
return true
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
override func view() -> UIView! {
|
|
27
|
-
return _view
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@objc(refresh:withRejecter:)
|
|
31
|
-
func refresh(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) -> Void {
|
|
32
|
-
self.setupViews()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
func setupViews() {
|
|
36
|
-
DispatchQueue.main.async {[weak self] in
|
|
37
|
-
guard let self = self else { return }
|
|
38
|
-
if let videoView = CallManager.shareInstance().getRemotePreviewView(frame: self._view.frame) {
|
|
39
|
-
self._view.setView(videoView)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//import Foundation
|
|
49
|
-
//import Flutter
|
|
50
|
-
//import WebKit
|
|
51
|
-
//import UIKit
|
|
52
|
-
//import OmiKit
|
|
53
|
-
//
|
|
54
|
-
//class FLRemoteCameraFactory: NSObject, FlutterPlatformViewFactory {
|
|
55
|
-
// private var messenger: FlutterBinaryMessenger
|
|
56
|
-
//
|
|
57
|
-
// init(messenger: FlutterBinaryMessenger) {
|
|
58
|
-
// self.messenger = messenger
|
|
59
|
-
// super.init()
|
|
60
|
-
// }
|
|
61
|
-
//
|
|
62
|
-
// func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol {
|
|
63
|
-
// return FlutterStandardMessageCodec.sharedInstance()
|
|
64
|
-
// }
|
|
65
|
-
//
|
|
66
|
-
// func create(
|
|
67
|
-
// withFrame frame: CGRect,
|
|
68
|
-
// viewIdentifier viewId: Int64,
|
|
69
|
-
// arguments args: Any?
|
|
70
|
-
// ) -> FlutterPlatformView {
|
|
71
|
-
// return FLRemoteCameraView(
|
|
72
|
-
// frame: frame,
|
|
73
|
-
// viewIdentifier: viewId,
|
|
74
|
-
// arguments: args,
|
|
75
|
-
// binaryMessenger: messenger
|
|
76
|
-
// )
|
|
77
|
-
// }
|
|
78
|
-
//}
|
|
79
|
-
//
|
|
80
|
-
//class FLRemoteCameraView: NSObject, FlutterPlatformView {
|
|
81
|
-
// private var _view: OMIVideoPreviewView
|
|
82
|
-
// private var _arg : [String : Any]?
|
|
83
|
-
// private let methodChannel: FlutterMethodChannel?
|
|
84
|
-
//
|
|
85
|
-
// init(
|
|
86
|
-
// frame: CGRect,
|
|
87
|
-
// viewIdentifier viewId: Int64,
|
|
88
|
-
// arguments args: Any?,
|
|
89
|
-
// binaryMessenger messenger: FlutterBinaryMessenger?
|
|
90
|
-
// ) {
|
|
91
|
-
// _view = OMIVideoPreviewView.init()
|
|
92
|
-
// _arg = args as? [String: Any]
|
|
93
|
-
// methodChannel = FlutterMethodChannel(name: "remote_camera_controller/\(viewId)", binaryMessenger: messenger!)
|
|
94
|
-
// super.init()
|
|
95
|
-
// methodChannel?.setMethodCallHandler(onMethodCall)
|
|
96
|
-
// }
|
|
97
|
-
//
|
|
98
|
-
// func onMethodCall(call: FlutterMethodCall, result: FlutterResult) {
|
|
99
|
-
// switch(call.method){
|
|
100
|
-
// case "refresh":
|
|
101
|
-
// setupViews()
|
|
102
|
-
// break
|
|
103
|
-
// default:
|
|
104
|
-
// result(FlutterMethodNotImplemented)
|
|
105
|
-
// }
|
|
106
|
-
// }
|
|
107
|
-
//
|
|
108
|
-
// func view() -> UIView {
|
|
109
|
-
// return _view
|
|
110
|
-
// }
|
|
111
|
-
//
|
|
112
|
-
// func setupViews() {
|
|
113
|
-
// self._view.layer.cornerRadius = 5
|
|
114
|
-
//// self._view.layer.borderColor = UIColor.gray.cgColor
|
|
115
|
-
//// self._view.layer.borderWidth = 1.0
|
|
116
|
-
// self._view.clipsToBounds = true
|
|
117
|
-
// CallManager.shareInstance().getRemotePreviewView(callback: { previewView in
|
|
118
|
-
// self._view.setView(previewView)
|
|
119
|
-
// print("\(previewView.frame)")
|
|
120
|
-
// print("\(self._view.frame)")
|
|
121
|
-
// print("AAAA")
|
|
122
|
-
// })
|
|
123
|
-
// }
|
|
124
|
-
//}
|