2020-07-02 1.更新最新SDK。 2.参试封装工具类,只初始化一次SDK方案,暂时解决SDK无法释放问题。
8个文件已添加
2个文件已删除
17个文件已修改
2 文件已重命名
827 ■■■■ 已修改文件
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo.xcodeproj/project.pbxproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ESVideo.h 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ESVideo.m 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ViewController.mm 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo.xcodeproj/project.pbxproj 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideoSDK.h 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideoSDK.m 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/CBToast.h 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/CBToast.m 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideo.h 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideo.m 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideoMonitorViewController.m 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESvideoVideoIntercomViewController.m 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/GDHDLUtlis.h 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/OpenViewController.m 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKZigbee/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin.xcodeproj/project.pbxproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideo.h 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideo.m 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideoMonitorViewController.m 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESvideoVideoIntercomViewController.m 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/GDHDLUtlis.h 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/OpenViewController.h 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/OpenViewController.m 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/ESVideoPhoneSDKXamarin/Extern/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/Shared.IOS.ESVideoPhoneSDK/ApiDefinition.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xamarin/Shared.IOS.ESVideoPhoneSDK/Library/libESVideoPhoneSDKXamarin.a 补丁 | 查看 | 原始文档 | blame | 历史
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
    objects = {
/* Begin PBXBuildFile section */
        B96CCD7A24A88EAD00FCCEBF /* ESVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B96CCD7824A88EAD00FCCEBF /* ESVideo.m */; };
        C3385925233DAF06006940C3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3385924233DAF06006940C3 /* AppDelegate.m */; };
        C3385928233DAF06006940C3 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3385927233DAF06006940C3 /* SceneDelegate.m */; };
        C338592B233DAF06006940C3 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = C338592A233DAF06006940C3 /* ViewController.mm */; };
@@ -42,6 +43,8 @@
/* Begin PBXFileReference section */
        B924480E24934E5500F118F1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
        B96CCD7824A88EAD00FCCEBF /* ESVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ESVideo.m; sourceTree = "<group>"; };
        B96CCD7924A88EAD00FCCEBF /* ESVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESVideo.h; sourceTree = "<group>"; };
        C3385920233DAF06006940C3 /* ESVideoPhoneSDKDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ESVideoPhoneSDKDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
        C3385923233DAF06006940C3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
        C3385924233DAF06006940C3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -121,6 +124,8 @@
        C3385922233DAF06006940C3 /* ESVideoPhoneSDKDemo */ = {
            isa = PBXGroup;
            children = (
                B96CCD7924A88EAD00FCCEBF /* ESVideo.h */,
                B96CCD7824A88EAD00FCCEBF /* ESVideo.m */,
                C3385923233DAF06006940C3 /* AppDelegate.h */,
                C3385924233DAF06006940C3 /* AppDelegate.m */,
                C3385926233DAF06006940C3 /* SceneDelegate.h */,
@@ -299,6 +304,7 @@
            buildActionMask = 2147483647;
            files = (
                C338592B233DAF06006940C3 /* ViewController.mm in Sources */,
                B96CCD7A24A88EAD00FCCEBF /* ESVideo.m in Sources */,
                C3385925233DAF06006940C3 /* AppDelegate.m in Sources */,
                C345D08B233EEE520079C82C /* AudioSessionHelper.m in Sources */,
                C3385936233DAF12006940C3 /* main.m in Sources */,
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ESVideo.h
New file
@@ -0,0 +1,27 @@
//
//  ESVideo.h
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <ESVideoPhoneSDk/ESVideoPhone.h>
#import <ESVideoPhoneSDk/ESError.h>
NS_ASSUME_NONNULL_BEGIN
@interface ESVideo : NSObject
@property (nonatomic,strong) ESVideoPhone          *es;
@property (nonatomic, copy) ImageCallback snapImageCallback;
+ (instancetype)shareInstance;
+ (void)haltSharedInstance;
-(void)initSDK;
@end
NS_ASSUME_NONNULL_END
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ESVideo.m
New file
@@ -0,0 +1,75 @@
//
//  ESVideo.m
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import "ESVideo.h"
#define WEAKSELF_AT __weak __typeof(&*self)weakSelf_AT = self;
@interface ESVideo()
@end
static ESVideo *_sharedInstance = nil;
static dispatch_once_t _onceToken;
@implementation ESVideo{
    ImageCallback mSnapImageCallback;
}
+ (instancetype)shareInstance {
    dispatch_once(&_onceToken, ^{
        _sharedInstance = [[ESVideo alloc] init];
        if(_sharedInstance) {
        }
        NSLog(@"ESVideo ShareInstance Did Create %p",_sharedInstance);
    });
    //NSLog(@"Access ESVideo %p",sharedInstance);
    return _sharedInstance;
}
+ (void)haltSharedInstance {
    if (_sharedInstance) {
        _sharedInstance = nil;
        _onceToken = 0;
    }
}
- (instancetype)init {
    self = [super init];
    WEAKSELF_AT
    mSnapImageCallback = ^(UIImage *image){
        if(weakSelf_AT.snapImageCallback){
            weakSelf_AT.snapImageCallback(image);
        }
    };
    //门口机会有视频的长宽高,是固定的(暂时还不确定)
    _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame: CGRectMake(10, 100, [[UIScreen mainScreen] bounds].size.width-20, ([[UIScreen mainScreen] bounds].size.width-20)/4*3) delegate:nil imagecallBack:mSnapImageCallback];
    return self;
}
- (void)dealloc {
    NSLog(@"ESVideo SharedInstance Did Halted ");
}
-(void)initSDK{
     NSLog(@"ESVideo initSDK");
}
@end
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDKDemo/ViewController.mm
@@ -21,6 +21,7 @@
#import <ESVideoPhoneSDk/ESVideoPhone.h>
#import <ESVideoPhoneSDk/ESError.h>
#import "AudioSessionHelper.h"
#import "ESVideo.h"
@interface ViewController ()<ESVideoPhoneDelegate,UITextFieldDelegate>
@@ -49,18 +50,21 @@
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [ESVideo.shareInstance initSDK];
    //初始化中断,进入后台的tag
    _playing = NO;
    _isSpeaking = NO;
    self.isInterrupt = NO;
    _es = ESVideo.shareInstance.es;
    _es.isInterrupt = NO;
    isBackGround = NO;
    [_speakerBtn setTitle:@"听筒" forState:UIControlStateNormal];
//    _mCallOrAccept.enabled = NO;
//    _monitorBtn.enabled = NO;
//    _uIDTextField.text = @"JJY000016YWECG";//@"JJY000007FSEYX" 默认门口机的ID
       _uIDTextField.text = @"JJY000003UYRBK";//@"JJY000007FSEYX" 默认门口机的ID
//       _uIDTextField.text = @"JJY000017XLUXX";//@"JJY000007FSEYX" 默认门口机的ID
    _uIDTextField.text = @"JJY000019VPLLF";//@"JJY000019VPLLF" 默认门口机的ID
//           _uIDTextField.text = @"JJY000016YWECG";//@"JJY000016YWECG" 默认门口机的ID
    
    _uIDTextField.delegate = self;    //⚠️这里必须要检查是否已经授权否则会失败,初始化视频音频采集
@@ -74,12 +78,18 @@
             });
         };
         //门口机会有视频的长宽高,是固定的(暂时还不确定)
         _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(10, 100, self.view.frame.size.width-20, (self.view.frame.size.width-20)/4*3) delegate:self imagecallBack:snapImageCallback];
//         _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(10, 100, self.view.frame.size.width-20, (self.view.frame.size.width-20)/4*3) delegate:self imagecallBack:snapImageCallback];
         if (_es) {
             //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法
             if (_es.showView) {
//                 _es.showView.frame = CGRectMake(10, 100, self.view.frame.size.width-20, (self.view.frame.size.width-20)/4*3);
                 ESVideo.shareInstance.snapImageCallback = snapImageCallback;
                 _es.showView.backgroundColor = [UIColor greenColor];
                 _es.delegate = self;
                 [self.view addSubview:_es.showView];
             }else{
                 NSLog(@"_es.showView null");
             }
         }else{
             NSLog(@"ESVideoPhone 初始化失败");
@@ -128,10 +138,12 @@
    [_es stopTalk];
}
-(void)dealloc{
    _es.delegate = nil;
//    _es.showView
      NSLog(@"==============dealloc1");
    [[NSNotificationCenter defaultCenter] removeObserver:self];
      NSLog(@"==============dealloc2");
    [_es freeSubClass];
//    [_es freeSubClass];
      NSLog(@"==============dealloc3");
}
ESVideoPhoneSDKDemo1.2/ESVideoPhoneSDKDemo/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h
@@ -4,7 +4,7 @@
//
//  Created by maygion on 2019/3/26.
//  Copyright © 2019 eTouchSky. All rights reserved.
//  SDK版本号:1.0.0  测试版1
//  SDK版本号:1.1.0
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo.xcodeproj/project.pbxproj
@@ -11,8 +11,8 @@
        B919F6612490EEA1007261A9 /* OpenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B919F65A2490EEA1007261A9 /* OpenViewController.m */; };
        B919F6622490EEA1007261A9 /* ESVideoMonitorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B919F65E2490EEA1007261A9 /* ESVideoMonitorViewController.m */; };
        B924481124934E6A00F118F1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B924481024934E6A00F118F1 /* AudioToolbox.framework */; };
        B9D0814024912E9800EBD71F /* CBToast.m in Sources */ = {isa = PBXBuildFile; fileRef = B9D0813F24912E9800EBD71F /* CBToast.m */; };
        B9D081432491D78B00EBD71F /* ESVideoSDK.m in Sources */ = {isa = PBXBuildFile; fileRef = B9D081422491D78B00EBD71F /* ESVideoSDK.m */; };
        B924EFB324AD6B3800E402C4 /* CBToast.m in Sources */ = {isa = PBXBuildFile; fileRef = B924EFB024AD6B3700E402C4 /* CBToast.m */; };
        B924EFB424AD6B3800E402C4 /* ESVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B924EFB224AD6B3800E402C4 /* ESVideo.m */; };
        C3385925233DAF06006940C3 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3385924233DAF06006940C3 /* AppDelegate.m */; };
        C3385928233DAF06006940C3 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C3385927233DAF06006940C3 /* SceneDelegate.m */; };
        C338592B233DAF06006940C3 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = C338592A233DAF06006940C3 /* ViewController.mm */; };
@@ -55,10 +55,10 @@
        B919F65E2490EEA1007261A9 /* ESVideoMonitorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ESVideoMonitorViewController.m; path = ESVideoPhoneSDKDemo/ZigBee/ESVideoMonitorViewController.m; sourceTree = SOURCE_ROOT; };
        B919F65F2490EEA1007261A9 /* GDHDLUtlis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDHDLUtlis.h; path = ESVideoPhoneSDKDemo/ZigBee/GDHDLUtlis.h; sourceTree = SOURCE_ROOT; };
        B924481024934E6A00F118F1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
        B9D0813E24912E9800EBD71F /* CBToast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CBToast.h; sourceTree = "<group>"; };
        B9D0813F24912E9800EBD71F /* CBToast.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CBToast.m; sourceTree = "<group>"; };
        B9D081412491D78A00EBD71F /* ESVideoSDK.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ESVideoSDK.h; sourceTree = "<group>"; };
        B9D081422491D78B00EBD71F /* ESVideoSDK.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ESVideoSDK.m; sourceTree = "<group>"; };
        B924EFAF24AD6B3700E402C4 /* CBToast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CBToast.h; path = ESVideoPhoneSDKDemo/ZigBee/CBToast.h; sourceTree = SOURCE_ROOT; };
        B924EFB024AD6B3700E402C4 /* CBToast.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CBToast.m; path = ESVideoPhoneSDKDemo/ZigBee/CBToast.m; sourceTree = SOURCE_ROOT; };
        B924EFB124AD6B3800E402C4 /* ESVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ESVideo.h; path = ESVideoPhoneSDKDemo/ZigBee/ESVideo.h; sourceTree = SOURCE_ROOT; };
        B924EFB224AD6B3800E402C4 /* ESVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ESVideo.m; path = ESVideoPhoneSDKDemo/ZigBee/ESVideo.m; sourceTree = SOURCE_ROOT; };
        C3385920233DAF06006940C3 /* HDLZigBeeESVideoDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HDLZigBeeESVideoDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
        C3385923233DAF06006940C3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
        C3385924233DAF06006940C3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -118,6 +118,10 @@
        B919F6582490EE7A007261A9 /* HDL */ = {
            isa = PBXGroup;
            children = (
                B924EFAF24AD6B3700E402C4 /* CBToast.h */,
                B924EFB024AD6B3700E402C4 /* CBToast.m */,
                B924EFB124AD6B3800E402C4 /* ESVideo.h */,
                B924EFB224AD6B3800E402C4 /* ESVideo.m */,
                B919F65B2490EEA1007261A9 /* ESVideoMonitorViewController.h */,
                B919F65E2490EEA1007261A9 /* ESVideoMonitorViewController.m */,
                B919F65D2490EEA1007261A9 /* ESvideoVideoIntercomViewController.h */,
@@ -125,10 +129,6 @@
                B919F65F2490EEA1007261A9 /* GDHDLUtlis.h */,
                B919F65C2490EEA1007261A9 /* OpenViewController.h */,
                B919F65A2490EEA1007261A9 /* OpenViewController.m */,
                B9D0813E24912E9800EBD71F /* CBToast.h */,
                B9D0813F24912E9800EBD71F /* CBToast.m */,
                B9D081412491D78A00EBD71F /* ESVideoSDK.h */,
                B9D081422491D78B00EBD71F /* ESVideoSDK.m */,
            );
            path = HDL;
            sourceTree = "<group>";
@@ -335,15 +335,15 @@
            isa = PBXSourcesBuildPhase;
            buildActionMask = 2147483647;
            files = (
                B924EFB424AD6B3800E402C4 /* ESVideo.m in Sources */,
                B919F6612490EEA1007261A9 /* OpenViewController.m in Sources */,
                C338592B233DAF06006940C3 /* ViewController.mm in Sources */,
                B9D081432491D78B00EBD71F /* ESVideoSDK.m in Sources */,
                C3385925233DAF06006940C3 /* AppDelegate.m in Sources */,
                B9D0814024912E9800EBD71F /* CBToast.m in Sources */,
                C345D08B233EEE520079C82C /* AudioSessionHelper.m in Sources */,
                B919F6602490EEA1007261A9 /* ESvideoVideoIntercomViewController.m in Sources */,
                C3385936233DAF12006940C3 /* main.m in Sources */,
                C3385928233DAF06006940C3 /* SceneDelegate.m in Sources */,
                B924EFB324AD6B3800E402C4 /* CBToast.m in Sources */,
                B919F6622490EEA1007261A9 /* ESVideoMonitorViewController.m in Sources */,
            );
            runOnlyForDeploymentPostprocessing = 0;
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,12 @@
<Workspace
   version = "1.0">
   <FileRef
      location = "self:ESVideoPhoneSDKDemo.xcodeproj">
      location = "group:/Users/jlchen/JLChen/ProjectsCode/HDLGit/ESVideoPhoneSDKProject/ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideo.h">
   </FileRef>
   <FileRef
      location = "group:/Users/jlchen/JLChen/ProjectsCode/HDLGit/ESVideoPhoneSDKProject/ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideo.m">
   </FileRef>
   <FileRef
      location = "self:">
   </FileRef>
</Workspace>
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideoSDK.h
File was deleted
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/HDL/ESVideoSDK.m
File was deleted
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/CBToast.h
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/CBToast.m
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideo.h
New file
@@ -0,0 +1,27 @@
//
//  ESVideo.h
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <ESVideoPhoneSDk/ESVideoPhone.h>
#import <ESVideoPhoneSDk/ESError.h>
NS_ASSUME_NONNULL_BEGIN
@interface ESVideo : NSObject
@property (nonatomic,strong) ESVideoPhone          *es;
@property (nonatomic, copy) ImageCallback snapImageCallback;
+ (instancetype)shareInstance;
+ (void)haltSharedInstance;
-(void)initSDK;
@end
NS_ASSUME_NONNULL_END
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideo.m
New file
@@ -0,0 +1,78 @@
//
//  ESVideo.m
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import "ESVideo.h"
#define WEAKSELF_AT __weak __typeof(&*self)weakSelf_AT = self;
@interface ESVideo()
@end
static ESVideo *_sharedInstance = nil;
static dispatch_once_t _onceToken;
@implementation ESVideo{
    ImageCallback mSnapImageCallback;
}
+ (instancetype)shareInstance {
    dispatch_once(&_onceToken, ^{
        _sharedInstance = [[ESVideo alloc] init];
        if(_sharedInstance) {
        }
        NSLog(@"ESVideo ShareInstance Did Create %p",_sharedInstance);
    });
    //NSLog(@"Access ESVideo %p",sharedInstance);
    return _sharedInstance;
}
+ (void)haltSharedInstance {
    if (_sharedInstance) {
//        if(_sharedInstance.es){
//            [_sharedInstance.es freeSubClass];
//        }
        _sharedInstance = nil;
        _onceToken = 0;
    }
}
- (instancetype)init {
    self = [super init];
    WEAKSELF_AT
    mSnapImageCallback = ^(UIImage *image){
        if(weakSelf_AT.snapImageCallback){
            weakSelf_AT.snapImageCallback(image);
        }
    };
    //门口机会有视频的长宽高,是固定的(暂时还不确定)
    _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame: CGRectMake(0, 57, [[UIScreen mainScreen] bounds].size.width, 211) delegate:nil imagecallBack:mSnapImageCallback];
    return self;
}
- (void)dealloc {
    NSLog(@"ESVideo SharedInstance Did Halted ");
}
-(void)initSDK{
     NSLog(@"ESVideo initSDK");
}
@end
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESVideoMonitorViewController.m
@@ -15,6 +15,7 @@
#import <Photos/Photos.h>
#import "AudioSessionHelper.h"
#import "CBToast.h"
#import "ESVideo.h"
@interface ESVideoMonitorViewController ()<ESVideoPhoneDelegate>
@@ -397,6 +398,8 @@
#pragma SDK可视对讲 功能部分
-(void)initESVideo{
    //初始化中断,进入后台的tag
    _es = ESVideo.shareInstance.es;
    _playing = NO;
    _isSpeaking = NO;
    self.isInterrupt = NO;
@@ -412,13 +415,19 @@
            });
        };
        //门口机会有视频的长宽高,是固定的(暂时还不确定)
        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
//        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
        if (_es) {
            //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法
            if (_es.showView) {
//                for(UIView *view in [_es.showView subviews])
//                {
//                    [view removeFromSuperview];
//                }
                _es.delegate = self;
                ESVideo.shareInstance.snapImageCallback = snapImageCallback;
                _es.showView.backgroundColor = [UIColor whiteColor];
                [self.centerView addSubview:_es.showView];
                _es.showView.hidden = YES;
            }
        }else{
            NSLog(@"ESVideoPhone 初始化失败");
@@ -520,11 +529,12 @@
        [_es stopTalk];
        
        _es.delegate = nil;
        ESVideo.shareInstance.snapImageCallback = nil;
//        _es.showView.removeFromSuperview;
        
    }
    [_es freeSubClass];
//    [_es freeSubClass];
}
-(void)dealloc{
@@ -560,6 +570,10 @@
    }else if([phoneEventStr isEqual:@"EVT_Connected"]){
        [self speaker:nil];
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr isEqual:@"EVT_MonitorConnected"]){
        _es.showView.hidden = NO;
        [self speaker:nil];
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_HangUp"]){
        
        
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/ESvideoVideoIntercomViewController.m
@@ -14,7 +14,7 @@
#import "AudioSessionHelper.h"
#import <Photos/Photos.h>
#import <AudioToolbox/AudioToolbox.h>
#import "ESVideo.h"
@@ -81,6 +81,7 @@
    NSString * answerStr;
    NSString * unlockSuccessfullyStr;
    NSString * callingStr;
    NSString * hangUpStr;
    //    int openDoorTimeout;
    //全局变量
    SystemSoundID sound;
@@ -113,6 +114,7 @@
        operationFailedStr = @"操作失败";
        refuseStr = @"拒绝";
        answerStr = @"接听";
        hangUpStr = @"挂断";
        unlockSuccessfullyStr = @"开锁成功";
        callingStr = @"来电中...";
    }else{
@@ -122,6 +124,7 @@
        operationFailedStr = @"Operation failed.";
        refuseStr = @"Refuse";
        answerStr = @"Answer";
        hangUpStr = @"Hang up";
        unlockSuccessfullyStr = @"Unlock successfully";
        callingStr = @"Incoming call";
        
@@ -388,7 +391,7 @@
    //挂断按钮移动中间
    _hangUpImgBtn.frame = CGRectMake(159, 448, 58, 58);
    _hangUpTextBtn.frame = CGRectMake(138, 514, 100, 21);
    [_hangUpTextBtn setTitle:hangUpStr forState:UIControlStateNormal];
    //开始计时
    _callTimeout = 0;
    [self startCountdown];
@@ -579,7 +582,10 @@
#pragma SDK可视对讲 功能部分
-(void)initESVideo{
    _es = ESVideo.shareInstance.es;
    //初始化中断,进入后台的tag
    _playing = NO;
    _isSpeaking = NO;
    self.isInterrupt = NO;
@@ -597,13 +603,15 @@
            });
        };
        //门口机会有视频的长宽高,是固定的(暂时还不确定)
        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
//        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
        if (_es) {
            //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法
            if (_es.showView) {
                ESVideo.shareInstance.snapImageCallback = snapImageCallback;
                _es.delegate = self;
                _es.showView.backgroundColor = [UIColor whiteColor];
                [self.centerView addSubview:_es.showView];
                _es.showView.hidden = YES;
            }
        }else{
            NSLog(@"ESVideoPhone 初始化失败");
@@ -689,6 +697,16 @@
    
}
-(void)showUIAlertViewWithBack:(NSString *)mes
{
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:tipStr message:mes preferredStyle:UIAlertControllerStyleAlert];
    [alertController addAction:[UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self backAction];
    }]];
    [self presentViewController:alertController animated:YES completion:nil];
}
#pragma viewDidAppear
-(void)viewDidAppear:(BOOL)animated{
@@ -715,11 +733,11 @@
        [_es stopTalk];
        
        _es.delegate = nil;
        ESVideo.shareInstance.snapImageCallback = nil;
        
        
    }
    [_es freeSubClass];
//    [_es freeSubClass];
}
-(void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -748,6 +766,7 @@
    NSString *phoneEventStr = eventArray.lastObject;
    
    if([phoneEventStr isEqual:@"EVT_Ringing"]){
        _es.showView.hidden = NO;
        //反呼成功 允许接听  看需求是否需要播放铃声和震动
        [self setAnswerBtnEnable:YES];
        
@@ -757,8 +776,10 @@
    } else if([phoneEventStr isEqual:@"EVT_StopStream"]){
        //           [_mCallOrAccept setTitle:@"反呼" forState:UIControlStateNormal];
    }else if([phoneEventStr isEqual:@"EVT_Connected"]){
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_HangUp"]){
         [self showUIAlertViewWithBack:@"已挂断"];
        //           [_mCallOrAccept setTitle:@"反呼" forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_P2POnlineStatusChanged"]){
        //EVT_P2PStarted(p2p初始化OK,可以连接),EVT_P2POnlineStatusChangedonline=1
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/GDHDLUtlis.h
@@ -13,8 +13,12 @@
#define IOS9  (TP_SYSTEM_VERSION >= 9.0)
#define IOS10 (TP_SYSTEM_VERSION >= 10.0)
//是否是IPhoneX的设备
#define IPhoneX ([[UIScreen mainScreen] bounds].size.height == 812)
//是否是 iPhoneX_XS_11Pro设备
#define IPhoneX ([UIScreen mainScreen].bounds.size.width == 375.0f && [UIScreen mainScreen].bounds.size.height == 812.0f)
//是否是 iPhoneXSMax_XR_11_11ProMax
#define IPhoneXR ([UIScreen mainScreen].bounds.size.width == 414.0f && [UIScreen mainScreen].bounds.size.height == 896.0f)
// 是全面屏手机
#define IsFullScreen (IPhoneX || IPhoneXR)
// Screen
#define APP_SCREEN_BOUNDS   [[UIScreen mainScreen] bounds]
@@ -22,13 +26,13 @@
#define APP_SCREEN_WIDTH    (APP_SCREEN_BOUNDS.size.width)
#define APP_STATUS_FRAME    [UIApplication sharedApplication].statusBarFrame
#define APP_TOP_BAR_HEIGHT    (IPhoneX ? 88 : (IOS7 ? 64 : 44))
#define APP_STATUS_BAR_HEIGHT (IPhoneX ? 44: (IOS7 ? 20 : 0))
#define APP_STATUS_BAR_HEIGHT_TURE (IPhoneX ? 44: (IOS7 ? 0 : 0))
#define APP_TOP_BAR_HEIGHT    (IsFullScreen ? 88 : (IOS7 ? 64 : 44))
#define APP_STATUS_BAR_HEIGHT (IsFullScreen ? 44: (IOS7 ? 20 : 0))
#define APP_STATUS_BAR_HEIGHT_TURE (IsFullScreen ? 44: (IOS7 ? 0 : 0))
#define APP_TOOL_BAR_HEIGHT   49
#define APP_TAB_BAR_HEIGHT    (IPhoneX ? (49 + 34): 49)
#define APP_TAB_BAR_HEIGHT    (IsFullScreen ? (49 + 34): 49)
#define APP_CONTENT_WIDTH     (APP_SCREEN_BOUNDS.size.width)
#define APP_BUTTOM_HEIGHT     (IPhoneX ? 34: 0)
#define APP_BUTTOM_HEIGHT     (IsFullScreen ? 34: 0)
#define APP_CONTENT_HEIGHT    (APP_SCREEN_HEIGHT - APP_TOP_BAR_HEIGHT - APP_TAB_BAR_HEIGHT)
#define APP_VISIBLE_HEIGHT    (APP_SCREEN_HEIGHT - APP_TOP_BAR_HEIGHT - APP_BUTTOM_HEIGHT)
#define APP_B_HEIGHT          (APP_SCREEN_HEIGHT - APP_BUTTOM_HEIGHT)
ESVideoPhoneSDKZigbee/ESVideoPhoneSDKDemo/ZigBee/OpenViewController.m
@@ -12,7 +12,7 @@
#import "GDHDLUtlis.h"
#import "ESVideo.h"
@interface OpenViewController ()
@@ -35,13 +35,15 @@
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [ESVideo.shareInstance initSDK];
    // Do any additional setup after loading the view.
    
    [self.view addSubview:self.monitorBtn];
    [self.view addSubview:self.calledBtn];
    
    //    DEVICEID = @"JJY000017XLUXX";
    DEVICEID = @"JJY000003UYRBK";
    DEVICEID = @"JJY000019VPLLF";
    
    //     DEVICEID = @"JJY000016YWECG";
    
ESVideoPhoneSDKZigbee/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h
@@ -4,7 +4,7 @@
//
//  Created by maygion on 2019/3/26.
//  Copyright © 2019 eTouchSky. All rights reserved.
//  SDK版本号:1.0.0  测试版1
//  SDK版本号:1.1.0
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
    objects = {
/* Begin PBXBuildFile section */
        B924EFB724AD6B6800E402C4 /* ESVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B924EFB524AD6B6700E402C4 /* ESVideo.m */; };
        B956B47C248D2B400093C489 /* libiconv.2.4.0.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B956B47B248D2B400093C489 /* libiconv.2.4.0.tbd */; platformFilter = ios; };
        B956B47E248D2B4C0093C489 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B956B47D248D2B4C0093C489 /* libz.tbd */; platformFilter = ios; };
        B956B480248D2B570093C489 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B956B47F248D2B570093C489 /* libbz2.tbd */; platformFilter = ios; };
@@ -30,6 +31,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
        B924EFB524AD6B6700E402C4 /* ESVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ESVideo.m; sourceTree = "<group>"; };
        B924EFB624AD6B6800E402C4 /* ESVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ESVideo.h; sourceTree = "<group>"; };
        B956B46A248D28B70093C489 /* libESVideoPhoneSDKXamarin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libESVideoPhoneSDKXamarin.a; sourceTree = BUILT_PRODUCTS_DIR; };
        B956B47B248D2B400093C489 /* libiconv.2.4.0.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.4.0.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libiconv.2.4.0.tbd; sourceTree = DEVELOPER_DIR; };
        B956B47D248D2B4C0093C489 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; };
@@ -81,6 +84,8 @@
        B956B46C248D28B70093C489 /* ESVideoPhoneSDKXamarin */ = {
            isa = PBXGroup;
            children = (
                B924EFB624AD6B6800E402C4 /* ESVideo.h */,
                B924EFB524AD6B6700E402C4 /* ESVideo.m */,
                B958D92D249378D800A62567 /* CBToast.h */,
                B958D92E249378D800A62567 /* CBToast.m */,
                B958D92A249378B200A62567 /* AudioSessionHelper.h */,
@@ -166,6 +171,7 @@
                B956B486248D2B780093C489 /* ESvideoVideoIntercomViewController.m in Sources */,
                B956B487248D2B780093C489 /* ESVideoMonitorViewController.m in Sources */,
                B958D92C249378B200A62567 /* AudioSessionHelper.m in Sources */,
                B924EFB724AD6B6800E402C4 /* ESVideo.m in Sources */,
            );
            runOnlyForDeploymentPostprocessing = 0;
        };
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideo.h
New file
@@ -0,0 +1,27 @@
//
//  ESVideo.h
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <ESVideoPhoneSDk/ESVideoPhone.h>
#import <ESVideoPhoneSDk/ESError.h>
NS_ASSUME_NONNULL_BEGIN
@interface ESVideo : NSObject
@property (nonatomic,strong) ESVideoPhone          *es;
@property (nonatomic, copy) ImageCallback snapImageCallback;
+ (instancetype)shareInstance;
+ (void)haltSharedInstance;
-(void)initSDK;
@end
NS_ASSUME_NONNULL_END
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideo.m
New file
@@ -0,0 +1,78 @@
//
//  ESVideo.m
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/28.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import "ESVideo.h"
#define WEAKSELF_AT __weak __typeof(&*self)weakSelf_AT = self;
@interface ESVideo()
@end
static ESVideo *_sharedInstance = nil;
static dispatch_once_t _onceToken;
@implementation ESVideo{
    ImageCallback mSnapImageCallback;
}
+ (instancetype)shareInstance {
    dispatch_once(&_onceToken, ^{
        _sharedInstance = [[ESVideo alloc] init];
        if(_sharedInstance) {
        }
        NSLog(@"ESVideo ShareInstance Did Create %p",_sharedInstance);
    });
    //NSLog(@"Access ESVideo %p",sharedInstance);
    return _sharedInstance;
}
+ (void)haltSharedInstance {
    if (_sharedInstance) {
//        if(_sharedInstance.es){
//            [_sharedInstance.es freeSubClass];
//        }
        _sharedInstance = nil;
        _onceToken = 0;
    }
}
- (instancetype)init {
    self = [super init];
    WEAKSELF_AT
    mSnapImageCallback = ^(UIImage *image){
        if(weakSelf_AT.snapImageCallback){
            weakSelf_AT.snapImageCallback(image);
        }
    };
    //门口机会有视频的长宽高,是固定的(暂时还不确定)
    _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame: CGRectMake(0, 57, [[UIScreen mainScreen] bounds].size.width, 211) delegate:nil imagecallBack:mSnapImageCallback];
    return self;
}
- (void)dealloc {
    NSLog(@"ESVideo SharedInstance Did Halted ");
}
-(void)initSDK{
     NSLog(@"ESVideo initSDK");
}
@end
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESVideoMonitorViewController.m
@@ -15,6 +15,7 @@
#import <Photos/Photos.h>
#import "AudioSessionHelper.h"
#import "CBToast.h"
#import "ESVideo.h"
@interface ESVideoMonitorViewController ()<ESVideoPhoneDelegate>
@@ -164,7 +165,7 @@
- (void)initCentetView {
    [self.view addSubview:self.centerView];
    [self.centerView addSubview:self.collectButton];
    //    [self.centerView addSubview:self.collectButton];
    [self.centerView addSubview:self.homeView];
    [self.centerView addSubview:self.screenshotImgBtn];
    [self.centerView addSubview:self.screenshotTextBtn];
@@ -397,6 +398,8 @@
#pragma SDK可视对讲 功能部分
-(void)initESVideo{
    //初始化中断,进入后台的tag
    _es = ESVideo.shareInstance.es;
    _playing = NO;
    _isSpeaking = NO;
    self.isInterrupt = NO;
@@ -412,13 +415,19 @@
            });
        };
        //门口机会有视频的长宽高,是固定的(暂时还不确定)
        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
//        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
        if (_es) {
            //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法
            if (_es.showView) {
//                for(UIView *view in [_es.showView subviews])
//                {
//                    [view removeFromSuperview];
//                }
                _es.delegate = self;
                ESVideo.shareInstance.snapImageCallback = snapImageCallback;
                _es.showView.backgroundColor = [UIColor whiteColor];
                [self.centerView addSubview:_es.showView];
                _es.showView.hidden = YES;
            }
        }else{
            NSLog(@"ESVideoPhone 初始化失败");
@@ -520,11 +529,12 @@
        [_es stopTalk];
        
        _es.delegate = nil;
        ESVideo.shareInstance.snapImageCallback = nil;
//        _es.showView.removeFromSuperview;
        
    }
    [_es freeSubClass];
//    [_es freeSubClass];
}
-(void)dealloc{
@@ -560,6 +570,10 @@
    }else if([phoneEventStr isEqual:@"EVT_Connected"]){
        [self speaker:nil];
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr isEqual:@"EVT_MonitorConnected"]){
        _es.showView.hidden = NO;
        [self speaker:nil];
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_HangUp"]){
        
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/ESvideoVideoIntercomViewController.m
@@ -14,7 +14,7 @@
#import "AudioSessionHelper.h"
#import <Photos/Photos.h>
#import <AudioToolbox/AudioToolbox.h>
#import "ESVideo.h"
@@ -80,6 +80,8 @@
    NSString * refuseStr;
    NSString * answerStr;
    NSString * unlockSuccessfullyStr;
    NSString * callingStr;
    NSString * hangUpStr;
    //    int openDoorTimeout;
    //全局变量
    SystemSoundID sound;
@@ -96,7 +98,7 @@
    [self initESVideo];
    //开始反呼
    [self StartReverseCall];
    [self ShowCalltimeBtn:@"室外机来电中..."];
    [self ShowCalltimeBtn:callingStr];
    // Do any additional setup after loading the view.
}
@@ -112,7 +114,9 @@
        operationFailedStr = @"操作失败";
        refuseStr = @"拒绝";
        answerStr = @"接听";
        hangUpStr = @"挂断";
        unlockSuccessfullyStr = @"开锁成功";
        callingStr = @"来电中...";
    }else{
        tipStr = @"Prompt";
        okStr = @"OK";
@@ -120,7 +124,10 @@
        operationFailedStr = @"Operation failed.";
        refuseStr = @"Refuse";
        answerStr = @"Answer";
        hangUpStr = @"Hang up";
        unlockSuccessfullyStr = @"Unlock successfully";
        callingStr = @"Incoming call";
    }
}
@@ -174,7 +181,7 @@
- (void)initCentetView {
    [self.view addSubview:self.centerView];
    [self.centerView addSubview:self.collectButton];
    //    [self.centerView addSubview:self.collectButton];
    [self.centerView addSubview:self.homeView];
    [self.centerView addSubview:self.unlockView];
    [self.unlockView addSubview:self.screenshotImgBtn];
@@ -384,7 +391,7 @@
    //挂断按钮移动中间
    _hangUpImgBtn.frame = CGRectMake(159, 448, 58, 58);
    _hangUpTextBtn.frame = CGRectMake(138, 514, 100, 21);
    [_hangUpTextBtn setTitle:hangUpStr forState:UIControlStateNormal];
    //开始计时
    _callTimeout = 0;
    [self startCountdown];
@@ -450,9 +457,9 @@
{
    [_calltimeBtn setTitle:mesStr forState:UIControlStateNormal];
    if(isTime){
        _calltimeBtn.frame = CGRectMake(0, 0, 100, 30);
        _calltimeBtn.frame = CGRectMake(0, 0, 80, 30);
    }else{
        _calltimeBtn.frame = CGRectMake(0, 0, 150, 30);
        _calltimeBtn.frame = CGRectMake(0, 0, 115, 30);
    }
    _calltimeBtn.center = CGPointMake(APP_SCREEN_WIDTH/2, 397);
}
@@ -575,7 +582,10 @@
#pragma SDK可视对讲 功能部分
-(void)initESVideo{
    _es = ESVideo.shareInstance.es;
    //初始化中断,进入后台的tag
    _playing = NO;
    _isSpeaking = NO;
    self.isInterrupt = NO;
@@ -593,13 +603,15 @@
            });
        };
        //门口机会有视频的长宽高,是固定的(暂时还不确定)
        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
//        _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback];
        if (_es) {
            //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法
            if (_es.showView) {
                ESVideo.shareInstance.snapImageCallback = snapImageCallback;
                _es.delegate = self;
                _es.showView.backgroundColor = [UIColor whiteColor];
                [self.centerView addSubview:_es.showView];
                _es.showView.hidden = YES;
            }
        }else{
            NSLog(@"ESVideoPhone 初始化失败");
@@ -685,6 +697,16 @@
    
}
-(void)showUIAlertViewWithBack:(NSString *)mes
{
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:tipStr message:mes preferredStyle:UIAlertControllerStyleAlert];
    [alertController addAction:[UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [self backAction];
    }]];
    [self presentViewController:alertController animated:YES completion:nil];
}
#pragma viewDidAppear
-(void)viewDidAppear:(BOOL)animated{
@@ -711,11 +733,11 @@
        [_es stopTalk];
        
        _es.delegate = nil;
        ESVideo.shareInstance.snapImageCallback = nil;
        
        
    }
    [_es freeSubClass];
//    [_es freeSubClass];
}
-(void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -744,6 +766,7 @@
    NSString *phoneEventStr = eventArray.lastObject;
    
    if([phoneEventStr isEqual:@"EVT_Ringing"]){
        _es.showView.hidden = NO;
        //反呼成功 允许接听  看需求是否需要播放铃声和震动
        [self setAnswerBtnEnable:YES];
        
@@ -753,8 +776,10 @@
    } else if([phoneEventStr isEqual:@"EVT_StopStream"]){
        //           [_mCallOrAccept setTitle:@"反呼" forState:UIControlStateNormal];
    }else if([phoneEventStr isEqual:@"EVT_Connected"]){
        //           [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_HangUp"]){
         [self showUIAlertViewWithBack:@"已挂断"];
        //           [_mCallOrAccept setTitle:@"反呼" forState:UIControlStateNormal];
    }else if([phoneEventStr  isEqual:@"EVT_P2POnlineStatusChanged"]){
        //EVT_P2PStarted(p2p初始化OK,可以连接),EVT_P2POnlineStatusChangedonline=1
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/GDHDLUtlis.h
@@ -13,8 +13,12 @@
#define IOS9  (TP_SYSTEM_VERSION >= 9.0)
#define IOS10 (TP_SYSTEM_VERSION >= 10.0)
//是否是IPhoneX的设备
#define IPhoneX ([[UIScreen mainScreen] bounds].size.height == 812)
//是否是 iPhoneX_XS_11Pro设备
#define IPhoneX ([UIScreen mainScreen].bounds.size.width == 375.0f && [UIScreen mainScreen].bounds.size.height == 812.0f)
//是否是 iPhoneXSMax_XR_11_11ProMax
#define IPhoneXR ([UIScreen mainScreen].bounds.size.width == 414.0f && [UIScreen mainScreen].bounds.size.height == 896.0f)
// 是全面屏手机
#define IsFullScreen (IPhoneX || IPhoneXR)
// Screen
#define APP_SCREEN_BOUNDS   [[UIScreen mainScreen] bounds]
@@ -22,13 +26,13 @@
#define APP_SCREEN_WIDTH    (APP_SCREEN_BOUNDS.size.width)
#define APP_STATUS_FRAME    [UIApplication sharedApplication].statusBarFrame
#define APP_TOP_BAR_HEIGHT    (IPhoneX ? 88 : (IOS7 ? 64 : 44))
#define APP_STATUS_BAR_HEIGHT (IPhoneX ? 44: (IOS7 ? 20 : 0))
#define APP_STATUS_BAR_HEIGHT_TURE (IPhoneX ? 44: (IOS7 ? 0 : 0))
#define APP_TOP_BAR_HEIGHT    (IsFullScreen ? 88 : (IOS7 ? 64 : 44))
#define APP_STATUS_BAR_HEIGHT (IsFullScreen ? 44: (IOS7 ? 20 : 0))
#define APP_STATUS_BAR_HEIGHT_TURE (IsFullScreen ? 44: (IOS7 ? 0 : 0))
#define APP_TOOL_BAR_HEIGHT   49
#define APP_TAB_BAR_HEIGHT    (IPhoneX ? (49 + 34): 49)
#define APP_TAB_BAR_HEIGHT    (IsFullScreen ? (49 + 34): 49)
#define APP_CONTENT_WIDTH     (APP_SCREEN_BOUNDS.size.width)
#define APP_BUTTOM_HEIGHT     (IPhoneX ? 34: 0)
#define APP_BUTTOM_HEIGHT     (IsFullScreen ? 34: 0)
#define APP_CONTENT_HEIGHT    (APP_SCREEN_HEIGHT - APP_TOP_BAR_HEIGHT - APP_TAB_BAR_HEIGHT)
#define APP_VISIBLE_HEIGHT    (APP_SCREEN_HEIGHT - APP_TOP_BAR_HEIGHT - APP_BUTTOM_HEIGHT)
#define APP_B_HEIGHT          (APP_SCREEN_HEIGHT - APP_BUTTOM_HEIGHT)
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/OpenViewController.h
New file
@@ -0,0 +1,17 @@
//
//  OpenViewController.h
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/1.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface OpenViewController : UIViewController
@end
NS_ASSUME_NONNULL_END
xamarin/ESVideoPhoneSDKXamarin/ESVideoPhoneSDKXamarin/OpenViewController.m
New file
@@ -0,0 +1,172 @@
//
//  OpenViewController.m
//  ESVideoPhoneSDKDemo
//
//  Created by 陈嘉乐 on 2020/6/1.
//  Copyright © 2020 eTouchSky. All rights reserved.
//
#import "OpenViewController.h"
#import "ESVideoMonitorViewController.h"
#import "ESvideoVideoIntercomViewController.h"
#import "GDHDLUtlis.h"
#import "ESVideo.h"
@interface OpenViewController ()
@property (nonatomic, strong) UIButton *monitorBtn;  //
@property (nonatomic, strong) UIButton *calledBtn;  //
@property (nonatomic,assign) BOOL                  isCollect;//是否收藏
@end
@implementation OpenViewController{
    NSString * DEVICEID;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [ESVideo.shareInstance initSDK];
    // Do any additional setup after loading the view.
    [self.view addSubview:self.monitorBtn];
    [self.view addSubview:self.calledBtn];
    //    DEVICEID = @"JJY000017XLUXX";
    DEVICEID = @"JJY000019VPLLF";
//         DEVICEID = @"JJY000016YWECG";
}
- (UIButton *)monitorBtn{
    if (_monitorBtn == nil) {
        _monitorBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, 200, APP_SCREEN_WIDTH-40, 50)];
        _monitorBtn.backgroundColor = TextSelectColor;
        [_monitorBtn setTitle:@"监控" forState:UIControlStateNormal];
        _monitorBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        _monitorBtn.titleLabel.font = [UIFont fontWithName:APP_UIFont size:15.0];
        [_monitorBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        //        [_screenshotTextBtn setTitleColor:TextSelectColor forState:UIControlStateSelected];
        [_monitorBtn addTarget:self action:@selector(monitorAction) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
        //        [_monitorBtn addTarget:self action:@selector(screenshotDownAction) forControlEvents:UIControlEventTouchDown];
        _monitorBtn.adjustsImageWhenHighlighted = NO;
        _monitorBtn.layer.cornerRadius = 25;
    }
    return _monitorBtn;
}
-(void)monitorAction{
    ESVideoMonitorViewController *mVc = [[ESVideoMonitorViewController alloc] init];
    //    mVc.modalPresentationStyle = UIModalPresentationFullScreen;
    //    mVc.edgesForExtendedLayout = YES;
    mVc.deviceName = @"室外机";
    mVc.roomName = @"2栋108";
    mVc.mESRoomID = 888;
    //    mVc.mESVideoID = @"JJY000007FSEYX";
    //    mVc.mESVideoID = @"JJY000016YWECG";
    //     mVc.mESVideoID = @"JJY000016YWECG";
    mVc.mESVideoID = DEVICEID;
    mVc.isCollect = self.isCollect;
    //    [self.navigationController pushViewController:mVc animated:YES];
    mVc.collectButtonCallBack = ^(bool isCollect) {
        self.isCollect = isCollect;
        NSString *str;
        if (isCollect) {
            str = @"收藏";
        }else{
            str = @"取消收藏";
        }
        NSLog(@"CallBack%@",str);
    };
    //    [self presentViewController:mVc  animated:YES completion:nil];
    [self.navigationController pushViewController:mVc animated:YES];
}
- (UIButton *)calledBtn{
    if (_calledBtn == nil) {
        _calledBtn = [[UIButton alloc] initWithFrame:CGRectMake(20, 300, APP_SCREEN_WIDTH-40, 50)];
        _calledBtn.backgroundColor = TextSelectColor;
        [_calledBtn setTitle:@"被呼叫" forState:UIControlStateNormal];
        _calledBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
        _calledBtn.titleLabel.font = [UIFont fontWithName:APP_UIFont size:15.0];
        [_calledBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        //        [_screenshotTextBtn setTitleColor:TextSelectColor forState:UIControlStateSelected];
        [_calledBtn addTarget:self action:@selector(calledAction) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
        //        [_monitorBtn addTarget:self action:@selector(screenshotDownAction) forControlEvents:UIControlEventTouchDown];
        _calledBtn.adjustsImageWhenHighlighted = NO;
        _calledBtn.layer.cornerRadius = 25;
    }
    return _calledBtn;
}
-(void)calledAction{
    ESvideoVideoIntercomViewController *mVc = [[ESvideoVideoIntercomViewController alloc] init];
    //    mVc.modalPresentationStyle = UIModalPresentationFullScreen;
    //    mVc.edgesForExtendedLayout = YES;
    mVc.deviceName = @"室外机2";
    mVc.roomName = @"3栋808";
    mVc.mESRoomID = 888;
    //    mVc.mESVideoID = @"JJY000007FSEYX";
    //    mVc.mESVideoID = @"JJY000016YWECG";
    mVc.mESVideoID = DEVICEID;
    mVc.isCollect = self.isCollect;
    //    [self.navigationController pushViewController:mVc animated:YES];
    mVc.collectButtonCallBack = ^(bool isCollect) {
        self.isCollect = isCollect;
        NSString *str;
        if (isCollect) {
            str = @"收藏";
        }else{
            str = @"取消收藏";
        }
        NSLog(@"CallBack%@",str);
    };
    //    [self presentViewController:mVc  animated:YES completion:nil];
    [self.navigationController pushViewController:mVc animated:YES];
}
/*
 #pragma mark - Navigation
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */
@end
xamarin/ESVideoPhoneSDKXamarin/Extern/ESVideoPhoneSDk.framework/Headers/ESVideoPhone.h
@@ -4,7 +4,7 @@
//
//  Created by maygion on 2019/3/26.
//  Copyright © 2019 eTouchSky. All rights reserved.
//  SDK版本号:1.0.0  测试版1
//  SDK版本号:1.1.0
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
xamarin/Shared.IOS.ESVideoPhoneSDK/ApiDefinition.cs
@@ -128,5 +128,34 @@
        [Export("collectButtonCallBack", ArgumentSemantic.Copy)]
        CollectButtonCallBack CollectButtonCallBack { get; set; }
    }
    // @interface ESVideo : NSObject
    [BaseType(typeof(NSObject))]
    interface ESVideo
    {
        //// @property (nonatomic, strong) int * _Nonnull es;
        //[Export("es", ArgumentSemantic.Strong)]
        //unsafe int* Es { get; set; }
        //// @property (copy, nonatomic) int snapImageCallback;
        //[Export("snapImageCallback", ArgumentSemantic.Copy)]
        //int SnapImageCallback { get; set; }
        // +(instancetype _Nonnull)shareInstance;
        [Static]
        [Export("shareInstance")]
        ESVideo ShareInstance();
        // +(void)haltSharedInstance;
        [Static]
        [Export("haltSharedInstance")]
        void HaltSharedInstance();
        // -(void)initSDK;
        [Export("initSDK")]
        void InitSDK();
    }
}
xamarin/Shared.IOS.ESVideoPhoneSDK/Library/libESVideoPhoneSDKXamarin.a
Binary files differ