diff --git a/.DS_Store b/.DS_Store index dd28ec4..fb3b6c3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index 5fa0855..f410049 100644 --- a/Ifish.xcodeproj/project.pbxproj +++ b/Ifish.xcodeproj/project.pbxproj @@ -561,9 +561,6 @@ 881869301D6EECDA00CE9DFF /* shopNoCumtomerViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8818692E1D6EECDA00CE9DFF /* shopNoCumtomerViewCell.m */; }; 881869311D6EECDA00CE9DFF /* shopNoCumtomerViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8818692F1D6EECDA00CE9DFF /* shopNoCumtomerViewCell.xib */; }; 881869341D6FDD3B00CE9DFF /* ShopKanHuP2PViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881869331D6FDD3B00CE9DFF /* ShopKanHuP2PViewController.m */; }; - 881A1D051DD2B9F200BA1AF4 /* WoDeKanKanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D041DD2B9F200BA1AF4 /* WoDeKanKanViewController.m */; }; - 881A1D091DD2BDE400BA1AF4 /* WoDeKanKanViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D071DD2BDE400BA1AF4 /* WoDeKanKanViewCell.m */; }; - 881A1D0A1DD2BDE400BA1AF4 /* WoDeKanKanViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D081DD2BDE400BA1AF4 /* WoDeKanKanViewCell.xib */; }; 881A1D201DD2C31500BA1AF4 /* kankaneditor_icon_photo.png in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D0B1DD2C31500BA1AF4 /* kankaneditor_icon_photo.png */; }; 881A1D211DD2C31500BA1AF4 /* kankaneditor_icon_photo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D0C1DD2C31500BA1AF4 /* kankaneditor_icon_photo@2x.png */; }; 881A1D221DD2C31500BA1AF4 /* kankaneditor_icon_photo@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D0D1DD2C31500BA1AF4 /* kankaneditor_icon_photo@3x.png */; }; @@ -600,8 +597,6 @@ 881A1D5A1DD41C0700BA1AF4 /* MineKanEditSec2SecCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D581DD41C0700BA1AF4 /* MineKanEditSec2SecCell.xib */; }; 881A1D5E1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D5C1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.m */; }; 881A1D5F1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D5D1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.xib */; }; - 881A1D661DD561DD00BA1AF4 /* IfishP2PVideoPlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D651DD561DD00BA1AF4 /* IfishP2PVideoPlayView.m */; }; - 881A1D6A1DD566D800BA1AF4 /* IfishP2PVideoPlayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 881A1D691DD566D800BA1AF4 /* IfishP2PVideoPlayView.xib */; }; 881A1D6D1DD571C100BA1AF4 /* IfishP2PLivePlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D6C1DD571C100BA1AF4 /* IfishP2PLivePlayViewController.m */; }; 881A1D701DD5C46A00BA1AF4 /* KanKanListTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 881A1D6F1DD5C46A00BA1AF4 /* KanKanListTableCell.m */; }; 881B123A1E1CCA65004C074B /* RuSunHaveHeateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 881B12391E1CCA65004C074B /* RuSunHaveHeateViewController.m */; }; @@ -1058,7 +1053,6 @@ 882C85B21EB03994001CC414 /* particulars_teb_ten@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 882C85AF1EB03994001CC414 /* particulars_teb_ten@2x.png */; }; 882C85B31EB03994001CC414 /* particulars_teb_ten@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 882C85B01EB03994001CC414 /* particulars_teb_ten@3x.png */; }; 882C85B61EB08295001CC414 /* DiscountCoupon.m in Sources */ = {isa = PBXBuildFile; fileRef = 882C85B51EB08295001CC414 /* DiscountCoupon.m */; }; - 882DF00E1EA70EF2009FF5D0 /* libemTMF_Ofical_jw160727.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 882DF00C1EA70EF2009FF5D0 /* libemTMF_Ofical_jw160727.a */; }; 883283361EAEE60500A47157 /* home_nav_news.png in Resources */ = {isa = PBXBuildFile; fileRef = 8832831B1EAEE60500A47157 /* home_nav_news.png */; }; 883283371EAEE60500A47157 /* home_nav_news@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8832831C1EAEE60500A47157 /* home_nav_news@2x.png */; }; 883283381EAEE60500A47157 /* home_nav_news@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8832831D1EAEE60500A47157 /* home_nav_news@3x.png */; }; @@ -2377,9 +2371,9 @@ CB484E4822B8CF9B0075F050 /* AlipaySDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB484E3422B8CF9A0075F050 /* AlipaySDK.framework */; }; CB484E4922B8CF9B0075F050 /* SGSecurityBody.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB484E3522B8CF9A0075F050 /* SGSecurityBody.framework */; }; CB484E4A22B8CF9B0075F050 /* OpenMtopExt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB484E3622B8CF9A0075F050 /* OpenMtopExt.framework */; }; - CB484E4D22B8D29C0075F050 /* GWP2P.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB484E4B22B8D2990075F050 /* GWP2P.framework */; }; - CB484E4E22B8D29C0075F050 /* SDK使用说明 in Resources */ = {isa = PBXBuildFile; fileRef = CB484E4C22B8D29C0075F050 /* SDK使用说明 */; }; - CB484E4F22B8D2C40075F050 /* GWP2P.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CB484E4B22B8D2990075F050 /* GWP2P.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + CB52699F22D491D300990E86 /* GWP2P.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB52699D22D491D200990E86 /* GWP2P.framework */; }; + CB5269A022D491D300990E86 /* SDK使用说明 in Resources */ = {isa = PBXBuildFile; fileRef = CB52699E22D491D300990E86 /* SDK使用说明 */; }; + CB5269A122D4A1B500990E86 /* GWP2P.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CB52699D22D491D200990E86 /* GWP2P.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CB7D6AA022953BEB0014E5C7 /* YYDiskCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CB7D6A9822953BEB0014E5C7 /* YYDiskCache.m */; }; CB7D6AA122953BEB0014E5C7 /* YYKVStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = CB7D6A9922953BEB0014E5C7 /* YYKVStorage.h */; }; CB7D6AA222953BEB0014E5C7 /* YYCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CB7D6A9A22953BEB0014E5C7 /* YYCache.m */; }; @@ -2543,7 +2537,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - CB484E4F22B8D2C40075F050 /* GWP2P.framework in Embed Frameworks */, + CB5269A122D4A1B500990E86 /* GWP2P.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -3371,11 +3365,6 @@ 8818692F1D6EECDA00CE9DFF /* shopNoCumtomerViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = shopNoCumtomerViewCell.xib; sourceTree = ""; }; 881869321D6FDD3B00CE9DFF /* ShopKanHuP2PViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShopKanHuP2PViewController.h; sourceTree = ""; }; 881869331D6FDD3B00CE9DFF /* ShopKanHuP2PViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShopKanHuP2PViewController.m; sourceTree = ""; }; - 881A1D031DD2B9F200BA1AF4 /* WoDeKanKanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WoDeKanKanViewController.h; sourceTree = ""; }; - 881A1D041DD2B9F200BA1AF4 /* WoDeKanKanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WoDeKanKanViewController.m; sourceTree = ""; }; - 881A1D061DD2BDE400BA1AF4 /* WoDeKanKanViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WoDeKanKanViewCell.h; sourceTree = ""; }; - 881A1D071DD2BDE400BA1AF4 /* WoDeKanKanViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WoDeKanKanViewCell.m; sourceTree = ""; }; - 881A1D081DD2BDE400BA1AF4 /* WoDeKanKanViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WoDeKanKanViewCell.xib; sourceTree = ""; }; 881A1D0B1DD2C31500BA1AF4 /* kankaneditor_icon_photo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = kankaneditor_icon_photo.png; sourceTree = ""; }; 881A1D0C1DD2C31500BA1AF4 /* kankaneditor_icon_photo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "kankaneditor_icon_photo@2x.png"; sourceTree = ""; }; 881A1D0D1DD2C31500BA1AF4 /* kankaneditor_icon_photo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "kankaneditor_icon_photo@3x.png"; sourceTree = ""; }; @@ -3420,9 +3409,6 @@ 881A1D5B1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineKanEditSec2ThredCell.h; sourceTree = ""; }; 881A1D5C1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineKanEditSec2ThredCell.m; sourceTree = ""; }; 881A1D5D1DD41C2200BA1AF4 /* MineKanEditSec2ThredCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MineKanEditSec2ThredCell.xib; sourceTree = ""; }; - 881A1D641DD561DD00BA1AF4 /* IfishP2PVideoPlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IfishP2PVideoPlayView.h; sourceTree = ""; }; - 881A1D651DD561DD00BA1AF4 /* IfishP2PVideoPlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IfishP2PVideoPlayView.m; sourceTree = ""; }; - 881A1D691DD566D800BA1AF4 /* IfishP2PVideoPlayView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IfishP2PVideoPlayView.xib; sourceTree = ""; }; 881A1D6B1DD571C100BA1AF4 /* IfishP2PLivePlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IfishP2PLivePlayViewController.h; sourceTree = ""; }; 881A1D6C1DD571C100BA1AF4 /* IfishP2PLivePlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IfishP2PLivePlayViewController.m; sourceTree = ""; }; 881A1D6E1DD5C46A00BA1AF4 /* KanKanListTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KanKanListTableCell.h; sourceTree = ""; }; @@ -3899,8 +3885,6 @@ 882C85B01EB03994001CC414 /* particulars_teb_ten@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "particulars_teb_ten@3x.png"; sourceTree = ""; }; 882C85B41EB08295001CC414 /* DiscountCoupon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiscountCoupon.h; sourceTree = ""; }; 882C85B51EB08295001CC414 /* DiscountCoupon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DiscountCoupon.m; sourceTree = ""; }; - 882DF00C1EA70EF2009FF5D0 /* libemTMF_Ofical_jw160727.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libemTMF_Ofical_jw160727.a; sourceTree = ""; }; - 882DF00D1EA70EF2009FF5D0 /* LSemTMFSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSemTMFSet.h; sourceTree = ""; }; 8832831B1EAEE60500A47157 /* home_nav_news.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = home_nav_news.png; sourceTree = ""; }; 8832831C1EAEE60500A47157 /* home_nav_news@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_nav_news@2x.png"; sourceTree = ""; }; 8832831D1EAEE60500A47157 /* home_nav_news@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "home_nav_news@3x.png"; sourceTree = ""; }; @@ -5784,8 +5768,8 @@ CB484E3422B8CF9A0075F050 /* AlipaySDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AlipaySDK.framework; sourceTree = ""; }; CB484E3522B8CF9A0075F050 /* SGSecurityBody.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SGSecurityBody.framework; sourceTree = ""; }; CB484E3622B8CF9A0075F050 /* OpenMtopExt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OpenMtopExt.framework; sourceTree = ""; }; - CB484E4B22B8D2990075F050 /* GWP2P.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GWP2P.framework; sourceTree = ""; }; - CB484E4C22B8D29C0075F050 /* SDK使用说明 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "SDK使用说明"; sourceTree = ""; }; + CB52699D22D491D200990E86 /* GWP2P.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GWP2P.framework; sourceTree = ""; }; + CB52699E22D491D300990E86 /* SDK使用说明 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "SDK使用说明"; sourceTree = ""; }; CB7D6A9822953BEB0014E5C7 /* YYDiskCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYDiskCache.m; sourceTree = ""; }; CB7D6A9922953BEB0014E5C7 /* YYKVStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YYKVStorage.h; sourceTree = ""; }; CB7D6A9A22953BEB0014E5C7 /* YYCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YYCache.m; sourceTree = ""; }; @@ -5988,6 +5972,7 @@ 88C686481EA61217004CDFD9 /* CoreGraphics.framework in Frameworks */, 88C686461EA611F7004CDFD9 /* ImageIO.framework in Frameworks */, 88C686441EA611DC004CDFD9 /* libc++abi.tbd in Frameworks */, + CB52699F22D491D300990E86 /* GWP2P.framework in Frameworks */, 3D1C50B3221A9EDF0096AE43 /* YTheNaviBar.a in Frameworks */, 88C6863C1EA6116C004CDFD9 /* libxml2.tbd in Frameworks */, 88C6863A1EA61149004CDFD9 /* MapKit.framework in Frameworks */, @@ -6033,8 +6018,6 @@ CB484E1C22B8C8C90075F050 /* libRTSP.a in Frameworks */, 883E7BCD1EA5FA1A00ED5D89 /* MOBFoundationEx.framework in Frameworks */, 88C686111EA60A40004CDFD9 /* libTalkingData.a in Frameworks */, - 882DF00E1EA70EF2009FF5D0 /* libemTMF_Ofical_jw160727.a in Frameworks */, - CB484E4D22B8D29C0075F050 /* GWP2P.framework in Frameworks */, 881671BD1EA5DE2B00BEBF23 /* UMCommunitySDK.framework in Frameworks */, 881671BC1EA5DE2B00BEBF23 /* UMComFoundation.framework in Frameworks */, CB484E4922B8CF9B0075F050 /* SGSecurityBody.framework in Frameworks */, @@ -7751,16 +7734,6 @@ path = User; sourceTree = ""; }; - 881A1D601DD557A900BA1AF4 /* IfishP2PPlayView */ = { - isa = PBXGroup; - children = ( - 881A1D641DD561DD00BA1AF4 /* IfishP2PVideoPlayView.h */, - 881A1D651DD561DD00BA1AF4 /* IfishP2PVideoPlayView.m */, - 881A1D691DD566D800BA1AF4 /* IfishP2PVideoPlayView.xib */, - ); - path = IfishP2PPlayView; - sourceTree = ""; - }; 881B12411E1CCC5E004C074B /* JuNeng */ = { isa = PBXGroup; children = ( @@ -8869,15 +8842,6 @@ path = ViewControlller; sourceTree = ""; }; - 882DF00B1EA70EF2009FF5D0 /* LSemTMFSet */ = { - isa = PBXGroup; - children = ( - 882DF00C1EA70EF2009FF5D0 /* libemTMF_Ofical_jw160727.a */, - 882DF00D1EA70EF2009FF5D0 /* LSemTMFSet.h */, - ); - path = LSemTMFSet; - sourceTree = ""; - }; 883283571EAF211900A47157 /* GoldCoast */ = { isa = PBXGroup; children = ( @@ -10118,14 +10082,6 @@ path = SMS_SDK; sourceTree = ""; }; - 884BF4B61D77E0CA00C8518A /* BaiLingSoundSdk */ = { - isa = PBXGroup; - children = ( - 882DF00B1EA70EF2009FF5D0 /* LSemTMFSet */, - ); - path = BaiLingSoundSdk; - sourceTree = ""; - }; 885692AE1E8240EA00C51617 /* IfishBannerModel */ = { isa = PBXGroup; children = ( @@ -11608,7 +11564,6 @@ isa = PBXGroup; children = ( 885C43981E89F79D00685A2E /* IfishNewLiveList */, - 881A1D601DD557A900BA1AF4 /* IfishP2PPlayView */, 88C1B2D81DD2B77600C2C99A /* MineKankan */, 88C1B2341DD15FCF00C2C99A /* IfishLivelist */, ); @@ -11654,11 +11609,6 @@ 88C1B2D81DD2B77600C2C99A /* MineKankan */ = { isa = PBXGroup; children = ( - 881A1D031DD2B9F200BA1AF4 /* WoDeKanKanViewController.h */, - 881A1D041DD2B9F200BA1AF4 /* WoDeKanKanViewController.m */, - 881A1D061DD2BDE400BA1AF4 /* WoDeKanKanViewCell.h */, - 881A1D071DD2BDE400BA1AF4 /* WoDeKanKanViewCell.m */, - 881A1D081DD2BDE400BA1AF4 /* WoDeKanKanViewCell.xib */, 881A1D351DD3025400BA1AF4 /* MineKankanEditViewController.h */, 881A1D361DD3025400BA1AF4 /* MineKankanEditViewController.m */, 881A1D3D1DD4057100BA1AF4 /* MineKanEditSec0ViewCell.h */, @@ -11895,7 +11845,6 @@ 88C6860D1EA60A40004CDFD9 /* TalkingDataV2.2.88 */, 88C685C81EA603A8004CDFD9 /* UMSocial */, 883E7BC81EA5FA1A00ED5D89 /* SMS_SDK */, - 884BF4B61D77E0CA00C8518A /* BaiLingSoundSdk */, 88F5ECBD1D48CA2800CC7CAF /* ESPTouch */, 88F5ECE51D48CA2800CC7CAF /* UMCommunity */, ); @@ -12197,8 +12146,8 @@ CB484CE822B76DEC0075F050 /* GWP2PSDK */ = { isa = PBXGroup; children = ( - CB484E4B22B8D2990075F050 /* GWP2P.framework */, - CB484E4C22B8D29C0075F050 /* SDK使用说明 */, + CB52699D22D491D200990E86 /* GWP2P.framework */, + CB52699E22D491D300990E86 /* SDK使用说明 */, ); path = GWP2PSDK; sourceTree = ""; @@ -13407,7 +13356,7 @@ 882956091DBDA3A100E9DDD7 /* neves0012.png in Resources */, 882956B81DBDA3A200E9DDD7 /* scan_left@3x.png in Resources */, 882958171DC04ED200E9DDD7 /* equipment_longpoint.png in Resources */, - CB484E4E22B8D29C0075F050 /* SDK使用说明 in Resources */, + CB5269A022D491D300990E86 /* SDK使用说明 in Resources */, 882957431DBDA3A300E9DDD7 /* swimmingfish0050.png in Resources */, 88D3372C1DC71EB5006C0ADB /* linkingdevice_line@2x.png in Resources */, 882956E21DBDA3A300E9DDD7 /* bg2.png in Resources */, @@ -13942,7 +13891,6 @@ 88696FF71E9CBC2E005D4AFB /* home_iocn_hotsell@2x.png in Resources */, FA08930A2275DD780084A609 /* shajun_big@2x.png in Resources */, 882957021DBDA3A300E9DDD7 /* PFkilLlight_off.png in Resources */, - 881A1D0A1DD2BDE400BA1AF4 /* WoDeKanKanViewCell.xib in Resources */, 886512061E97966400BABDF1 /* task_shareIfishApp@3x.png in Resources */, 8829569E1DBDA3A200E9DDD7 /* YesbtnBc.png in Resources */, 8871FB1F1EBC822B0038E99A /* select_camera@2x.png in Resources */, @@ -14219,7 +14167,6 @@ 885FBE1E1E4D66C100E0D7D1 /* merchant_iocn_a_member@3x.png in Resources */, 8849EFBE1EB883840096CAD7 /* enter_padlock@3x.png in Resources */, 8829573D1DBDA3A300E9DDD7 /* swimmingfish0044.png in Resources */, - 881A1D6A1DD566D800BA1AF4 /* IfishP2PVideoPlayView.xib in Resources */, 88597A211E554CCB003D0E5C /* tab_device_message.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -14647,7 +14594,6 @@ 3D1C17482171BB0700A159A8 /* PNRadarChartDataItem.m in Sources */, 8871C44B1E6D2A93000AA49F /* QianDaoGongLueViewCell.m in Sources */, 8871FAA41EBC0CE30038E99A /* ShopCerProgressHeaderView.m in Sources */, - 881A1D661DD561DD00BA1AF4 /* IfishP2PVideoPlayView.m in Sources */, 88602DBC1E10D97E00F3DB5D /* UIImage+WebP.m in Sources */, 88F5EFD81D48D08100CC7CAF /* MMVectorImage.m in Sources */, 883E79B81D48B0280030E075 /* remindCyclePic.m in Sources */, @@ -14889,7 +14835,6 @@ 3D1C50ED221A9EE00096AE43 /* RecommendInfoDAO.m in Sources */, 88C5989D1EA0965B00BDC812 /* LBLaunchImageAdView.m in Sources */, E58C9984208195640004C42B /* RuiMeiViewController.m in Sources */, - 881A1D051DD2B9F200BA1AF4 /* WoDeKanKanViewController.m in Sources */, 881671CD1EA5DE2B00BEBF23 /* UMComLocationTableViewCell.m in Sources */, 88742C331D63F9E80074F1F8 /* CertifyListSecondCell.m in Sources */, 3D8F64F5215797E700F04BD3 /* IQKeyboardManager.m in Sources */, @@ -14907,7 +14852,6 @@ 886D94F81D6C3F3A00CF0B63 /* MineKanHuNormalViewCell.m in Sources */, 88F5EFD01D48D08100CC7CAF /* MMLinearProgressView.m in Sources */, 88F5EFAF1D48D08100CC7CAF /* AFURLRequestSerialization.m in Sources */, - 881A1D091DD2BDE400BA1AF4 /* WoDeKanKanViewCell.m in Sources */, 880707AA1DE2D53E0076F65A /* UITextView+AddKeybordDoneVIew.m in Sources */, 88F5EFC81D48D08100CC7CAF /* JHRefreshConfig.m in Sources */, 880707F61DE302630076F65A /* LXColorTools.m in Sources */, @@ -15461,7 +15405,7 @@ "-ObjC", "-Istdc++", "-force_load", - "\"$(SRCROOT)/ifish/GWP2PSDK/GWP2P.framework/GWP2P\"", + "\"$(PROJECT_DIR)/Ifish/GWP2PSDK/GWP2P.framework/GWP2P\"", ); PRODUCT_BUNDLE_IDENTIFIER = com.shyuying.Ifish8; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -15575,7 +15519,7 @@ "-ObjC", "-Istdc++", "-force_load", - "\"$(SRCROOT)/ifish/GWP2PSDK/GWP2P.framework/GWP2P\"", + "\"$(PROJECT_DIR)/Ifish/GWP2PSDK/GWP2P.framework/GWP2P\"", ); PRODUCT_BUNDLE_IDENTIFIER = com.shyuying.Ifish8; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Ifish/.DS_Store b/Ifish/.DS_Store index 75392fa..2b507dd 100644 Binary files a/Ifish/.DS_Store and b/Ifish/.DS_Store differ diff --git a/Ifish/BaiLingSoundSdk/.DS_Store b/Ifish/BaiLingSoundSdk/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/Ifish/BaiLingSoundSdk/.DS_Store and /dev/null differ diff --git a/Ifish/BaiLingSoundSdk/LSemTMFSet/LSemTMFSet.h b/Ifish/BaiLingSoundSdk/LSemTMFSet/LSemTMFSet.h deleted file mode 100644 index 733184c..0000000 --- a/Ifish/BaiLingSoundSdk/LSemTMFSet/LSemTMFSet.h +++ /dev/null @@ -1,93 +0,0 @@ -// Created by TTS on 15/10/9. -// Copyright © 2016年 Gwell. All rights reserved. - -#import - -static int INITSDK_ERRCOE_ENABLE =0x01;//能正常使用SDK -static int INITSDK_ERRCOE_OVERLOAD=0xA0;//认证设备数量超限 -static int INITSDK_ERRCOE_UNENABLE=0xA1;//授权验证不通过 -static int INITSDK_INVAILDDATA=-3;//初始化传入了非法的参数 -static int INITSDK_ERRCOE_WIFIDISABLE=-2;//WIFI不可用 -static int INITSDK_ERRCOE_NOINIT=-1;//没有初始化SDK -static int HTTP_CODE_ERRTOTALDEVICE=50008; //认证设备数量超限 -static int INITSDK_OVERDUE=50009; //超过使用期限 - -static int INITSDK_LICENSE_FORBIDDEN=50006; //禁止license -/* 配置结果的数据类型 */ -typedef NS_ENUM(NSInteger,EMTMFErrcodeType){ - EMTMFErrcodeType_SUCESS = 0x01,//配置成功 - EMTMFErrcodeType_FAILED = 0x02//配置失败 -} ; - -@protocol LSemTMFSetDelegate - -@optional -/** - * 功能:获取配置是否成功的错误码 - */ -- (void)didSetWifiResultErrcode:(nullable EMTMFErrcodeType*)errcode content:(nullable NSString*)content; -/** - * 功能:emTMF发送完成后会调用该函数 - */ -- (void)didFSKSendingComplete; -/** - *功能:SDK不能正常使用的错误吗和原因 - */ --(void)didSDKErrcode:(int) errCode errMsg:(nullable NSString*)errMsg; - -@end - - -@interface LSemTMFSet : NSObject -@property (nonatomic, retain, nonnull) id delegate; - -/** 获取单例 */ -+ (nullable instancetype)sharedInstance; - -/** - 将SSID和密码以声波的方式发送出去 - @param ssid WI-FI网络名 - @param password Wi-Fi网络的密码 - @note ssid长度不可为0,password的长度可以为0 - */ -- (void)sendWiFiSet:(nonnull NSString *)SSID password:(nonnull NSString *)psw; -/** - 得到播放的时长 - @param ssid WI-FI网络名 - @param password Wi-Fi网络的密码 - @note ssid长度不可为0,password的长度可以为0 - */ --(int)getPlayTime:(nonnull NSString *)SSID password:(nonnull NSString *)psw; -/** - 得到当前初始化SDK的错误码 - */ --(int)getCurInitSDKCode; -/** - 停止发送FSK声波 - */ -- (void)stopSend; -/** - 在听到设备发出“接收成功”的提示后调用此方法,对设备进行连接超时限制 - */ --(void)startConnectTimeOutListener:(long)waittime; -/** - 取消掉联网失败的计时器 - */ --(void)cancleConnectTimer; -/** - 退出EMTMF配置做的操作 - */ --(void)exitEMTMFSDK; - -/** - 初始化SDK - manufactrurer 产品信息 - client 客户信息 - productModel 产品型号 - license License信息 - */ --(int)initSDK:(nonnull NSString*)manufactrurer client:(nonnull NSString*)client productModel:(nonnull NSString*)productModel license:(nonnull NSString*)license; -@end - - - diff --git a/Ifish/BaiLingSoundSdk/LSemTMFSet/libemTMF_Ofical_jw160727.a b/Ifish/BaiLingSoundSdk/LSemTMFSet/libemTMF_Ofical_jw160727.a deleted file mode 100644 index f5982ca..0000000 Binary files a/Ifish/BaiLingSoundSdk/LSemTMFSet/libemTMF_Ofical_jw160727.a and /dev/null differ diff --git a/Ifish/GWP2PSDK/GWP2P.framework/GWP2P b/Ifish/GWP2PSDK/GWP2P.framework/GWP2P index ddf3360..6058810 100755 Binary files a/Ifish/GWP2PSDK/GWP2P.framework/GWP2P and b/Ifish/GWP2PSDK/GWP2P.framework/GWP2P differ diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNet.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNet.h index 66ea963..9476500 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNet.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNet.h @@ -21,7 +21,7 @@ @param errorString 描述具体的错误原因 @param json 具体的返回数据 */ -typedef void(^GWNetCompletionBlock)(BOOL success, NSString *errorCode, NSString *errorString, NSDictionary *json); +typedef void(^GWNetCompletionBlock)(BOOL success, NSString *errorCode, NSString *errorString, NSDictionary *json); //调接口时会话ID错误发出的通知,会话ID超时/错误时所有接口无法调用,应该让用户重新登录获取新的Session。每个接口处理过于麻烦,所以增加通知。 extern NSString * const kGWNetSessionIdErrorNotification; @@ -154,7 +154,6 @@ extern NSString * const kGWNetSessionIdErrorNotification; withUserId:(NSString *)userId sessionId:(NSString *)sessionId completion:(GWNetCompletionBlock)completion; - #pragma mark 退出登录 /** 退出登录 diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNetError.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNetError.h index 14ce9a7..ce54561 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNetError.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWNetError.h @@ -40,7 +40,7 @@ #define GWNET_RET_PHONE_FORMAT_ERROR @"10901022" //手机号数据格式不符合要求 #define GWNET_RET_LACK_PARAMETER_ERROR @"10901020" //缺少输入参数 #define GWNET_RET_GET_EMAIL_CODE_TOO_OFTEN @"10902027" //获取邮件太频繁 -#define GWNET_RET_GET_EMAIL_CODE_COUNT_LIMIT @"10902028" //获取邮件已到达30分钟内的上限 +#define GWNET_RET_GET_EMAIL_CODE_COUNT_LIMIT @"10902028" //邮件验证码超时 #define GWNET_RET_EMAIL_CODE_ERROR @"10902029" //邮件验证码不正确 #define GWNET_RET_EMAIL_CODE_TIMEOUT @"10902030" //邮件验证码超时 diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2P.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2P.h index 54c47c1..f685852 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2P.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2P.h @@ -24,6 +24,7 @@ #import "GWP2PClient+GarageLight.h" #import "GWP2PClient+HXVision.h" #import "GWP2PDefine.h" +#import "GWP2PClient+P2PInfo.h" //监控、视频通话、回放 diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+APMode.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+APMode.h index 247deff..59d923b 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+APMode.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+APMode.h @@ -58,5 +58,10 @@ @param completionBlock 与设备交互完成后的回调Block */ - (void)setDeviceWifiPassword:(NSString *)wifiPassword inAPModeWithCompletionBlock:(CompletionBlock)completionBlock; - +/** + 设置设备列表将设备版本号传给sdk + + @param deviceAry 设备数组[@{@"deviceID":.@"p2p version of device",}] + */ +-(void)p2pSetDevieAry:(NSArray *)deviceAry; @end diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Alarm.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Alarm.h index 7cf3524..463ee13 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Alarm.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Alarm.h @@ -91,6 +91,45 @@ typedef enum GWUnbindAlarmAccountOperationType { devicePassword:(NSString *)devicePassword completionBlock:(CompletionBlock)completionBlock; + +/** + 设置设备报警声开关状态 + 获取设备报警声开关状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock: + @param alarmOn 开关状0关,1开 + @param deviceID 设备ID + @param devicePassword 设备密码 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)setDeviceSpecialAlarmState:(NSUInteger)alarmOn + withDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + completionBlock:(CompletionBlock)completionBlock; + +/** + 设置设备报警白光灯状态 + 获取设备备报警白光灯状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock: + @param alarmOn 开关状0关,1开 + @param deviceID 设备ID + @param devicePassword 设备密码 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)setDeviceWhiteAlarmLightState:(NSUInteger)alarmOn + withDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + completionBlock:(CompletionBlock)completionBlock; + +/** + 设置设备红蓝灯开关状态 + 获取设备红蓝灯开关状态请调 getMultipledeviceStatusWithDeviceID:password:completionBlock: + @param alarmOn 开关状0关,1开 + @param deviceID 设备ID + @param devicePassword 设备密码 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)setDeviceRedBluelAlarmLightState:(NSUInteger)alarmOn + withDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + completionBlock:(CompletionBlock)completionBlock; /** 设置设备人体红外开关状态 diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+DeviceInfomation.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+DeviceInfomation.h index ff853e3..d1f38ba 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+DeviceInfomation.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+DeviceInfomation.h @@ -93,7 +93,7 @@ typedef NS_ENUM(NSUInteger, GWDeviceRTSPPasswordMode) { @"type" (设备主类型): GWDeviceType 类型,(如IPC、NPC...) (设备返回的主类型不准) - @"subtype" (设备子类型): GWDeviceSubtype 类型,(如30只支持868;31支持868+情景模式;32支持868+情景模式+分享) + @"device subtype" (设备子类型): GWDeviceSubtype 类型,(如30只支持868;31支持868+情景模式;32支持868+情景模式+分享) @"preset position suppurted" (是否支持预置位): @(BOOL) NO 不支持; YES 支持 @@ -456,6 +456,39 @@ typedef NS_ENUM(NSUInteger, GWDeviceRTSPPasswordMode) { - (void)getDeviceResolutionAndIpAndMacAddressWithDeviceID:(NSString *)deviceID devicePassword:(NSString *)devicePassword completionBlock:(CompletionBlock)completionBlock; +#pragma mark - 获取设备DNS,网关,子网,ip +/** + 获取设备获取设备DNS,网关,子网,ip + + @param deviceID 设备ID + @param devicePassword 设备密码 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)getDeviceDNSAndIpAndGetWayAndSubNetMaskWithDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + completionBlock:(CompletionBlock)completionBlock; +#pragma mark - 设置设备DNS,网关,子网,ip + +/** + 设置设备DNS,网关,子网,ip + + @param deviceID 设备ID + @param devicePassword 设备密码 + @param isAuto 0为静态,1为动态,为动态时后面的参数都为无效 + @param dNS 设置静态 DNS 值时填255.255.255.255 .动态时填 0 + @param IP 设置静态 ip 值时填192.168.1.1。动态时填 0 + @param subNetMask 设置静态子网掩码值时填255.255.255.0 动态时填 0 + @param getWay 设置静态网关值时填。动态时填255.255.255.255 动态时填 0 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)setDeviceDNSAndIpAndGetWayAndSubNetMaskWithDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + isAuto:(NSInteger)isAuto + deviceDNS:(NSString*)dNS + deviceIP:(NSString*)IP + deviceSubNetMask:(NSString*)subNetMask + deviceGetWay:(NSString *)getWay + completionBlock:(CompletionBlock)completionBlock; #pragma mark - 获取用户及设备列表在线状态等信息 /** diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+HXVision.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+HXVision.h index 2acc9ad..7a020c5 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+HXVision.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+HXVision.h @@ -10,6 +10,7 @@ #import #import "GWP2PPlayerDefine.h" #import + /** 操作预置位方式 */ @@ -44,5 +45,7 @@ typedef enum GWHXVisonPreseSubcmdType { devicePassword:(NSString *)devicePassword point:(CGPoint)point size:(CGSize)size; -- (void)sendHXCommandTypeandOption:(int)option; + +- (void)sendHXCommandTypeandOption:(GWP2PHXVisonDirection)direction; + @end diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+P2PInfo.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+P2PInfo.h new file mode 100755 index 0000000..8180b33 --- /dev/null +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+P2PInfo.h @@ -0,0 +1,17 @@ +// +// GWP2PClient+P2PInfo.h +// GWP2P +// +// Created by yuguihua on 2019/6/10. +// Copyright © 2019 apple. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface GWP2PClient (P2PInfo) +-(NSString *)getP2PVersion; +@end + +NS_ASSUME_NONNULL_END diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Record.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Record.h index e045175..89ce579 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Record.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+Record.h @@ -16,7 +16,14 @@ typedef enum GWP2PRecordType{ GWP2PRecordTypeAlarm,/**< 报警时录像 */ GWP2PRecordTypeSchedule,/**< 定时录像 */ }GWP2PRecordType; - +/** + 云录像质量 + */ +typedef enum GWP2PCloudRecordType{ + GWP2PRecordTypeQuilty = 0,/**< 质量优先 */ + GWP2PRecordTypeSmooth = 1,/**< 流畅优先 */ + +}GWP2PCloudRecordType; /** 录像质量 */ @@ -45,6 +52,9 @@ typedef enum GWP2PRecordDefinition { @property (nonatomic, strong) NSDate *date;/**< 记录上面的时间 */ +@property (nonatomic, assign) NSInteger totalSec;/**< 记录上面的时间 */ +@property (nonatomic, assign) NSInteger totalEndSec;/**< 记录上面的时间结束为totalsec + time */ + @property (nonatomic, copy) NSString *cType; /**< 文件类型 一个字符 */ @property (nonatomic, assign) NSInteger time; /**< 文件播放时长 若不支持,则为-1 */ @@ -222,5 +232,36 @@ typedef enum GWP2PRecordDefinition { startDate:(NSDate *)startDate endDate:(NSDate *)endDate completionBlock:(CompletionBlock)completionBlock; +#pragma mark - 获取某一天的回放文件 +/** + 获取设备回放文件 + + 一次只能获取64个文件,如果给定的时间差大于64个文件,会分多次获取,一次返回多次获取文件,为保证每次数据都能正常返回,若无特殊要求,两次给定的时间差尽量小点 + + completionBlock返回字典: + + @"files" 键对应一个 NSMutableArray * + + @param deviceID 设备ID + @param devicePassword 设备密码 + @param dayDate 当天日期,如果传空返回当天日期的回放列表 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)getDeviceOneDayPlaybackFilesOWithDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + dayDate:(NSDate *)dayDate + completionBlock:(CompletionBlock)completionBlock; +/** + 设置设备云回放上传的质量 + + @param recordType 设置类型。质量优先与流畅优先 + @param deviceID 设备ID + @param devicePassword 设备密码 + @param completionBlock 与设备交互完成后的回调Block + */ +- (void)setDeviceCloudPlayBackQuality:(GWP2PCloudRecordType)recordType + WithDeviceID:(NSString *)deviceID + devicePassword:(NSString *)devicePassword + completionBlock:(CompletionBlock)completionBlock; @end diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+SceneMode.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+SceneMode.h index 73de6d0..c8dbce8 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+SceneMode.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient+SceneMode.h @@ -72,6 +72,15 @@ typedef NS_ENUM(uint8_t, GWProtectionSettingState) { GWProtectionSettingStateOn = 1, /**< 状态开 */ GWProtectionSettingStateOff, /**< 状态关 */ }; +/** + 各传感器的防护设置状态 + */ +typedef NS_ENUM(uint8_t, GWProtectionSettingBodyState) { + GWProtectionSettingBodyStateNotSurpport = 0, /**< 设备不支持 */ + GWProtectionSettingBodyStateOn = 3, /**< 状态开 */ + GWProtectionSettingBodyStateOnlyBodyOff =7, /**< 状态关 */ + +}; /** @@ -89,6 +98,7 @@ typedef NS_ENUM(uint8_t, GWProtectionSettingState) { @property (nonatomic, assign) GWProtectionSettingState externalAlarmInputState; /**< 外部报警输入 */ @property (nonatomic, assign) GWProtectionSettingState externalAlarmOutputState; /**< 外部报警输出 */ @property (nonatomic, assign) GWProtectionSettingState externalSensorState; /**< 外部传感器 */ +@property (nonatomic, assign) GWProtectionSettingBodyState body_detect; /**< 人体侦测 &1 bit 0 表示不支持 1 支持 &4 bit 3 0表示仅人形 1表示物件跟人形都支持 人形侦测 0不支持 3打开 7关闭*/ @end diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient.h index 3d79e25..0f67c30 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PClient.h @@ -128,6 +128,7 @@ @property (nonatomic, weak) id delegate;/**< GWP2PClient的代理,一些设备事件的通知对象 */ @property (nonatomic, assign) BOOL isAPMode;/**< 是不是AP模式。此属性只保存上次与路由器交互后的数据,调 getDeviceIDInAPMode 方法会重新与路由器交互更新APMode状态,每次app进入前台时会更新APMode状态 */ +@property (nonatomic, assign) NSInteger port;/**< 广播端口 */ @property (nonatomic, copy) NSString *serverList; /**< P2P服务器列表,自建服务器需要设置此属性,格式"|p2p1.cloudlinks.cn|p2p2.cloudlinks.cn|p2p3.cloud-links.net" */ @@ -219,5 +220,4 @@ data:(NSData *)data completionBlock:(CompletionBlock)completionBlock; - @end diff --git a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PDefine.h b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PDefine.h index 8064259..17d8771 100755 --- a/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PDefine.h +++ b/Ifish/GWP2PSDK/GWP2P.framework/Headers/GWP2PDefine.h @@ -140,4 +140,23 @@ typedef NS_ENUM(NSUInteger, GWSensorAlarmType) { }; + +/** + 发送设备指令后返回的错误类型 + */ +typedef NS_ENUM(NSInteger, P2PCloudPlayBackError) { + P2PCloudPlayBackErrorNone = 0, /**< 没有错误 */ + P2PCloudPlayBackErrorForbidden = -1011, /**< 鉴权过期禁止访问 */ + P2PCloudPlayBackErrorNoPermission = 10903001 , /** Headers/GWNet.h - N5pUkPs/Hy2Ho7CTNdJM9v0GRz0= + /D/h3V7xJHk/BcZAej7Qdp1XAW8= Headers/GWNetError.h - XuUZaxW3FCFUD7kCae84h1j4pZM= + 0j5ICqr7VpHUeg/rzYYF1icxklc= Headers/GWP2P.h - z+OqKE12S658by3dE2WRiaJTBEU= + M7yDtyM42ylW+TUlmhIzAeQMm48= Headers/GWP2PClient+APMode.h - YWt9QyVQpV7H7yUIgxv9XF970ZQ= + iJ7AT1Qp/Bw+ohKngrlw7rzSZJk= Headers/GWP2PClient+Alarm.h - DJxIDvTazePmEIyx1zw3Slq4S4k= + gjdTj+8WL0bZiRGOy/uygkTrEWc= Headers/GWP2PClient+Defense.h @@ -30,7 +30,7 @@ Headers/GWP2PClient+DeviceInfomation.h - GbWYbr66mmA7NUaBI4U60Bj0h+c= + SSzr06APzjnAyW3Y1iPLmE1Y+6w= Headers/GWP2PClient+GarageLight.h @@ -38,7 +38,11 @@ Headers/GWP2PClient+HXVision.h - pOIg8MCG63LtQgHpcJ9AoCyFNcI= + 2k0pPJ4ONs1SiM8CK2Zm2cjMPXY= + + Headers/GWP2PClient+P2PInfo.h + + n42B5UHL38UlOr/1jvqrrzvDC7Y= Headers/GWP2PClient+PictureAndSound.h @@ -46,11 +50,11 @@ Headers/GWP2PClient+Record.h - qysAbglaNAte6kAvCsuJo2b1b8s= + Azon8Lg4aPzChgoQ/xWyNhraqa4= Headers/GWP2PClient+SceneMode.h - Hy2dYM269SmcX0k0DhF1dfsuiQ4= + pwlPuiVmuZhyMjlyGO2egM3C18s= Headers/GWP2PClient+Sensor.h @@ -62,19 +66,19 @@ Headers/GWP2PClient.h - wfW/FSLqnWLcNollxT+5k9p0xYI= + RYvGLk9NxfGf3yLt0TtgMvEw0so= Headers/GWP2PDefine.h - r9RrEnUXS7+K+O5UH0HbOWOqfOk= + g24ZOaJmFMf2CfVQnEcrhF1Wkag= Headers/GWP2PDevice.h - RgsP3k7cqDz9MKc/o+C6MkJ01ws= + G8/oP9uZevx53PoZD5T/9vzN/DQ= Headers/GWP2PDeviceLinker.h - 0JxhyxTXFCy6G9ANACOwexCritE= + ynGGxd+LY4crGQkTI1NLbdDMvpY= Headers/GWP2PLanDevice.h @@ -82,27 +86,27 @@ Headers/GWP2PPlaybackPlayer.h - iykJtuJYz3sGX/SbtOolvpf9tq8= + +blua7Uvw/zRvv9+evEuYFEBlgI= Headers/GWP2PPlayer.h - BVS74XH9oIh1SzC2yr6laNrGTzc= + l7uVOYTsc/CfKJPvCUkpkiL6xHE= Headers/GWP2PPlayerDefine.h - fcuQv9+oqRae0wAdcXWGDOAEFlw= + YTMpNTvqgumbSqfzU1FBvzK7xlI= Headers/GWP2PVideoPlayer.h - lOAShVbPkdpBQ+UijARKgf82rUc= + BngQ84XqDG3xpnszWomlx3Boh14= Headers/MD5Manager.h - AUNlmZF9J/diTQOhzm0T2eaVNZs= + 9Ap+BCQmV4CE/09z8spNS9mQ77k= Info.plist - qJVlMog86xUFYdTivMuZae3v5Rg= + qkxYKpNqiN/mYFQcmOoGghFUjrE= Modules/module.modulemap @@ -115,55 +119,55 @@ hash - N5pUkPs/Hy2Ho7CTNdJM9v0GRz0= + /D/h3V7xJHk/BcZAej7Qdp1XAW8= hash2 - G4QevGNQ/qXoUVMeBj8owHPjPvVVHniejAFYPsJxnj0= + oj8DULbME/XrojhVsH9vFLl1XLent2Sdu5x1p9A3MJ4= Headers/GWNetError.h hash - XuUZaxW3FCFUD7kCae84h1j4pZM= + 0j5ICqr7VpHUeg/rzYYF1icxklc= hash2 - ysqvbpkuGegIXAq56wPNE0OE5H9jUvX0N0v5Z/wnnqw= + f7p5ZveAo49m+rKPd5xZdSEjdg/XL4MVK4EdweRpoJ4= Headers/GWP2P.h hash - z+OqKE12S658by3dE2WRiaJTBEU= + M7yDtyM42ylW+TUlmhIzAeQMm48= hash2 - dCgEpTWpQ8DXxE5/SO4IMBr3pBGY7pJIvEmZLOvOZCs= + SYZLQZCuVeESvX/qZvtm5MMR6leqfds0aNxcMy42U/8= Headers/GWP2PClient+APMode.h hash - YWt9QyVQpV7H7yUIgxv9XF970ZQ= + iJ7AT1Qp/Bw+ohKngrlw7rzSZJk= hash2 - 82Tv12fHc/l4At8i/gM6aaO8JuxyvcrvETTgy+Afki4= + 95RdtJ4NUCKKza0FWvYaQwYbYXudPqsZbTrPabFm3MM= Headers/GWP2PClient+Alarm.h hash - DJxIDvTazePmEIyx1zw3Slq4S4k= + gjdTj+8WL0bZiRGOy/uygkTrEWc= hash2 - XBMvs4Zk38Q/FY/h+jWQwQSAAm9KbKFLW8LpZ/Bv+DM= + s6rg3KlpjqO4giyxE0OYvJG42+pnzuiyt/t8HJDHVco= Headers/GWP2PClient+Defense.h @@ -181,11 +185,11 @@ hash - GbWYbr66mmA7NUaBI4U60Bj0h+c= + SSzr06APzjnAyW3Y1iPLmE1Y+6w= hash2 - x9/09sgHeTyP+LND/0ilr94x7y+QbAA92lX28uhWEEY= + kCCqjTuSk925OtaiPmJv3+ygA+h1dCZd9MFMs4WkqlI= Headers/GWP2PClient+GarageLight.h @@ -203,11 +207,22 @@ hash - pOIg8MCG63LtQgHpcJ9AoCyFNcI= + 2k0pPJ4ONs1SiM8CK2Zm2cjMPXY= hash2 - oi/0YLKo9ylqnNiPKdGKCAX4UWJsGny8kdSl6PZhVWA= + szsx+L8ANdMidK8yGTAiWOH8H0JMW78QCzuq1bFnN/U= + + + Headers/GWP2PClient+P2PInfo.h + + hash + + n42B5UHL38UlOr/1jvqrrzvDC7Y= + + hash2 + + 7rb6qFMtccJKGXcJUgA6z7ZNL1JJMSvPpEHuIHiShCc= Headers/GWP2PClient+PictureAndSound.h @@ -225,22 +240,22 @@ hash - qysAbglaNAte6kAvCsuJo2b1b8s= + Azon8Lg4aPzChgoQ/xWyNhraqa4= hash2 - Fav1TFzUIHgOkvzrFrVy+OWRTO1K0TGy9Xqdoavpo24= + W7kyLABk/LawcZ+9ZpwnHbTKphiUJ75XMtZ0hs/Wjxg= Headers/GWP2PClient+SceneMode.h hash - Hy2dYM269SmcX0k0DhF1dfsuiQ4= + pwlPuiVmuZhyMjlyGO2egM3C18s= hash2 - 0dgzLlfhUDZTBxIkRFcZ/7FZZK6uSO9ia8H6ou2PiJk= + 8DrEWWnGtOANRPXQoDaQVpO3z7pQB9Bm/rRMZC+gJlM= Headers/GWP2PClient+Sensor.h @@ -269,44 +284,44 @@ hash - wfW/FSLqnWLcNollxT+5k9p0xYI= + RYvGLk9NxfGf3yLt0TtgMvEw0so= hash2 - OSfHL++HoGY8D/KgFmrpfvbWwxBdh0o3Tabc/tdLCRw= + CJI8BirmzaJFuN1ZFFikCr9zTkyOto5JRMYsYmi5Ntw= Headers/GWP2PDefine.h hash - r9RrEnUXS7+K+O5UH0HbOWOqfOk= + g24ZOaJmFMf2CfVQnEcrhF1Wkag= hash2 - Ob8/WyjnDAv6VByM99FsjKfTvFdZI0BZ2D613tzhiSM= + +n9MzXhkEcfqzTK2tIOGBhwYNLWz9tsDu/SvrJAuKPM= Headers/GWP2PDevice.h hash - RgsP3k7cqDz9MKc/o+C6MkJ01ws= + G8/oP9uZevx53PoZD5T/9vzN/DQ= hash2 - li6sGL0KHKeXgwn2DMy1d5sNaf5K4xI586VfMdVeFRk= + A4XIwRTo78MWLG8iwGYPjg849rPVbe6rhbPyh99oAhA= Headers/GWP2PDeviceLinker.h hash - 0JxhyxTXFCy6G9ANACOwexCritE= + ynGGxd+LY4crGQkTI1NLbdDMvpY= hash2 - GGQjb2C8KCwBno1XtmFdP0mELm8psWwvljEnt4vQRww= + s8Voc6sCJn8BjsAXJJDGUDnrxEFNvhVZRRiVWeYT5PA= Headers/GWP2PLanDevice.h @@ -324,55 +339,55 @@ hash - iykJtuJYz3sGX/SbtOolvpf9tq8= + +blua7Uvw/zRvv9+evEuYFEBlgI= hash2 - Jqb9K/MeeBrysIqt+gFWF+p54P41nwsM3dhu2NDc/BU= + fCbJW58v8fFL2guvsn6wZ1o9t7zRonmcvDXlRV80DXY= Headers/GWP2PPlayer.h hash - BVS74XH9oIh1SzC2yr6laNrGTzc= + l7uVOYTsc/CfKJPvCUkpkiL6xHE= hash2 - Knlii/rz3zOtRep6fo7zWwqJHfOVDok/waC4U3BMUNQ= + nujAzHkU1eAeqoJX41QIuENbJmNST46VskCKMksstFA= Headers/GWP2PPlayerDefine.h hash - fcuQv9+oqRae0wAdcXWGDOAEFlw= + YTMpNTvqgumbSqfzU1FBvzK7xlI= hash2 - Fnf+HHRAxj+8iepgneNvleh8DmPWWThZSDSLOctYFy8= + edkPjmBz3IjZ3K+48tWugH1KiIPqfbDzy2fJjabfmYQ= Headers/GWP2PVideoPlayer.h hash - lOAShVbPkdpBQ+UijARKgf82rUc= + BngQ84XqDG3xpnszWomlx3Boh14= hash2 - Otq4vl7WvvjiyuFaYsRLgvOpz0bS0SyFQzlZjqYl0Ec= + Ra6aFpCNNl/BwtNWr3IoZMEkpNG46c+/w9XhN6+jMMU= Headers/MD5Manager.h hash - AUNlmZF9J/diTQOhzm0T2eaVNZs= + 9Ap+BCQmV4CE/09z8spNS9mQ77k= hash2 - Y6AKHotGffuSL2JJvsdQ+xggWQ53jO07IwE2uckzWss= + Wncj1YD0K0JzELPMsoW+k1G4sC6LrnbwWY4Z1C0i/VI= Modules/module.modulemap @@ -389,7 +404,7 @@ rules - ^ + ^.* ^.*\.lproj/ @@ -420,11 +435,6 @@ weight 11 - ^ - - weight - 20 - ^(.*/)?\.DS_Store$ omit @@ -432,13 +442,6 @@ weight 2000 - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - ^.* ^.*\.lproj/ @@ -474,13 +477,6 @@ weight 20 - ^[^/]+$ - - nested - - weight - 10 - ^embedded\.provisionprofile$ weight diff --git a/Ifish/Info.plist b/Ifish/Info.plist index f07153a..98304cf 100644 --- a/Ifish/Info.plist +++ b/Ifish/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.9.8 + 4.9.9 CFBundleSignature ???? CFBundleURLTypes @@ -70,7 +70,7 @@ CFBundleVersion - 9.8.8 + 9.9.1 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/Ifish/Utinitys/dataUnity/dataContorl.m b/Ifish/Utinitys/dataUnity/dataContorl.m index 49f3f7b..ab92885 100644 --- a/Ifish/Utinitys/dataUnity/dataContorl.m +++ b/Ifish/Utinitys/dataUnity/dataContorl.m @@ -515,6 +515,8 @@ +(UserModel*)getUserInfo { UserModel*model=[[DataCenter defaultDtacenter]valueForKey:@"UserLogIn"]; + NSString *callId=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; + model.callId = callId; return model; } diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishKanKanListViewController.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishKanKanListViewController.m index c23903a..da3b10b 100644 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishKanKanListViewController.m +++ b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishKanKanListViewController.m @@ -12,7 +12,6 @@ #import "IfishKankanListModel.h" #import "LXAdScrollView.h" -#import "WoDeKanKanViewController.h" #define TABBAR_H self.tabBarController.tabBar.frame.size.height @@ -76,7 +75,6 @@ self.navigationItem.rightBarButtonItem = rightItem; [self creatUI]; [self creatReatRefreshView]; - //[self loadBannerData]; [self loadNewBannerData]; } @@ -127,42 +125,11 @@ -(void)pushMyKankan{ self.hidesBottomBarWhenPushed = YES; - // WoDeKanKanViewController *wodeKakanVC=[[WoDeKanKanViewController alloc] init]; MineKankanEditViewController *editVC = [[MineKankanEditViewController alloc] init]; _isPushEdit = YES; [self.navigationController pushViewController:editVC animated:YES]; } - -#pragma mark -v4.1 前 看看banner --(void)loadBannerData{ - __weak typeof (self)weskSelf=self; - [AFHttpTool getLiveBannerSuccess:^(id response) { - - NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil]; - if ([reDic[@"result"] isEqualToString:@"100"]){ - NSArray*bannerArr=reDic[@"data"]; - - for (NSDictionary *bannerDic in bannerArr) { - KanKanBanner *banner=[[KanKanBanner alloc] init]; - banner.appShow = bannerDic[@"appShow"]; - banner.bannerId = bannerDic[@"bannerId"]; - banner.bannerImg = bannerDic[@"bannerImg"]; - banner.bannerLink = bannerDic[@"bannerLink"]; - banner.bannerType = bannerDic[@"bannerType"]; - [_bannerImgArr addObject:banner.bannerImg]; - [_bannerArray addObject:banner]; - } - [weskSelf setingBannerViewData]; - } - - } failure:^(NSError *err) { - - NSLog(@"loadBannererr%@",err); - }]; - -} - #pragma mark -v4.1 后看看banner -(void)loadNewBannerData{ @@ -194,7 +161,6 @@ _tableView.delegate=self; _tableView.separatorStyle=UITableViewCellSeparatorStyleNone; _tableView.backgroundColor= TABLE_BACKGROUD_COLOR; - //_tableView.backgroundColor= [UIColor redColor]; UIView *footerView=[[UIView alloc] initWithFrame:CGRectMake(0,0, kScreenSize.width, 0.1)]; footerView.backgroundColor = [UIColor clearColor]; _tableView.tableFooterView = footerView; @@ -370,7 +336,7 @@ } - +//跳转进入直播详情页面 -(void)pushShareP2pView:(IfishKankanListModel *)listModel { KanHuListModel *kanHuCamera =[[KanHuListModel alloc] init]; diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishP2PLivePlayViewController.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishP2PLivePlayViewController.m index 8eabf38..6116e1f 100644 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishP2PLivePlayViewController.m +++ b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishLivelist/IfishP2PLivePlayViewController.m @@ -7,7 +7,6 @@ // #import "IfishP2PLivePlayViewController.h" -#import "IfishP2PVideoPlayView.h" @interface IfishP2PLivePlayViewController () @@ -53,20 +52,6 @@ [self.view bringSubviewToFront:self.subHbottomView]; } -//为用到 --(void)setupVideoPlayView{ - - IfishP2PVideoPlayView *playView=[IfishP2PVideoPlayView videoPlayView]; - playView.delegate=self; - // 播放器显示位置(竖屏时) - playView.frame = CGRectMake(0,64, self.view.bounds.size.width, self.view.bounds.size.width * 9 / 16); - - [self.view addSubview:playView]; - // 指定一个作为播放的控制器 - playView.contrainerViewController = self; - -} - - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; @@ -112,7 +97,6 @@ //聊天 -(void)chatBtnClickAction { - } #pragma mark- 暂停 挂断 @@ -125,9 +109,7 @@ while (self.isPlaying) { usleep(50*1000); } - [[P2PClient sharedClient] p2pHungUp]; - - self.remoteView.isQuitMonitorInterface = NO;//rtsp监控界面弹出修改 + [self.player p2pStop]; } } @@ -151,7 +133,6 @@ ///[self.remoteView getLastImgGoback]; [AppDelegate sharedDefault].canFullScreen = NO; - [self.remoteView releseromotViewSet]; [self.navigationController popViewControllerAnimated:YES]; diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.h b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.h deleted file mode 100644 index 5eeb389..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.h +++ /dev/null @@ -1,152 +0,0 @@ -// -// IfishP2PVideoPlayView.h -// Ifish -// -// Created by imac on 16/11/11. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import -#import "IfishCameraModel.h" -#import "ProgressImageView.h" -#import "OpenGLView.h" -#import "TouchButton.h" -#import -#import "CustomBorderButton.h" -#import "CustomView.h" -#define FocalLength_Elongation_btnTag 300 -#define FocalLength_Shorten_btnTag 301 -#define FocalLength_Change_sliderTag 302 - -//竖屏 -#define STOPBTN_TAG 1603227 -#define SOUND_BUTTON_H_TAG 1603221 -#define SWITCH_SCREEN_BUTTON_H_TAG 1603222 -#define DEFENCE_BUTTON_H_TAG 1603223 -#define TALK_BUTTON_H_TAG 1603224 -#define SCREENSHOT_BUTTON_H_TAG 1603225 -#define PROMPT_BUTTON_TAG 1603226 -#define SCREENSHOT_BUTTON_FLIE_TAG 1603228 - -#define VT_STOPBTN_TAG 1603229 - -#define DOOR_BELLALERT 1001001 -#define CAMERA_DEVICE_JIEBANG_ALERT 1001002 -#define XUANDUO_GUANSHUIBENG_ALERT 1001003 - -#define WEIJIHUO_ALERT 1001004 - -#define ALERT_TAG_UPDATE 1 -#import -#import "P2PClient.h" -//暂未完成 勿yong - -@protocol IfishP2PVideoPlayViewDelegate - --(void)btnClickToBackAction; - - -@end - -@interface IfishP2PVideoPlayView : UIView - - -{ - CGFloat _horizontalScreenH; - CGFloat _monitorInterfaceW;//rtsp监控界面弹出修改 - CGFloat _monitorInterfaceH;//rtsp监控界面弹出修改 - - UIButton* _btnDefence; - - BOOL _isPlaying; - BOOL _isOkFirstRenderVideoFrame;//YES表示第一次成功渲染图像 - BOOL _isOkRenderVideoFrame;//YES表示图像渲染出来了 - - BOOL _isCanAutoOrientation;//限制屏幕什么时候可以旋转 - - BOOL _isInItDevice; //是否连接设备 - BOOL _isStop;//是否暂停 用于区分是 暂停按钮 还是 连接失败按钮 - -} - - -+ (instancetype)videoPlayView; -@property (weak, nonatomic) IBOutlet UIView *canvasView; -@property (nonatomic,strong) IfishCameraModel *contact; -@property (weak, nonatomic) IBOutlet ProgressImageView *yProgressView; -@property (weak, nonatomic) IBOutlet UIButton *promptButton; -@property (weak, nonatomic) IBOutlet OpenGLView *remoteView; -@property (weak, nonatomic) IBOutlet UIView *midToolHView; - -@property(nonatomic,assign) id delegate; - -@property (nonatomic, weak) UIViewController *contrainerViewController; -@property (nonatomic) BOOL isReject; -@property (nonatomic) BOOL isShowControllerBar; -@property (nonatomic) BOOL isShowVToolBar; -@property (nonatomic) BOOL isVideoModeHD; - -@property (weak, nonatomic) IBOutlet UIButton *switchScreenButtonH; -@property (weak, nonatomic) IBOutlet UIButton *stopBtnH; - - - -@property (nonatomic) BOOL isFullScreen4B3; - -@property (nonatomic,strong) UIScrollView *scrollView;//监控界面缩放 -@property (nonatomic) BOOL isScale;//监控界面缩放 - -@property (strong, nonatomic) UIView *bottomView;//重新调整监控画面 -@property (strong, nonatomic) UIView *pressView; -@property (nonatomic) BOOL isTalking; - -@property (strong, nonatomic) UIView *controllerRight; -@property (strong, nonatomic) UIView *controllerRightBg;//重新调整监控画面 -@property (strong, nonatomic) UIView *bottomBarView;//重新调整监控画面 -@property (strong, nonatomic) UIView *controllBar; -@property (nonatomic) BOOL isAlreadyShowResolution;//重新调整监控画面 - -@property (nonatomic) BOOL isDefenceOn;//重新调整监控画面 - -//GPIO 口控制参数记录 -@property(strong, nonatomic) CustomBorderButton *customBorderButton; -@property(strong, nonatomic) CustomView *leftView; -@property(nonatomic) BOOL isShowLeftView; - -@property(nonatomic) int lastGroup; -@property(nonatomic) int lastPin; -@property(nonatomic) int lastValue; -@property(nonatomic) int *lastTime; - -@property(nonatomic, strong) UIButton *clickGPIO0_0Button; -@property(nonatomic, strong) UIButton *clickGPIO0_1Button; -@property(nonatomic, strong) UIButton *clickGPIO0_2Button; -@property(nonatomic, strong) UIButton *clickGPIO0_3Button; -@property(nonatomic, strong) UIButton *clickGPIO0_4Button; -@property(nonatomic, strong) UIButton *clickGPIO2_6Button; - -@property(nonatomic, strong) UIButton *lightButton; -@property (nonatomic) BOOL isLightSwitchOn; -@property (strong, nonatomic) UIActivityIndicatorView *progressView; -@property (nonatomic) BOOL isSupportLightSwitch; - - -//YES表示当前处于监控中,且接收到推送,点击观看监控 -@property (assign,nonatomic) BOOL isIntoMonitorFromMonitor; - - -@property (strong, nonatomic) UIView *focalLengthView; -@property (nonatomic) BOOL isSupportFocalLength; -@property (strong, nonatomic) UIPinchGestureRecognizer *pinchGestureRecognizer; - -//判断当前监控处于横屏还是竖屏界面 -@property (assign,nonatomic) BOOL isFullScreen; -@property (strong, nonatomic) UIView *fullScreenBgView; - - -@end diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.m deleted file mode 100644 index 05254b8..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.m +++ /dev/null @@ -1,934 +0,0 @@ -// -// IfishP2PVideoPlayView.m -// Ifish -// -// Created by imac on 16/11/11. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import "IfishP2PVideoPlayView.h" -#import "Utils.h" -#import "P2PClient.h" -#pragma mark - 监控竖屏时,各控件初始化 - -#define BOTTOM_BAR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0) - -#define PRESS_LAYOUT_WIDTH_AND_HEIGHT 38 - -#define CONTROLLER_BTN_COUNT 5 -#define PUBLIC_WIDTH_OR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0) -#define CONTROLLER_BTN_H_W (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 70.0:40.0) //布防、声音...高度宽度 -#define RESOLUTION_BTN_H (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 44.0:30.0) //分辨率按钮高度 - -#define CONTROLLER_RIGHT_ITEM_WIDTH 70 -#define CONTROLLER_RIGHT_ITEM_HEIGHT 40 -#define CONTROLLER_LEFT_ITEM_WIDTH 20 - -#define CONTROLLER_BTN_TAG_HUNGUP 0 -#define CONTROLLER_BTN_TAG_SOUND 1 -#define CONTROLLER_BTN_TAG_SCREENSHOT 2 -#define CONTROLLER_BTN_TAG_PRESS_TALK 3 -#define CONTROLLER_BTN_TAG_DEFENCE_LOCK 4 -#define CONTROLLER_BTN_TAG_HD 5 -#define CONTROLLER_BTN_TAG_SD 6 -#define CONTROLLER_BTN_TAG_LD 7 -#define CONTROLLER_BTN_TAG_RESOLUTION 8 -#define CONTROLLER_LABEL_TAG_HD 10 -#define CONTROLLER_LABEL_TAG_SD 11 -#define CONTROLLER_LABEL_TAG_LD 12 - -#define CONTROLLER_BTN_TAG_GPIO1_0 13 //lock - -#define LEFTVIEW_WIDTH (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 88:88) -#define LEFTVIEW_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 120:120) -#define CUSTOM_BORDER_BUTTON_WIDTH 20 -#define CUSTOM_BORDER_BUTTON_HEIGHT 45 -#define LEFT_BAR_BTN_WIDTH (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 90:60) -#define LEFT_BAR_BTN_MARGIN (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 15:10) - - - -#define LOADINGPRESSVIEW_WIDTH_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 50:80) - -@implementation IfishP2PVideoPlayView - - -// 快速创建View的方法 -+ (instancetype)videoPlayView -{ - return [[[NSBundle mainBundle] loadNibNamed:@"IfishP2PVideoPlayView" owner:nil options:nil] firstObject]; -} - - --(void)awakeFromNib{ - - [super awakeFromNib]; - - [self connectDevice]; - self.isShowControllerBar = YES; - self.isVideoModeHD = NO; - _isReject=YES; - _isStop = NO; - _isOkFirstRenderVideoFrame = YES; - - //监控竖屏时,各控件初始化(先) - [self initComponentForPortrait]; - //监控横屏时,各控件初始化(后) - [self initComponentForHorizontalScreen]; - [self cameraConnectSeting]; - -} - --(void)cameraConnectSeting{ - //rtsp监控界面弹出修改 - [self monitorP2PCall]; - //设置代理 - [[P2PClient sharedClient] setDelegate:self]; - [self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES]; - -} - -//rtsp监控界面弹出修改 - --(void)monitorP2PCall{ - - NSString *newPassword = GIWEI_INITPASS; - NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; - NSString *cameraId = @"3573889"; - - [[P2PClient sharedClient] p2pCallWithId:cameraId password:cameraPass callType:P2PCALL_TYPE_MONITOR]; - - // [[P2PClient sharedClient] p2pCallWithId:self.contact.cameraId password:self.contact.cameraPass callType:P2PCALL_TYPE_MONITOR]; - - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING]; - BOOL isBCalled = [[P2PClient sharedClient] isBCalled]; - P2PCallType type = [[P2PClient sharedClient] p2pCallType]; - NSString *callId = [[P2PClient sharedClient] callId]; - - if(!isBCalled){ - BOOL isApMode = ([[AppDelegate sharedDefault]dwApContactID] != 0); - if (!isApMode) - { - //[[P2PClient sharedClient] p2pCallWithId:callId password:self.contact.cameraPass callType:type]; - [[P2PClient sharedClient] p2pCallWithId:callId password:cameraPass callType:type]; - - } - else - { - //[[P2PClient sharedClient] p2pCallWithId:@"1" password:self.contact.cameraPass callType:type]; - [[P2PClient sharedClient] p2pCallWithId:@"1" password:cameraPass callType:type]; - - } - } - -} - --(void)initComponentForPortrait{ - - //视频监控连接中的背景图片 - NSString *filePath = [Utils getHeaderFilePathWithId:self.contact.cameraId]; - UIImage *headImg = [UIImage imageWithContentsOfFile:filePath]; - if(headImg==nil){ - headImg = LXImageWithImageName(@"ic_header.png"); - } - self.canvasView.layer.contents = (id)headImg.CGImage; - - _yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png"); - [_yProgressView start]; - - self.remoteView.delegate= self; - [self.remoteView.layer setMasksToBounds:YES]; - //_remoteView 添加点击手势现实和隐藏 midToolHView - UITapGestureRecognizer *appermidToolView=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSingleTap)]; - [appermidToolView setCancelsTouchesInView:YES]; - [appermidToolView setDelaysTouchesEnded:YES]; - [self.canvasView addGestureRecognizer:appermidToolView]; - -} - -#pragma mark - 监控横屏时,各控件初始化 --(void)initComponentForHorizontalScreen{ - - CGRect rect = [AppDelegate getScreenSize:NO isHorizontal:YES]; - CGFloat width = rect.size.width; - _monitorInterfaceW = width; - - CGFloat height = rect.size.height; - if(CURRENT_VERSION<7.0){ - height +=20; - } - _monitorInterfaceH = height; - _horizontalScreenH = height; - - // - - //横屏背景 - UIView *fullScreenBgView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, width, height)]; - fullScreenBgView.backgroundColor = XBlack; - self.fullScreenBgView = fullScreenBgView; - - - - - //进入横屏时,响应onDoubleTap - //退出横屏时,响应onDoubleTap 暂停 - UITapGestureRecognizer *doubleTapG = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onDoubleTap)]; - doubleTapG.delegate = self; - [doubleTapG setNumberOfTapsRequired:2]; - [self.remoteView addGestureRecognizer:doubleTapG]; - - - - //进入横屏时,响应onSingleTap - //退出横屏时,响应onSingleTap - UITapGestureRecognizer *singleTapG = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSingleTap)]; - singleTapG.delegate = self; - [singleTapG setNumberOfTapsRequired:1]; - [singleTapG requireGestureRecognizerToFail:doubleTapG]; - [self.remoteView addGestureRecognizer:singleTapG]; - - - - //进入横屏时,响应localLengthPinchToZoom - //退出横屏时,不响应localLengthPinchToZoom - NSString * plist = [[NSBundle mainBundle] pathForResource:@"Common-Configuration" ofType:@"plist"]; - NSDictionary * dic = [NSDictionary dictionaryWithContentsOfFile:plist]; - BOOL isSupportZoom = [dic[@"isSupportZoom"] boolValue]; - UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] init]; - if (!isSupportZoom) {//电子放大与焦距变倍不共存 - [_remoteView addGestureRecognizer:pinchGestureRecognizer]; - } - self.pinchGestureRecognizer = pinchGestureRecognizer; - - - - - //右边的画质图标 - //进入横屏时,显示 - //退出横屏时,隐藏 - int rightItemCount = 3; - //半透明背景 - UIView *controllerRightBg = [[UIView alloc] initWithFrame:CGRectMake(5.0, height, CONTROLLER_RIGHT_ITEM_WIDTH, CONTROLLER_RIGHT_ITEM_HEIGHT*rightItemCount)]; - controllerRightBg.layer.cornerRadius = 1.0f; - [controllerRightBg setAlpha:0.5]; - [controllerRightBg setBackgroundColor:XBlack]; - self.controllerRightBg = controllerRightBg; - [self addSubview:controllerRightBg]; - [self.controllerRightBg setHidden:YES]; - - - UIView *controllerRight = [[UIView alloc] initWithFrame:CGRectMake(5.0, height, CONTROLLER_RIGHT_ITEM_WIDTH, CONTROLLER_RIGHT_ITEM_HEIGHT*rightItemCount)]; - self.controllerRight = controllerRight; - [self addSubview:controllerRight]; - [self.controllerRight setHidden:YES]; - //分隔线 - for (int i=1; i < rightItemCount; i++) { - UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0.0, i*CONTROLLER_RIGHT_ITEM_HEIGHT+1.0*(i-1), CONTROLLER_RIGHT_ITEM_WIDTH, 1.0)]; - lineView.backgroundColor = XWhite; - [controllerRight addSubview:lineView]; - - } - - for(int i=0;i>>你可以看到画面了"]; - _isReject = NO; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [self renderView]; - }); - //[[PAIOUnit sharedUnit] setMuteAudio:YES]; - // [[PAIOUnit sharedUnit] setSpeckState:YES]; - -} - -#pragma mark - 开始渲染监控画面 - - -- (void)renderView -{ - _isPlaying = YES; - - /* GAVFrame * m_pAVFrame ; - - while (!self.isReject) - { - - NSLog(@" while 渲染监控画面"); - if(fgGetVideoFrameToDisplay(&m_pAVFrame)) - { - - if (!_isOkRenderVideoFrame) { - _isOkRenderVideoFrame = YES; - _isOkFirstRenderVideoFrame = YES; - dispatch_async(dispatch_get_main_queue(), ^{ - //隐藏监控连接中的UI - [self hiddenMonitoringUI:YES callErrorInfo:nil isReCall:NO]; - [self didHiddenMonitorUIWith:YES]; - - - }); - //设置默认高清 - [self setGaoQingHuoBiaoQing]; - - } - - [self.remoteView render:m_pAVFrame]; - vReleaseVideoFrame(); - } - usleep(10000); - } - - - _isPlaying = NO; - */ - -} - -#pragma mark - 设置标清或高清 -//由于要隐藏掉 画质选项卡 这里重写方法 设置视频默认高清 或标清 - --(void)setGaoQingHuoBiaoQing{ - BOOL is16B9 = [[P2PClient sharedClient] is16B9]; - BOOL is960P = [[P2PClient sharedClient] is960P]; - //右边的画质图标 - int rightItemCount = 0; - if(is16B9 || is960P){ - rightItemCount = 3; - }else{ - rightItemCount = 2; - } - - //设置高清 - if (rightItemCount==3) { - - [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:7]; - [self updateRightButtonState:CONTROLLER_BTN_TAG_HD]; - - }else if (rightItemCount == 2){ - - //设置标清 - - [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:5]; - [self updateRightButtonState:CONTROLLER_BTN_TAG_SD]; - } - -} - -#pragma mark - 设置高清、标清选中 --(void)updateRightButtonState:(NSInteger)tag{ - - for(UIView *view in self.controllerRight.subviews){ - UILabel *labelHD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_HD]; - if (labelHD) { - labelHD.textColor = XWhite; - } - UILabel *labelSD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_SD]; - if (labelSD) { - labelSD.textColor = XWhite; - } - UILabel *labelLD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_LD]; - if (labelLD) { - labelLD.textColor = XWhite; - } - } - UIButton *button = (UIButton*)[self.controllerRight viewWithTag:tag]; - - - //重新调整监控画面 - UIButton *rButton = (UIButton *)[self.bottomBarView viewWithTag:CONTROLLER_BTN_TAG_RESOLUTION]; - if (tag == CONTROLLER_BTN_TAG_HD) { - UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_HD]; - label.textColor = XBlue; - //[rButton setTitle:NSLocalizedString(@"HD", nil) forState:UIControlStateNormal]; - [rButton setTitle:NSLocalizedString(@"高清", nil) forState:UIControlStateNormal]; - }else if(tag == CONTROLLER_BTN_TAG_SD){ - UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_SD]; - label.textColor = XBlue; - [rButton setTitle:NSLocalizedString(@"标清", nil) forState:UIControlStateNormal]; - //[rButton setTitle:NSLocalizedString(@"SD", nil) forState:UIControlStateNormal]; - }else if (tag == CONTROLLER_BTN_TAG_LD){ - UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_LD]; - label.textColor = XBlue; - [rButton setTitle:NSLocalizedString(@"流畅", nil) forState:UIControlStateNormal]; - //[rButton setTitle:NSLocalizedString(@"LD", nil) forState:UIControlStateNormal]; - } - - [self didHiddenResolutionInterface]; -} - --(void)didHiddenResolutionInterface{ - [UIView animateWithDuration:0.2 animations:^{ - CGRect controllerRight = self.controllerRight.frame; - controllerRight.origin.y = _horizontalScreenH; - self.controllerRight.frame = controllerRight; - self.controllerRightBg.frame = controllerRight; - - } completion:^(BOOL finished) { - self.isAlreadyShowResolution = NO; - }]; -} - - -#pragma mark - 隐藏监控连接中的UI --(void)hiddenMonitoringUI:(BOOL)isHidden callErrorInfo:(NSDictionary*)info isReCall:(BOOL)isReCall{ - if (isHidden) { - [self.yProgressView stop]; - [self.yProgressView setHidden:YES]; - //连接不上原因文字 暂时不用 - // [self.labelTip setHidden:YES]; - - [self.promptButton setEnabled:NO]; - [self.promptButton setHidden:YES]; - - [self.stopBtnH setEnabled:YES]; - - }else{ - if (isReCall) { - - self.yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png"); - [self.yProgressView start]; - - // self.labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)]; - [self.promptButton setEnabled:NO]; - //self.stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png"); - [self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_stop_h.png") forState:UIControlStateNormal]; - - // 禁用 底部栏暂停按钮 - [self.stopBtnH setEnabled:NO]; - - - }else{ - - if (_isStop) { - //暂停 - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - //int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - // self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - //self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); - [self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_on_h.png") forState:UIControlStateNormal]; - - }else{ - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - //int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - //int errorFlag = CALL_ERROR_HANGUP ; - // self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - - [self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_on_h.png") forState:UIControlStateNormal]; - - } - - self.yProgressView.angle = 0.0f; - [self.yProgressView stop]; - - //int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - //self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - - [self.promptButton setEnabled:YES]; - [self.stopBtnH setEnabled:YES]; - - } - - [self.yProgressView setHidden:NO]; - - // [self.labelTip setHidden:NO]; - - [self.promptButton setHidden:NO]; - [self.canvasView bringSubviewToFront:self.promptButton]; - } -} - --(void)didHiddenMonitorUIWith:(BOOL)isAfterRender{ - if (!isAfterRender) { - - [self.controllerRightBg setAlpha:0.0]; - [self.controllerRight setAlpha:0.0]; - [self.bottomView setAlpha:0.0]; - [self.bottomBarView setAlpha:0.0]; - [self.customBorderButton setAlpha:0.0]; - [self.leftView setAlpha:0.0]; - [self.focalLengthView setAlpha:0.0]; - [self.pressView setAlpha:0.0]; - - - }else{ - [self.controllerRightBg setAlpha:0.5]; - [self.controllerRight setAlpha:1.0]; - [self.bottomView setAlpha:0.5]; - [self.bottomBarView setAlpha:1.0]; - [self.customBorderButton setAlpha:0.5]; - [self.leftView setAlpha:0.5]; - [self.focalLengthView setAlpha:1.0]; - [self.pressView setAlpha:1.0]; - } - -} - - -#pragma mark - 点击手势(单击) - - --(void)onSingleTap -{ - - -} - -#pragma mark - openGLViewDelegate - --(void)onScreenShotted:(UIImage*)image -{ - - -} - - -@end diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.xib b/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.xib deleted file mode 100644 index 88ada3e..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/IfishP2PPlayView/IfishP2PVideoPlayView.xib +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.h b/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.h deleted file mode 100644 index 784ca63..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// WoDeKanKanViewCell.h -// Ifish -// -// Created by imac on 16/11/9. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import - -@interface WoDeKanKanViewCell : UITableViewCell -@property (weak, nonatomic) IBOutlet UIButton *editBtn; - -@end diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.m deleted file mode 100644 index bf199cc..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// WoDeKanKanViewCell.m -// Ifish -// -// Created by imac on 16/11/9. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import "WoDeKanKanViewCell.h" - -@implementation WoDeKanKanViewCell - -- (void)awakeFromNib { - [super awakeFromNib]; - // Initialization code -} - -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { - [super setSelected:selected animated:animated]; - - // Configure the view for the selected state -} - -@end diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.xib b/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.xib deleted file mode 100644 index 3ffbdf8..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewCell.xib +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.h b/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.h deleted file mode 100644 index 3c85fcd..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// WoDeKanKanViewController.h -// Ifish -// -// Created by imac on 16/11/9. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import "BaseViewController.h" - -@interface WoDeKanKanViewController : BaseViewController - - - -@end diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.m b/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.m deleted file mode 100644 index 98ccd45..0000000 --- a/Ifish/controllers/IfishTabControllers/探索/IfishLive/MineKankan/WoDeKanKanViewController.m +++ /dev/null @@ -1,136 +0,0 @@ -// -// WoDeKanKanViewController.m -// Ifish -// -// Created by imac on 16/11/9. -// Copyright © 2016年 lianxiang. All rights reserved. -// - -#import "WoDeKanKanViewController.h" -#import "WoDeKanKanViewCell.h" -#import "MineKankanEditViewController.h" -@interface WoDeKanKanViewController () - -@property(nonatomic,strong)UITableView *tableView; - -@property(nonatomic,strong) NSMutableArray *dataArr; - - -@end - -@implementation WoDeKanKanViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // - [self addTitleViewWithTitle:@"我的看看"]; - [self creatTab]; - -} - --(void)creatTab{ - - self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height ) style:UITableViewStylePlain]; - - self.tableView.delegate = self; - self.tableView.dataSource = self; - self.tableView.scrollEnabled = YES; - self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - self.tableView.showsVerticalScrollIndicator = NO; - self.tableView.backgroundColor = TABLE_BACKGROUD_COLOR; - [self.view addSubview:self.tableView]; - - -} - -#pragma mark - Table view data source - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - - return 20; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - - return 1; - -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - WoDeKanKanViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WoDeKanKanViewCell"]; - if (!cell) { - - cell = [[[NSBundle mainBundle]loadNibNamed:@"WoDeKanKanViewCell" owner:self options:nil]lastObject]; - - } - - [cell.editBtn addTarget:self action:@selector(editBtnAction) forControlEvents:UIControlEventTouchUpInside]; - - return cell; - -} - --(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ - - if (section == 0) { - return 0; - - }else{ - return 20; - - } -} - --(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -{ - return kScreenSize.width*0.65; - -} - --(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ - UIView*view = nil; - - if (section!=0) { - - view= [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenSize.width, 20)]; - view.backgroundColor = RGB(242, 242, 242); - - } - - return view; - -} - --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - - --(void)editBtnAction{ - - - MineKankanEditViewController *editVC = [[MineKankanEditViewController alloc] init]; - - [self.navigationController pushViewController:editVC 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 diff --git a/Ifish/controllers/IfishTabControllers/探索/IfishNewShopsFlie/ShopGoods/ViewControlller/IFishVideoPalyViewController.m b/Ifish/controllers/IfishTabControllers/探索/IfishNewShopsFlie/ShopGoods/ViewControlller/IFishVideoPalyViewController.m index 26c4be6..6d8c540 100644 --- a/Ifish/controllers/IfishTabControllers/探索/IfishNewShopsFlie/ShopGoods/ViewControlller/IFishVideoPalyViewController.m +++ b/Ifish/controllers/IfishTabControllers/探索/IfishNewShopsFlie/ShopGoods/ViewControlller/IFishVideoPalyViewController.m @@ -23,7 +23,6 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. - //[self creatPalyer]; self.view.backgroundColor= [UIColor colorWithPatternImage:[UIImage imageNamed:@"enter_background"]]; //播放 [self.moviePlayer play]; diff --git a/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.h b/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.h index fac4fb6..3bf30ce 100644 --- a/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.h +++ b/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.h @@ -8,13 +8,12 @@ #import #import "TouchButton.h" -#import "OpenGLView.h" -#import "P2PClient.h" #import #import "CustomBorderButton.h" #import "CustomView.h" #import "ProgressImageView.h" #import "KanHuListModel.h" +#import //竖屏 #define STOPBTN_TAG 1603227 #define SOUND_BUTTON_H_TAG 1603221 @@ -34,14 +33,12 @@ @interface ShopKanHuP2PViewController : BaseViewController -@property (nonatomic, strong) OpenGLView *remoteView; +@property (nonatomic, strong) UIView *remoteView; @property (nonatomic,strong) KanHuListModel *kanHuCamera; @property (nonatomic) BOOL isPlaying; @property (nonatomic) BOOL isReject; @@ -64,7 +61,8 @@ @property (nonatomic) BOOL isAlreadyShowResolution;//重新调整监控画面 @property (nonatomic) BOOL isDefenceOn;//重新调整监控画面 - +//监控画面 +Strong GWP2PVideoPlayer *player; @property (assign,nonatomic) BOOL isFullScreen; @property (strong, nonatomic) UIView *fullScreenBgView; @@ -110,7 +108,6 @@ @property (assign,nonatomic) BOOL isIntoMonitorFromMonitor; //下半部生成报告部分 竖屏显示 全屏时,隐藏 -//@property (nonatomic,strong) KanHuBaoGaoView *baoGaoToolHView; @property (nonatomic,strong) UIView *HbootmView; @property (nonatomic,strong) NSDictionary*baGaoDic; @property (nonatomic,strong) NSArray *pinFenArray; diff --git a/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.m b/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.m index b408d08..f20e8a4 100644 --- a/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.m +++ b/Ifish/controllers/IfishTabControllers/探索/lookafterWorkbech/ShopKanHuP2PViewController.m @@ -8,49 +8,37 @@ #import "ShopKanHuP2PViewController.h" -//#import "PAIOUnit.h" #import "FListManager.h" #import "LookAfterReportViewController.h" - #import "Utils.h" #import "KanHuBaoGaoModel.h" -@interface ShopKanHuP2PViewController () +#import "P2pClient.h" +@interface ShopKanHuP2PViewController () { CGFloat _horizontalScreenH; CGFloat _monitorInterfaceW;//rtsp监控界面弹出修改 CGFloat _monitorInterfaceH;//rtsp监控界面弹出修改 - UIButton* _btnDefence; - - BOOL _isOkFirstRenderVideoFrame;//YES表示第一次成功渲染图像 - BOOL _isOkRenderVideoFrame;//YES表示图像渲染出来了 - BOOL _isCanAutoOrientation;//限制屏幕什么时候可以旋转 - BOOL _isInItDevice; //是否连接设备 + BOOL _connectDevice; //是否连接设备 BOOL _isStop;//是否暂停 用于区分是 暂停按钮 还是 连接失败按钮 int _OnLine; } - - @end @implementation ShopKanHuP2PViewController - (void)viewDidLoad { [super viewDidLoad]; - // self.title = @"看护"; self.isShowControllerBar = YES; self.isVideoModeHD = NO; _isReject=YES; _isStop = NO; - _isOkFirstRenderVideoFrame = YES; - [self addTitleViewWithTitle:@"看护"]; - [self connectDevice]; //监控竖屏时,各控件初始化(先) [self initComponentForPortrait]; @@ -65,145 +53,119 @@ -(void)goBackAction{ - //sleep(2); - if (_isOkRenderVideoFrame) { - - [self.remoteView getLastImgGoback]; + if ([self.player isPlaying]) { + [self.player p2pScreenshot:^(UIImage *screenshot, NSTimeInterval timeInterval) { + dispatch_async(dispatch_get_main_queue(), ^{ + UIImage *tempImage = [[UIImage alloc] initWithCGImage:screenshot.CGImage]; + NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(tempImage)]; + [Utils saveScreenshotFile:imgData]; + }); + }]; } - [self stopGLViewVideo]; + [self stopVideoPlayer]; [AppDelegate sharedDefault].canFullScreen = NO; - [self.remoteView releseromotViewSet]; [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - 初始化设备 p2pConnect -(void)connectDevice{ - - //LoginResult *loginResult = [UDManager getLoginInfo]; - //8225账号 - // NSString * P2PVerifyCode1 = @"1528438234"; - // NSString * P2PVerifyCode2 = @"992805759"; - // NSString *UserID = @"-2144354932"; - - UserModel *model=[[DataCenter defaultDtacenter] valueForKey:@"UserLogIn"]; + UserModel *model=[dataContorl getUserInfo]; NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; - - //初始化设备 - if (!_isInItDevice) { + if (!_connectDevice) { NSLog(@"正在初始化设备"); - _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2]; - - // _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:model.gwellUserID codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2]; - + _connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + NSString *newPassword = GIWEI_INITPASS; + NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; + [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.kanHuCamera.cameraId password:cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + // [self outputLog:dataDictionary success:success]; + //获取成功,打印设备信息,之后连接设备 + if (success) { + NSLog(@"观看直播连接设备信息:%@",dataDictionary); + } + }]; } - - - if(_isInItDevice){ - - NSLog(@"p2pConnect success. 成功 可以操作设备了"); - //成功 可以操作设备了 - usleep(600000); - [self startMonitor]; - - }else{//new added + if(!_connectDevice){//p2p连接失败 NSLog(@"p2pConnect failure.失败,不能操作设备"); - //[self connectDevice]; + [self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorTimeout isReCall:NO]; return; } - - } --(void)startMonitor{ - - if (_isReject&&_isInItDevice) { - NSLog(@"发送呼叫命令"); - - [[P2PClient sharedClient] setIsBCalled:NO]; - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING]; - - NSString *newPassword = GIWEI_INITPASS; - NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; - - - [[P2PClient sharedClient] p2pCallWithId:self.kanHuCamera.cameraId password:cameraPass callType:P2PCALL_TYPE_MONITOR]; - - - +#pragma mark --尝试连接摄像头 +-(void)monitorP2PCall{ + if ([self.player isPlaying]) {//如果已经连接,则不重复发出连接申请 + return; } - -} - -#pragma mark - 协议的实现 -- (void)P2PClientCalling:(nullable NSDictionary*)info{ - - NSLog(@"正在呼叫"); -} -- (void)P2PClientReject:(nullable NSDictionary*)info{ - - _isReject=YES; - _isOkRenderVideoFrame = NO; - NSLog(@"视频挂断"); - - //[self addLogs:@"视频挂断"]; - - while (_isPlaying) { - usleep(50*1000); + //p2p未连接 + if (!_connectDevice) { + [self connectDevice]; + if(_connectDevice){ + // 连接摄像头 + [self monitorP2PCall]; + } } - - - if (self.isIntoMonitorFromMonitor) { - self.isIntoMonitorFromMonitor = NO; - [self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES]; - // [self monitorP2PCall]; - }else{ - [self hiddenMonitoringUI:NO callErrorInfo:info isReCall:NO]; - } - - - -} -- (void)P2PClientAccept:(nullable NSDictionary*)info{ - - NSLog(@"接收数据"); -} -- (void)P2PClientReady:(nullable NSDictionary*)info{ - - NSLog(@"准备就绪"); - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_READY_P2P]; - - if([[P2PClient sharedClient] p2pCallType]==P2PCALL_TYPE_MONITOR){ - //连接就绪之后就开始启动渲染 - [self monitorStartRender]; - } -} -#pragma mark - 准备渲染监控界面 --(void)monitorStartRender{ - //[self addLogs:@"渲染>>>你可以看到画面了"]; - _isReject = NO; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [self renderView]; + WEAK_SELF; + NSString *newPassword = GIWEI_INITPASS; + NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; + dispatch_async(dispatch_get_global_queue(0, 0), ^{ + + [weakSelf.player p2pCallDeviceWithDeviceId:self.kanHuCamera.cameraId password:cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) { + //呼叫设备 + NSLog(@"[p2pCallDevice-Calling],paras=%@",parameters); + + } accept:^(NSDictionary *parameters) { + + NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters); + + } reject:^(GWP2PCallError error, NSString *errorCode) { + _isReject=YES; + NSLog(@"摄像头连接失败"); + dispatch_async(dispatch_get_main_queue(), ^{ + [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; + }); + + } ready:^{ + //呼叫成功操作 + NSLog(@"连接摄像头成功 当前所在线程为%@",[NSThread currentThread]); + //隐藏呼叫中的UI + dispatch_async(dispatch_get_main_queue(), ^{ + //隐藏旋转按钮 + [weakSelf hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; + // + [weakSelf didHiddenMonitorUIWith:YES]; + }); + } allowLAN:YES]; + + + }); -// [[PAIOUnit sharedUnit] setMuteAudio:YES]; -// [[PAIOUnit sharedUnit] setSpeckState:YES]; - +} +//摄像头播放回调 +#pragma mark - GWP2PPlayer代理回调测试 +- (void)p2pPlayer:(GWP2PPlayer *)player recieveGestureRecognizer:(UIGestureRecognizer *)gesture { + NSLog(@"-----delegate---recieveGestureRecognizer"); } +- (void)p2pVideoPlayer:(GWP2PVideoPlayer *)player numberOfAudiencesChange:(NSUInteger)currentNumber { + + NSLog(@"-----delegate---numberOfAudiencesChange"); + +} #pragma mark - OpenGLViewDelegate -//GLview 截屏 --(void)onScreenShotted:(UIImage *)image{ - - UIImage *tempImage = [[UIImage alloc] initWithCGImage:image.CGImage]; - //截屏图片有点大压缩上传 - UIImage *samallImage = [self scaleFromImage:tempImage toSize:CGSizeMake(kScreenSize.width, kScreenSize.width*0.56)]; - - self.imgData = [NSData dataWithData:UIImagePNGRepresentation(samallImage)]; - [Utils shopsSaveImageWithdata:self.imgData withCameraId:self.kanHuCamera.cameraId]; - - [self saveBaoGaoDataWith:self.imgData]; - +//截图按钮点击 +- (void)screenShot { + // WEAK_SELF; + //todo: 不停截图内存升高 + [self.player p2pScreenshot:^(UIImage *screenshot, NSTimeInterval timeInterval) { + dispatch_async(dispatch_get_main_queue(), ^{ + UIImage *tempImage = [[UIImage alloc] initWithCGImage:screenshot.CGImage]; + NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(tempImage)]; + [Utils saveScreenshotFile:imgData]; + [self.view makeToast:@"截图成功,请在图库中查看"]; + }); + }]; } - (UIImage *) scaleFromImage: (UIImage *) image toSize: (CGSize) size @@ -258,9 +220,9 @@ bgModel.shareImg = datadic[@"shareImg"]; - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { - [weakself stopGLViewVideo]; + [weakself stopVideoPlayer]; } [self.view hideToastActivity]; @@ -291,10 +253,6 @@ [super viewWillAppear:animated]; //屏幕长亮 [[ UIApplication sharedApplication] setIdleTimerDisabled:YES]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil]; - //在线人数监控 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receivePlayingMessage:) name:RECEIVE_PLAYING_CMD object:nil]; self.navigationController.navigationBarHidden = NO; _isCanAutoOrientation = YES; //设置默认竖屏 @@ -334,10 +292,6 @@ [self.scrollView setZoomScale:1.0]; } } - - [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_PLAYING_CMD object:nil]; - } @@ -351,201 +305,7 @@ #define GPIO0_3 13 #define GPIO0_4 14 #define GPIO2_6 15 -- (void)receiveRemoteMessage:(NSNotification *)notification{ - NSDictionary *parameter = [notification userInfo]; - int key = [[parameter valueForKey:@"key"] intValue]; - switch(key){ - case RET_GET_FOCUS_ZOOM: - { - int value = [[parameter valueForKey:@"value"] intValue]; - - if (value == 3) {//变倍变焦都有 - dispatch_async(dispatch_get_main_queue(), ^{ - self.isSupportFocalLength = YES; - [self.pinchGestureRecognizer addTarget:self action:@selector(localLengthPinchToZoom:)]; - }); - }else if (value == 2){//只有变焦 - dispatch_async(dispatch_get_main_queue(), ^{ - self.isSupportFocalLength = YES; - }); - - }else if (value == 1){//只有变倍 - dispatch_async(dispatch_get_main_queue(), ^{ - [self.pinchGestureRecognizer addTarget:self action:@selector(localLengthPinchToZoom:)]; - }); - - } - } - break; - case RET_SET_GPIO_CTL: - { - int result = [[parameter valueForKey:@"result"] intValue]; - - dispatch_async(dispatch_get_main_queue(), ^{ - self.clickGPIO0_0Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_1Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_2Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_3Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_4Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO2_6Button.backgroundColor = [UIColor clearColor]; - }); - if (result == 0) { - //设置成功 - dispatch_async(dispatch_get_main_queue(), ^{ - [self.view makeToast:NSLocalizedString(@"operator_success", nil)]; - }); - }else if (result == MESG_SET_GPIO_PERMISSION_DENIED){ - //该GPIO未开放 - dispatch_async(dispatch_get_main_queue(), ^{ - - [self.view makeToast:NSLocalizedString(@"not_open", nil)]; - }); - }else if (result == MESG_GPIO_CTRL_QUEUE_IS_FULL){ - //操作过于频繁,之前的操作未执行完 - dispatch_async(dispatch_get_main_queue(), ^{ - - [self.view makeToast:NSLocalizedString(@"too_frequent", nil)]; - }); - }else if(result == MESG_SET_DEVICE_NOT_SUPPORT){ - //设备不支持此操作 - dispatch_async(dispatch_get_main_queue(), ^{ - - [self.view makeToast:NSLocalizedString(@"not_support_operation", nil)]; - }); - } - } - break; - case RET_GET_LIGHT_SWITCH_STATE: - { - int result = [[parameter valueForKey:@"result"] intValue]; - - if (result == 0) { - int state = [[parameter valueForKey:@"state"] intValue]; - - dispatch_async(dispatch_get_main_queue(), ^{ - self.isSupportLightSwitch = YES; - if (state == 1) {//灯是开状态 - self.isLightSwitchOn = YES; - [self.lightButton setBackgroundImage:[UIImage imageNamed:@"lighton.png"] forState:UIControlStateNormal]; - }else{ - self.isLightSwitchOn = NO; - [self.lightButton setBackgroundImage:[UIImage imageNamed:@"lightoff.png"] forState:UIControlStateNormal]; - } - }); - } - } - break; - case RET_SET_LIGHT_SWITCH_STATE: - { - int result = [[parameter valueForKey:@"result"] intValue]; - - if (result == 0) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self.lightButton setHidden:NO]; - [self.progressView setHidden:YES]; - [self.progressView stopAnimating]; - if (self.isLightSwitchOn) {//灯正开着 - self.isLightSwitchOn = NO;//关灯 - [self.lightButton setBackgroundImage:[UIImage imageNamed:@"lightoff.png"] forState:UIControlStateNormal]; - }else{//灯正关着 - self.isLightSwitchOn = YES;//开灯 - [self.lightButton setBackgroundImage:[UIImage imageNamed:@"lighton.png"] forState:UIControlStateNormal]; - } - }); - } - } - break; - case RET_DEVICE_NOT_SUPPORT: - { - dispatch_async(dispatch_get_main_queue(), ^{ - self.clickGPIO0_0Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_1Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_2Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_3Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO0_4Button.backgroundColor = [UIColor clearColor]; - self.clickGPIO2_6Button.backgroundColor = [UIColor clearColor]; - - //[self.view makeToast:NSLocalizedString(@"device_not_support", nil)]; - }); - } - break; - case RET_GET_NPCSETTINGS_REMOTE_DEFENCE: - { - dispatch_async(dispatch_get_main_queue(), ^{ - NSInteger state = [[parameter valueForKey:@"state"] intValue]; - if(state==SETTING_VALUE_REMOTE_DEFENCE_STATE_ON) - { - //竖屏 - - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_on_h.png")forState:UIControlStateNormal]; - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_on_h_p.png") forState:UIControlStateHighlighted]; - //获取到布防状态,设置为可点且显示相应的图标 - self.defenceButtonH.enabled = YES; - - - self.isDefenceOn = YES; - - //横屏 - [_btnDefence setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_on.png") forState:UIControlStateNormal]; - } - else - { - //竖屏 - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_off_h.png") forState:UIControlStateNormal]; - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_off_h_p.png") forState:UIControlStateHighlighted]; - //获取到布防状态,设置为可点且显示相应的图标 - self.defenceButtonH.enabled = YES; - - - self.isDefenceOn = NO; - - //横屏 - [_btnDefence setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_off.png") forState:UIControlStateNormal]; - } - - if (_btnDefence.hidden == YES) { - _btnDefence.hidden = NO; - } - }); - } - break; - - case RET_SET_NPCSETTINGS_REMOTE_DEFENCE: - { - dispatch_async(dispatch_get_main_queue(), ^{ - NSInteger state = [[parameter valueForKey:@"state"] intValue]; - if(state==SETTING_VALUE_REMOTE_DEFENCE_STATE_ON){ - //竖屏 - // LXImageWithImageName(@"ic_ctl_lock_off.png") - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_on_h.png") forState:UIControlStateNormal]; - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_on_h_p.png") forState:UIControlStateHighlighted]; - - - self.isDefenceOn = YES; - - //横屏 - [_btnDefence setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_on.png") forState:UIControlStateNormal]; - }else{ - //竖屏 - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_off_h.png") forState:UIControlStateNormal]; - [self.defenceButtonH setImage:LXImageWithImageName(@"monitor_defence_off_h_p.png") forState:UIControlStateHighlighted]; - - - self.isDefenceOn = NO; - - //横屏 - [_btnDefence setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_off.png") forState:UIControlStateNormal]; - } - }); - } - break; - - - - } -} - -#pragma mark- 在线人数 +#pragma mark- 在线人数变化 -(void)receivePlayingMessage:(NSNotification *)notification { NSDictionary *parameter = [notification userInfo]; @@ -565,7 +325,7 @@ return; } - [self stopGLViewVideo]; + [self stopVideoPlayer]; [self alreadyHaveLookP]; @@ -587,32 +347,7 @@ #pragma mark - 改变焦距 -(void)btnClickToChangeFocalLength:(id)sender{ - UIView *view = (UIView *)sender; - if (view.tag == FocalLength_Elongation_btnTag) { - //焦距变长 - BYTE cmdData[5] = {0}; - cmdData[0] = 0x05; - fgSendUserData(9, 1, cmdData, sizeof(cmdData)); - }else if (view.tag == FocalLength_Shorten_btnTag){ - //焦距变短 - BYTE cmdData[5] = {0}; - cmdData[0] = 0x15; - fgSendUserData(9, 1, cmdData, sizeof(cmdData)); - }else{ - UISlider *focalLengthSlider = (UISlider *)view; - if (focalLengthSlider.value < 7.5) { - //焦距变长 - BYTE cmdData[5] = {0}; - cmdData[0] = 0x05; - fgSendUserData(9, 1, cmdData, sizeof(cmdData)); - }else{ - //焦距变短 - BYTE cmdData[5] = {0}; - cmdData[0] = 0x15; - fgSendUserData(9, 1, cmdData, sizeof(cmdData)); - } - focalLengthSlider.value = 7.5; - } + } #pragma mark - 焦距变倍 @@ -620,18 +355,6 @@ if (!self.isFullScreen) { return; } - - if([(UIPinchGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded) { - if ([(UIPinchGestureRecognizer*)sender scale] > 1.0) { - BYTE cmdData[5] = {0}; - cmdData[0] = 0x05; - fgSendUserData(9, 2, cmdData, sizeof(cmdData)); - }else{ - BYTE cmdData[5] = {0}; - cmdData[0] = 0x15; - fgSendUserData(9, 2, cmdData, sizeof(cmdData)); - } - } } //加tab 栏后新增 @@ -639,9 +362,7 @@ -(void)cameraConnectSeting{ //rtsp监控界面弹出修改 [self monitorP2PCall]; - //设置代理 - [[P2PClient sharedClient] setDelegate:self]; - [self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES]; + [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; } @@ -650,39 +371,6 @@ // Dispose of any resources that can be recreated. } - -#pragma mark - 监控开始渲染后,此处执行相关操作 --(void)doOperationsAfterMonitorStartRender{//rtsp监控界面弹出修改 - - /* - *1. 应该放在监控准备就绪之后(即渲染之后) - */ -// [[PAIOUnit sharedUnit] setMuteAudio:YES]; -// [[PAIOUnit sharedUnit] setSpeckState:YES]; - - - //放在渲染之后 - if([AppDelegate sharedDefault].isDoorBellAlarm){//门铃推送,点按开关说话 - self.isTalking = YES; - [self.pressView setHidden:NO]; - //[[PAIOUnit sharedUnit] setSpeckState:NO]; - }else{ - self.isTalking = NO; - [self.pressView setHidden:YES]; - // [[PAIOUnit sharedUnit] setSpeckState:YES]; - } - - NSString *callId = [[P2PClient sharedClient] callId]; - NSString *callPassword = [[P2PClient sharedClient] callPassword]; - [[P2PClient sharedClient]getDefenceState:callId password:callPassword]; - - - //判断设备是否支持变倍变焦(38) - [[P2PClient sharedClient] getNpcSettingsWithId:callId password:callPassword]; -} - - - #pragma mark - 监控竖屏时,各控件初始化 #define BOTTOM_BAR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0) @@ -725,43 +413,17 @@ #define LOADINGPRESSVIEW_WIDTH_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 50:80) -(void)initComponentForPortrait{ - //view的背景颜色 [self.view setBackgroundColor:COLOR_MIAN]; - //显示状态栏 [[UIApplication sharedApplication] setStatusBarHidden:NO]; - - //取得竖屏的rect CGRect rect = [AppDelegate getScreenSize:YES isHorizontal:NO]; CGFloat width = rect.size.width; - - CGFloat height = rect.size.height; - if(CURRENT_VERSION<7.0){ - height +=20; - } - - - //右侧下拉菜单 - -// UIButton*rightButton = [UIButton buttonWithType:UIButtonTypeCustom]; -// rightButton.frame = CGRectMake(0, 0, 60, 44); -// [rightButton setImage:[UIImage imageNamed:@"ifishnav_dropview_list"] forState:UIControlStateNormal]; -// [rightButton addTarget:self action:@selector(popAppear) forControlEvents:UIControlEventTouchUpInside]; -// self.rightPopButton = rightButton; -// [self.rightPopButton setImageEdgeInsets:UIEdgeInsetsMake(0, 30, 0, 0)]; -// -// UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:self.rightPopButton]; -// self.navigationItem.rightBarButtonItem = rightItem; - - - - //显示监控画面的载体canvasView CGFloat canvasView_h = [UIScreen mainScreen].bounds.size.width * 9/16; UIView *canvasView = [[UIView alloc] initWithFrame:CGRectMake(0, 64, width, canvasView_h)]; - canvasView.backgroundColor = [UIColor blackColor]; + canvasView.backgroundColor = [UIColor clearColor]; [self.view addSubview:canvasView]; self.canvasView = canvasView; self.canvasframe = canvasView.frame; @@ -773,7 +435,15 @@ headImg = LXImageWithImageName(@"ic_header.png"); } self.canvasView.layer.contents = (id)headImg.CGImage; + //添加播放器VC + self.player = [[GWP2PVideoPlayer alloc] init]; + self.player.delegate = self; + self.player.viewController.view.backgroundColor = [UIColor clearColor]; + [self.canvasView addSubview:self.player.viewController.view]; + [self addChildViewController:self.player.viewController]; + self.player.viewController.view.frame = RECT(0, 0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); + self.remoteView = self.player.viewController.view; //视频监控连接中或者连接失败的文字提示,以及旋转或者重连图片 UIButton *promptButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -783,14 +453,9 @@ [promptButton addTarget:self action:@selector(onVerticalBtnPress:) forControlEvents:UIControlEventTouchUpInside]; [self.canvasView addSubview:promptButton]; self.promptButton = promptButton; - //文字frame - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; - CGFloat labelTip_w = size.width+10.0; - CGFloat labelTip_h = size.height; //图片frame CGFloat progressView_wh = LOADINGPRESSVIEW_WIDTH_HEIGHT; - CGFloat progressView_y = (self.canvasView.frame.size.height-labelTip_h-progressView_wh)/2; + CGFloat progressView_y = (self.canvasView.frame.size.height-progressView_wh)/2; // 旋转或者重连图片 或者开始监控图片 ProgressImageView *progressView = [[ProgressImageView alloc] initWithFrame:CGRectMake((width-progressView_wh)/2, progressView_y, progressView_wh, progressView_wh)]; @@ -799,29 +464,6 @@ [progressView start]; self.yProgressView = progressView; - //视频监控连接中或者连接失败的文字提示 - UILabel* labelTip = [[UILabel alloc] initWithFrame:CGRectMake((width-labelTip_w)/2, progressView_y+progressView_wh, labelTip_w, labelTip_h)]; - labelTip.backgroundColor = [UIColor clearColor]; - labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)]; - labelTip.textAlignment = NSTextAlignmentCenter; - labelTip.font = XFontBold_16; - labelTip.textColor = XWhite; - //打开可以显示监控连接中或者连接失败的文字提示 - // [self.promptButton addSubview:labelTip]; - self.labelTip = labelTip; - - //显示监控的画布OpenGLView - - OpenGLView *glView = [[OpenGLView alloc] init]; - - - glView.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); - self.remoteView = glView; - self.remoteView.delegate = self; - [self.remoteView.layer setMasksToBounds:YES]; - [self.canvasView addSubview:self.remoteView]; - - //、横屏工具栏 CGFloat midtH=self.canvasView.frame.size.height/5; @@ -848,11 +490,11 @@ [self.midToolHView addSubview:self.stopBtnH]; //暂停按钮图片 UIImage *stopImageH = LXImageWithImageName(@"monitor_stop_h"); - //self.stopImageViewH = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, (self.stopBtnH.frame.size.height-stopImageH.size.height/SCREEN_SCALE)/2, stopImageH.size.width/SCREEN_SCALE, stopImageH.size.height/SCREEN_SCALE)]; self.stopImageViewH = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, midtH/2, midtH/2)]; self.stopImageViewH.contentMode = UIViewContentModeScaleToFill; self.stopImageViewH.image = stopImageH; + self.stopImageViewH.tag = 10; [self.stopBtnH addSubview:self.stopImageViewH]; @@ -907,9 +549,8 @@ [self.view makeToastActivity]; - //截屏 - [self.remoteView setIsScreenShotting:YES]; - // UIImage *image=[Utils shopsGetImgeWithCameraId:self.kanHuCamera.cameraId]; + + [self screenShot]; UserModel*umodel=[[DataCenter defaultDtacenter]valueForKey:@"UserLogIn"]; NSDictionary*para=@{ @"userId":umodel.userId, @@ -1337,42 +978,19 @@ while (_isPlaying) { usleep(50*1000); } - [[P2PClient sharedClient] p2pHungUp]; - - self.remoteView.isQuitMonitorInterface = YES;//rtsp监控界面弹出修改 + [self.player p2pStop]; } - //[self dismissViewControllerAnimated:YES completion:nil]; } break; case CONTROLLER_BTN_TAG_SOUND: { - //BOOL isMute = [[PAIOUnit sharedUnit] muteAudio]; - - - DLog(@"onControllerBtnPress:CONTROLLER_BTN_TAG_SOUND"); - // if(isMute){ - // [[PAIOUnit sharedUnit] setMuteAudio:NO]; - // [sender setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_sound_on.png"] forState:UIControlStateNormal]; - // //竖屏,声音打开 - // UIButton *soundButtonH = (UIButton *)[self.midToolHView viewWithTag:SOUND_BUTTON_H_TAG]; - // UIImageView *soundImageViewH = (UIImageView *)soundButtonH.subviews[0]; - // soundImageViewH.image = [UIImage imageNamed:@"monitor_sound_on_h.png"]; - // }else{ - // - // [[PAIOUnit sharedUnit] setMuteAudio:YES]; - // [sender setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_sound_off.png"] forState:UIControlStateNormal]; - // //竖屏,声音关闭 - // UIButton *soundButtonH = (UIButton *)[self.midToolHView viewWithTag:SOUND_BUTTON_H_TAG]; - // UIImageView *soundImageViewH = (UIImageView *)soundButtonH.subviews[0]; - // soundImageViewH.image = [UIImage imageNamed:@"monitor_sound_off_h.png"]; - // } } break; case CONTROLLER_BTN_TAG_SCREENSHOT: { - [self.remoteView setIsScreenShotting:YES]; + [self screenShot]; } break; case CONTROLLER_BTN_TAG_GPIO1_0: @@ -1396,7 +1014,6 @@ self.isTalking = NO; [self.pressView setHidden:YES]; - //[[PAIOUnit sharedUnit] setSpeckState:YES]; }else{ UIButton *talkButtonH = (UIButton *)[self.bottomToolHView viewWithTag:TALK_BUTTON_H_TAG]; //竖屏,对讲打开 @@ -1406,16 +1023,16 @@ self.isTalking = YES; [self.pressView setHidden:NO]; - //[[PAIOUnit sharedUnit] setSpeckState:NO]; } } break; case CONTROLLER_BTN_TAG_DEFENCE_LOCK://重新调整监控画面 { - NSString *contactId = [[P2PClient sharedClient] callId]; - NSString *contactPassword = [[P2PClient sharedClient] callPassword]; - + + NSString *contactId = [[P2PClient sharedClient] contactId]; + NSString *contactPassword = [[P2PClient sharedClient] password]; if (self.isDefenceOn) { + [[P2PClient sharedClient] setRemoteDefenceWithId:contactId password:contactPassword state:SETTING_VALUE_REMOTE_DEFENCE_STATE_OFF]; }else{ [[P2PClient sharedClient] setRemoteDefenceWithId:contactId password:contactPassword state:SETTING_VALUE_REMOTE_DEFENCE_STATE_ON]; @@ -1424,20 +1041,20 @@ break; case CONTROLLER_BTN_TAG_HD: { - [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:7]; + [self.player p2pSetDefinition:GWP2PPTZDefinitionHD]; [self updateRightButtonState:CONTROLLER_BTN_TAG_HD]; } break; case CONTROLLER_BTN_TAG_SD: { - [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:5]; + [self.player p2pSetDefinition:GWP2PPTZDefinitionSD]; [self updateRightButtonState:CONTROLLER_BTN_TAG_SD]; } break; case CONTROLLER_BTN_TAG_LD: { - [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:6]; + [self.player p2pSetDefinition:GWP2PPTZDefinitionLD]; [self updateRightButtonState:CONTROLLER_BTN_TAG_LD]; } break; @@ -1532,42 +1149,22 @@ switch(button.tag){ case SOUND_BUTTON_H_TAG://声音 { - if (!_isOkRenderVideoFrame) { + if (![self.player isPlaying]) { //图像渲染出来前,不可以控制声音 return; } - -// UIImageView *soundImageViewH = (UIImageView *)button.subviews[0]; -// BOOL isMute = [[PAIOUnit sharedUnit] muteAudio]; -// if(isMute){ -// [[PAIOUnit sharedUnit] setMuteAudio:NO]; -// //LXImageWithImageName(@"ic_ctl_new_sound_off.png"); -// soundImageViewH.image = LXImageWithImageName(@"monitor_sound_on_h.png"); -// //横屏,声音打开 -// UIButton *controllerSoundBtn = (UIButton *)[self.controllBar viewWithTag:CONTROLLER_BTN_TAG_SOUND]; -// [controllerSoundBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_sound_on.png") forState:UIControlStateNormal]; -// }else{ -// -// [[PAIOUnit sharedUnit] setMuteAudio:YES]; -// soundImageViewH.image = LXImageWithImageName(@"monitor_sound_off_.png"); -// //横屏,声音关闭 -// UIButton *controllerSoundBtn = (UIButton *)[self.controllBar viewWithTag:CONTROLLER_BTN_TAG_SOUND]; -// [controllerSoundBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_sound_off.png") forState:UIControlStateNormal]; -// } } break; case SWITCH_SCREEN_BUTTON_H_TAG://切换至横屏或者竖屏 { - if (!_isOkFirstRenderVideoFrame) { + if (![self.player isPlaying]) { //第一次成功渲染图像前,不可以切换至横屏 return; } if (!self.isFullScreen) { - - //设置横屏 [AppDelegate sharedDefault].canFullScreen = YES; static int isFullScreen = 3; // 3 == 全屏 1 == 竖屏 @@ -1691,12 +1288,12 @@ break; case SCREENSHOT_BUTTON_H_TAG://载图 { - [self.remoteView setIsScreenShotting:YES]; + [self screenShot]; } break; case PROMPT_BUTTON_TAG://重新连接监控 { - [self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES]; + [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; [self monitorP2PCall]; } @@ -1705,30 +1302,24 @@ //暂停按钮 case STOPBTN_TAG: { - - - - UIImageView *stopImageViewH = (UIImageView *)button.subviews[0]; - - if(!_isOkRenderVideoFrame){ - - - [self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES]; + //获取暂停按钮图 + UIImageView *stopImageViewH = (UIImageView *)[button viewWithTag:10]; + //暂停结束,继续播放视频 + if(![self.player isPlaying]){ + _isStop = NO; + [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; [self monitorP2PCall]; stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png"); - + //横屏,声音打开 }else{ - - [self stopGLViewVideo]; + _isStop = YES;//点击暂停 + [self stopVideoPlayer]; + [self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorNone isReCall:NO]; stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); + //横屏,声音关闭 } - - } break; - - - } } @@ -1907,7 +1498,7 @@ // _isStop = YES; // } // -// [self stopGLViewVideo]; +// [self stopVideoPlayer]; return; @@ -1957,28 +1548,17 @@ #pragma mark- 暂停 挂断 --(void)stopGLViewVideo{ - if(!self.isReject){ - - self.isReject = !self.isReject; - while (_isPlaying) { - usleep(50*1000); - } - [[P2PClient sharedClient] p2pHungUp]; - - self.remoteView.isQuitMonitorInterface = NO;//rtsp监控界面弹出修改 +-(void)stopVideoPlayer{ + if ([self.player isPlaying]) { + [self.player p2pStop]; } - } #pragma mark - 隐藏监控连接中的UI --(void)hiddenMonitoringUI:(BOOL)isHidden callErrorInfo:(NSDictionary*)info isReCall:(BOOL)isReCall{ +-(void)hiddenMonitoringUI:(BOOL)isHidden callWithErrorType:(GWP2PCallError)errorType isReCall:(BOOL)isReCall{ if (isHidden) { [self.yProgressView stop]; [self.yProgressView setHidden:YES]; - - [self.labelTip setHidden:YES]; - [self.promptButton setEnabled:NO]; [self.promptButton setHidden:YES]; @@ -1989,132 +1569,121 @@ self.yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png"); [self.yProgressView start]; - - self.labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)]; [self.promptButton setEnabled:NO]; self.stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png"); // 禁用 底部栏暂停按钮 [self.stopBtnH setEnabled:NO]; - }else{ - if (_isStop) { - //暂停 - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); - - - }else{ - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - //int errorFlag = CALL_ERROR_HANGUP ; - self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - - self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); - - } - + self.yProgressView.angle = 0.0f; + self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); + self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); self.yProgressView.angle = 0.0f; [self.yProgressView stop]; - - int errorFlag = [[info objectForKey:@"errorFlag"] intValue]; - self.labelTip.text = [self getCallErrorStringWith:errorFlag]; - [self.promptButton setEnabled:YES]; [self.stopBtnH setEnabled:YES]; } - [self.yProgressView setHidden:NO]; - - [self.labelTip setHidden:NO]; - [self.promptButton setHidden:NO]; [self.canvasView bringSubviewToFront:self.promptButton]; } } - --(NSString *)getCallErrorStringWith:(int)errorFlag{ - switch(errorFlag) +/* + GWP2PCallErrorNone = 0, //0无原因 + GWP2PCallErrorDesidNotEnable, //1对方的ID 被禁用 + GWP2PCallErrorDesidOverDate, //2对方的ID 过期了 + GWP2PCallErrorDesidNotAcitve, //3对方的ID 尚未激活 + GWP2PCallErrorDesidOffline, //4对方离线 + GWP2PCallErrorDesidBusy, //5对方忙线中 + GWP2PCallErrorDesidPowerDown, //6对方已关机 + GWP2PCallErrorNoHelper, //7没有找到协助人 + GWP2PCallErrorHangUp, //8对方已经挂断 + GWP2PCallErrorTimeout, //9连接超时 + GWP2PCallErrorInterError, //10内部错误 + GWP2PCallErrorRingTimeout, //11无人接听 + GWP2PCallErrorPwdWrong, //12密码错误(在远程监控时用到密码,在视频通话是不需要) + GWP2PCallErrorConnFail, + GWP2PCallErrorNotSupport, + */ +-(NSString *)getCallErrorStringWithErrorType:(GWP2PCallError)errorType{ + + switch((int)errorType) { - case CALL_ERROR_NONE: + case GWP2PCallErrorNone: { return NSLocalizedString(@"id_unknown_error", nil); } break; - case CALL_ERROR_DESID_NOT_ENABLE: + case GWP2PCallErrorDesidNotEnable: { return NSLocalizedString(@"id_disabled", nil); } break; - case CALL_ERROR_DESID_OVERDATE: + case GWP2PCallErrorDesidOverDate: { return NSLocalizedString(@"id_overdate", nil); } break; - case CALL_ERROR_DESID_NOT_ACTIVE: + case GWP2PCallErrorDesidNotAcitve: { return NSLocalizedString(@"id_inactived", nil); } break; - case CALL_ERROR_DESID_OFFLINE: + case GWP2PCallErrorDesidOffline: { return NSLocalizedString(@"id_offline", nil); } break; - case CALL_ERROR_DESID_BUSY: + case GWP2PCallErrorDesidBusy: { return NSLocalizedString(@"id_busy", nil); } break; - case CALL_ERROR_DESID_POWERDOWN: + case GWP2PCallErrorDesidPowerDown: { return NSLocalizedString(@"id_powerdown", nil); } break; - case CALL_ERROR_NO_HELPER: + case GWP2PCallErrorNoHelper: { return NSLocalizedString(@"id_connect_failed", nil); } break; - case CALL_ERROR_HANGUP: + case GWP2PCallErrorHangUp: { return NSLocalizedString(@"id_hangup", nil); break; } - case CALL_ERROR_TIMEOUT: + case GWP2PCallErrorTimeout: { return NSLocalizedString(@"id_timeout", nil); } break; - case CALL_ERROR_INTER_ERROR: + case GWP2PCallErrorInterError: { return NSLocalizedString(@"id_internal_error", nil); } break; - case CALL_ERROR_RING_TIMEOUT: + case GWP2PCallErrorRingTimeout: { return NSLocalizedString(@"id_no_accept", nil); } break; - case CALL_ERROR_PW_WRONG: + case GWP2PCallErrorPwdWrong: { return NSLocalizedString(@"id_password_error", nil); } break; - case CALL_ERROR_CONN_FAIL: + case GWP2PCallErrorConnFail: { return NSLocalizedString(@"id_connect_failed", nil); } break; - case CALL_ERROR_NOT_SUPPORT: + case GWP2PCallErrorNotSupport: { return NSLocalizedString(@"id_not_support", nil); } @@ -2126,8 +1695,6 @@ break; } } - - -(void)didHiddenMonitorUIWith:(BOOL)isAfterRender{ if (!isAfterRender) { @@ -2151,77 +1718,6 @@ } } - --(void)monitorP2PCall{ - - - NSString *newPassword = GIWEI_INITPASS; - NSString *cameraPass = [Utils GetTreatedPassword:newPassword]; - - [[P2PClient sharedClient] p2pCallWithId:self.kanHuCamera.cameraId password:cameraPass callType:P2PCALL_TYPE_MONITOR]; - - - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING]; - BOOL isBCalled = [[P2PClient sharedClient] isBCalled]; - P2PCallType type = [[P2PClient sharedClient] p2pCallType]; - NSString *callId = [[P2PClient sharedClient] callId]; - //NSString *callPassword = [[P2PClient sharedClient] callPassword]; - - if(!isBCalled){ - BOOL isApMode = ([[AppDelegate sharedDefault]dwApContactID] != 0); - if (!isApMode) - { - [[P2PClient sharedClient] p2pCallWithId:callId password:cameraPass callType:type]; - } - else - { - [[P2PClient sharedClient] p2pCallWithId:@"1" password:cameraPass callType:type]; - } - } - -} - -#pragma mark - 开始渲染监控画面 - - -- (void)renderView -{ - _isPlaying = YES; - - GAVFrame * m_pAVFrame ; - - while (!self.isReject) - { - - //NSLog(@"ShopKanHuP2PViewController while 渲染监控画面"); - if(fgGetVideoFrameToDisplay(&m_pAVFrame)) - { - if (!_isOkRenderVideoFrame) { - _isOkRenderVideoFrame = YES; - _isOkFirstRenderVideoFrame = YES; - dispatch_async(dispatch_get_main_queue(), ^{ - //隐藏监控连接中的UI - [self hiddenMonitoringUI:YES callErrorInfo:nil isReCall:NO]; - [self didHiddenMonitorUIWith:YES]; - }); - - //设置默认高清 - [self setGaoQingHuoBiaoQing]; - - } - - [self.remoteView render:m_pAVFrame]; - vReleaseVideoFrame(); - } - usleep(10000); - } - - - _isPlaying = NO; - - -} - #pragma mark - 竖屏时,显示状态栏 -(BOOL)prefersStatusBarHidden @@ -2327,7 +1823,8 @@ //进入竖屏时,调整frame self.canvasView.frame = self.canvasframe; //视频监控连接中的背景图片 - NSString *filePath = [Utils getHeaderFilePathWithId:[[P2PClient sharedClient] callId]]; + UserModel *model=[dataContorl getUserInfo]; + NSString *filePath = [Utils getHeaderFilePathWithId:model.callId]; UIImage *headImg = [UIImage imageWithContentsOfFile:filePath]; if(headImg==nil){ headImg = [UIImage imageNamed:@"ic_header.png"]; @@ -2362,15 +1859,9 @@ self.promptButton.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); //上面的canvasView重新add了remoteView [self.canvasView bringSubviewToFront:self.promptButton]; - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; //旋转图片 - CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT; + CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT; self.yProgressView.frame = CGRectMake((self.canvasView.frame.size.width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (self.canvasView.frame.size.height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); - //文字 - self.labelTip.frame = CGRectMake((self.canvasView.frame.size.width-size.width)/2, CGRectGetMaxY(self.yProgressView.frame), size.width+10.0, size.height); - - //左边的按住说话弹出的声音图标 //退出横屏时,调整frame self.pressView.frame = CGRectMake(10, self.canvasframe.size.height+NAVIGATION_BAR_HEIGHT-PRESS_LAYOUT_WIDTH_AND_HEIGHT, PRESS_LAYOUT_WIDTH_AND_HEIGHT/2, PRESS_LAYOUT_WIDTH_AND_HEIGHT); @@ -2424,15 +1915,9 @@ //视频监控连接中的文字提示,以及旋转 //进入横屏时,调整frame self.promptButton.frame = self.canvasView.frame; - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; //旋转图片 - CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT; - self.yProgressView.frame = CGRectMake((width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); - //文字 - self.labelTip.frame = CGRectMake((width-size.width)/2, CGRectGetMaxY(self.yProgressView.frame), size.width+10.0, size.height); - - + CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT; + self.yProgressView.frame = CGRectMake((width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (height)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); //进入横屏,修改remoteView的frame BOOL is16B9 = [[P2PClient sharedClient] is16B9]; if(is16B9){ @@ -2494,10 +1979,6 @@ //进入横屏时,调整frame self.pressView.frame = CGRectMake(10, height-PRESS_LAYOUT_WIDTH_AND_HEIGHT-BOTTOM_BAR_HEIGHT, PRESS_LAYOUT_WIDTH_AND_HEIGHT/2, PRESS_LAYOUT_WIDTH_AND_HEIGHT); - - //设置高清 或标清 - // [self setGaoQingHuoBiaoQing]; - //设置横屏底部工具栏3秒隐藏 [self hideBootommViewAfterSecondes]; diff --git a/Ifish/controllers/IfishTabControllers/消息/IfishMessageViewController.m b/Ifish/controllers/IfishTabControllers/消息/IfishMessageViewController.m index 6b4dc6d..4a4d4a0 100644 --- a/Ifish/controllers/IfishTabControllers/消息/IfishMessageViewController.m +++ b/Ifish/controllers/IfishTabControllers/消息/IfishMessageViewController.m @@ -73,6 +73,7 @@ extern BOOL launchedByNotification; [self.rightButton addTarget:self action:@selector(rightBtnClick:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.tableView]; [self.view addSubview:self.comboxView]; + [self.comboxView loadInfoWithTitle:@[@"删除"] Icons:@[@"ifishdropview_delect_device"]]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.view); }]; @@ -123,10 +124,6 @@ extern BOOL launchedByNotification; -(MessageAlertView *)comboxView{ if (!_comboxView) { _comboxView = [[MessageAlertView alloc]initWithFrame:RECT(screen_width - kSizeFrom750(220), 0, kSizeFrom750(220), kSizeFrom750(90))]; - _comboxView.transform = CGAffineTransformScale(self.comboxView.transform,0.01,0.01); - _comboxView.layer.position = CGPointMake(screen_width - kSizeFrom750(220)/2, 0); - _comboxView.layer.anchorPoint = CGPointMake(0.5, 0); - _comboxView.hidden = YES; WEAK_SELF; //点击删除 _comboxView.comboxBlock = ^(NSInteger tag) { diff --git a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m index f971093..3a76662 100644 --- a/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m +++ b/Ifish/controllers/IfishTabControllers/设备/IfishDeviceSelectList/IfishBindDeviceSelectViewController.m @@ -210,13 +210,9 @@ extern BOOL isfromCameraView; -(void)loginGewellWith:(UserModel *)model { - NSString *accountId =[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; - if ([accountId isEqualToString:@"0"]) { - [self.view makeToast:@"暂未检测到设备"]; - return; } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.h b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.h index 720e8ec..1162374 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.h +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.h @@ -51,18 +51,15 @@ @interface IfishP2PMonitorController : UIViewController< AVCaptureVideoDataOutputSampleBufferDelegate,UIGestureRecognizerDelegate,TouchButtonDelegate,UIScrollViewDelegate,UIAlertViewDelegate,MonitorBottomCollcetionSelectDelegate,LxPopViewDelegate,CameraBottomHViewDelegate,IfishSegmentViewDelegate> -//@property (nonatomic, strong) OpenGLView *remoteView; @property (nonatomic, strong) GWP2PVideoPlayer *player;//摄像头页面 @property (nonatomic) BOOL isReject; @property (nonatomic) BOOL isFullScreen4B3; @property (nonatomic) BOOL isShowControllerBar; @property (nonatomic) BOOL isShowVToolBar; @property (nonatomic) BOOL isVideoModeHD; -//@property (strong, nonatomic) MBProgressHUD *progressAlert; @property (nonatomic,strong) IfishCameraModel *contact; @property (nonatomic,strong) UIScrollView *scrollView;//监控界面缩放 @property (nonatomic) BOOL isScale;//监控界面缩放 - @property (strong, nonatomic) UIView *bottomView;//重新调整监控画面 @property (strong, nonatomic) UIView *pressView; @property (nonatomic) BOOL isTalking; @@ -113,7 +110,6 @@ @property (nonatomic,strong) UIView *canvasView; //显示监控画面的载体 @property (assign,nonatomic) CGRect canvasframe; @property (nonatomic,strong) UIButton *promptButton; -@property (nonatomic,strong) UILabel *labelTip; @property (strong, nonatomic) ProgressImageView *yProgressView; @property (nonatomic,strong) UIView *midToolHView; //全屏时,隐藏 @property (nonatomic,strong) CameraBottomHView *bottomToolHView; //全屏时,隐藏 @@ -121,13 +117,7 @@ //YES表示当前处于监控中,且接收到推送,点击观看监控 @property (assign,nonatomic) BOOL isIntoMonitorFromMonitor; - -//分享工具栏 竖屏显示 全屏时,隐藏 -//@property (nonatomic,strong) UIView *midSecondToolHView; -//@property (nonatomic,strong) UISegmentedControl *segmentControl; @property (nonatomic,strong) IifshSegmentView *segControl; - -//@property (nonatomic,strong) UIButton *soundButtonH; @property (nonatomic,strong) UIButton *stopBtnH; @property (nonatomic,strong) UIImageView *stopImageViewH; @property (nonatomic,strong) UIButton *switchScreenButtonH; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m index 4bac104..727aecd 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/IfishP2PMonitorController.m @@ -10,17 +10,14 @@ #import #import #import -#import #import "Toast+UIView.h" #import "AppDelegate.h" -//#import "PAIOUnit.h" #import "UDManager.h" #import "Utils.h" #import "TouchButton.h" #import "ContactDAO.h" #import "FListManager.h" #import "Contact.h" -#import "UDPManager.h"//rtsp监控界面弹出修改 #import "LocalDevice.h"//rtsp监控界面弹出修改 #import "CustomTopBar.h" #define MAX_VIDEO_RES_SIZE ((1920+32)*1088) @@ -66,7 +63,7 @@ #import "RuSunLightOrder.h" #import "RuiMeiSetViewController.h" #import "Xuanduo2SettingController.h" - +#import "MessageAlertView.h" //上部分视频封装 下部分分段控制器 封装 (下一步代码优化) @interface IfishP2PMonitorController () { @@ -75,14 +72,8 @@ CGFloat _monitorInterfaceH;//rtsp监控界面弹出修改 UIButton* _btnDefence; - - BOOL _isPlaying; - BOOL _isOkFirstRenderVideoFrame;//YES表示第一次成功渲染图像 - BOOL _isOkRenderVideoFrame;//YES表示图像渲染出来了 - BOOL _isCanAutoOrientation;//限制屏幕什么时候可以旋转 - - BOOL _isInItDevice; //是否连接设备 + BOOL _connectDevice; //是否连接设备 BOOL _isStop;//是否暂停 用于区分是 暂停按钮 还是 连接失败按钮 dispatch_queue_t _xutoMainQueue; BOOL _isPushNextView; //是否push下级界面 @@ -105,7 +96,9 @@ @property(nonatomic,strong) RusunHaveHeateSetViewController *rusunSet; @property(nonatomic,strong) RunSun84CHSetViewController *rusun84Set; @property (nonatomic, strong) RuiMeiSetViewController *ruimeiSet; -@property(nonatomic,strong) DXPopover *popover; +//@property(nonatomic,strong) DXPopover *popover; +//@property(nonatomic,strong) LXPopView *popView; +Strong MessageAlertView *popView; @property(nonatomic,strong) UIButton *rightPopButton; @property (nonatomic,strong) SetNameTextViewController *setNameVC; @property (nonatomic,strong) NSString *xinName; @@ -127,7 +120,6 @@ Strong UIImage *screenShotImage;//截图 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization - _isPlaying = NO; } return self; } @@ -136,11 +128,10 @@ Strong UIImage *screenShotImage;//截图 [super viewWillAppear:animated]; //跳转到录制界面会将cameraHViewDelegate 置nil _bottomToolHView.cameraHViewDelegate=self; - //扫码激活用 更新isActive //屏幕长亮 [[ UIApplication sharedApplication] setIdleTimerDisabled:YES]; - + NSArray *yooseeDeviceArr = [[DataCenter defaultDtacenter] valueForKey:@"cameraArr"]; for (IfishCameraModel *camera in yooseeDeviceArr) { if ([camera.cameraId isEqualToString:self.contact.cameraId]) { @@ -155,25 +146,23 @@ Strong UIImage *screenShotImage;//截图 [[AppDelegate sharedDefault] application:[UIApplication sharedApplication] supportedInterfaceOrientationsForWindow:[AppDelegate sharedDefault].window]; //先判断是否授权 if (!self.contact.isActive) { - + [self.view makeToast:@"设备无授权字段"]; - + return; } if ([self.contact.isActive isEqualToString:@"1"]) { - + [self cameraConnectSeting]; - + }else if ([self.contact.isActive isEqualToString:@"0"]){ - -// [[P2PClient sharedClient] setDelegate:self]; + UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"" message:@"请扫描产品外包装上的激活码来激活摄像头" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"前往扫描", nil]; alert.tag = WEIJIHUO_ALERT; [alert show]; - + } } - //加tab 栏后新增 -(void)cameraConnectSeting{ //rtsp监控界面弹出修改 @@ -185,7 +174,8 @@ Strong UIImage *screenShotImage;//截图 [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; } //环境校验 --(void)testNetStatusByAF{ +-(void)checkNetStatus{ + [[AFNetworkReachabilityManager sharedManager] startMonitoring]; [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { NSLog(@"%ld", (long)status); @@ -238,9 +228,7 @@ Strong UIImage *screenShotImage;//截图 [self.scrollView setZoomScale:1.0]; } } - - //[self.remoteView setCaptureFinishScreen:YES]; - + [self.player p2pStop]; [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil]; [self.bottomToolHView removeObViserFromSelf]; @@ -254,111 +242,107 @@ Strong UIImage *screenShotImage;//截图 [super viewDidLoad]; - [self testNetStatusByAF]; + [self checkNetStatus]; self.isShowControllerBar = YES; self.isVideoModeHD = NO; _isReject=YES; _isStop = NO; - _isOkFirstRenderVideoFrame = YES; _isPushNextView = NO; //监控竖屏时,各控件初始化(先) [self initComponentForPortrait]; //监控横屏时,各控件初始化(后) [self initComponentForHorizontalScreen]; - + if ([self.contact.isActive isEqualToString:@"1"]) { [self connectDevice]; - + }else{ - [self.yProgressView stop]; } } - +#pragma mark --LoadBaseUI +-(UIView *)canvasView{ + if (!_canvasView) { + //显示监控画面的载体canvasView + CGFloat canvasView_h = [UIScreen mainScreen].bounds.size.width * 9/16; + _canvasView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screen_width, canvasView_h)]; + _canvasView.backgroundColor = [UIColor clearColor]; + self.canvasframe = _canvasView.frame; + } + return _canvasView; +} #pragma mark - 初始化设备 p2pConnect -(void)connectDevice{ UserModel *model=[dataContorl getUserInfo]; NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff]; //初始化设备 - if (!_isInItDevice) { + if (!_connectDevice) { NSLog(@"正在初始化设备"); - _isInItDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + _connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil]; + + [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.contact.cameraId password:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { +// [self outputLog:dataDictionary success:success]; + //获取成功,打印设备信息,之后连接设备 + if (success) { + NSLog(@"当前连接设备信息:%@",dataDictionary); + } + }]; } - if(_isInItDevice){ - - NSLog(@"p2pConnect success. 成功 可以操作设备了"); - //成功 可以操作设备了 - usleep(600000); - if (_isReject&&_isInItDevice) { - NSLog(@"发送呼叫命令"); - //尝试连接摄像头 - [self monitorP2PCallWithId:self.contact.cameraId]; - - NSLog(@"设备连接密码为:%@",self.contact.cameraPass); - } - - }else{//new added + if(!_connectDevice){//p2p连接失败 NSLog(@"p2pConnect failure.失败,不能操作设备"); - //[self connectDevice]; + [self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorTimeout isReCall:NO]; return; } - - } --(void)monitorP2PCallWithId:(NSString *)callId { +#pragma mark --尝试连接摄像头 +-(void)monitorP2PCall{ + if ([self.player isPlaying]) {//如果已经连接,则不重复发出连接申请 + return; + } + //p2p未连接 + if (!_connectDevice) { + [self connectDevice]; + if(_connectDevice){ + // 连接摄像头 + [self monitorP2PCall]; + } + } WEAK_SELF; dispatch_async(dispatch_get_global_queue(0, 0), ^{ - [weakSelf.player p2pCallDeviceWithDeviceId:callId password:weakSelf.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) { + [weakSelf.player p2pCallDeviceWithDeviceId:self.contact.cameraId password:weakSelf.contact.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) { //呼叫设备 NSLog(@"[p2pCallDevice-Calling],paras=%@",parameters); - + } accept:^(NSDictionary *parameters) { - + NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters); - + } reject:^(GWP2PCallError error, NSString *errorCode) { _isReject=YES; - _isOkRenderVideoFrame = NO; - NSLog(@"视频挂断"); - while (_isPlaying) { - usleep(50*1000); - } + NSLog(@"摄像头连接失败"); dispatch_async(dispatch_get_main_queue(), ^{ - if (self.isIntoMonitorFromMonitor) { - self.isIntoMonitorFromMonitor = NO; - [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; - }else{ - [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; - } + [self hiddenMonitoringUI:NO callWithErrorType:(NSInteger)error isReCall:NO]; }); - + } ready:^{ //呼叫成功操作 - NSLog(@"[p2pCallDevice-Ready] %@",[NSThread currentThread]); - [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_READY_P2P]; - - if([[P2PClient sharedClient] p2pCallType]==P2PCALL_TYPE_MONITOR){ - //连接就绪之后就开始启动渲染直播内容 - [self monitorStartRender]; - } - // //全景设备,180全景默认电视广角,360全景默认显示混合模式 - // GWP2PFisheyeType fisheyeType = [GWP2PDevice getFisheyeTypeWithSubtype:weakSelf.contact.deviceType]; - // if (fisheyeType == GWP2PFisheyeType180) { - // weakSelf.player.showMode = PM_WIDE_ANGLE; - // } else if (fisheyeType == GWP2PFisheyeType360) { - // weakSelf.player.showMode = PM_MIX; - // } else { - // //其它设备用默认的显示,没有形变 - // } - }]; - - + NSLog(@"连接摄像头成功 当前所在线程为%@",[NSThread currentThread]); + //隐藏呼叫中的UI + dispatch_async(dispatch_get_main_queue(), ^{ + //隐藏旋转按钮 + [weakSelf hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; + // + [weakSelf didHiddenMonitorUIWith:YES]; + }); + } allowLAN:YES]; + + }); } -//视频播放 +//摄像头播放回调 #pragma mark - GWP2PPlayer代理回调测试 - (void)p2pPlayer:(GWP2PPlayer *)player recieveGestureRecognizer:(UIGestureRecognizer *)gesture { NSLog(@"-----delegate---recieveGestureRecognizer"); @@ -368,56 +352,6 @@ Strong UIImage *screenShotImage;//截图 NSLog(@"-----delegate---numberOfAudiencesChange"); } -//#pragma mark - 协议的实现 -//- (void)P2PClientCalling:(nullable NSDictionary*)info{ -// -// NSLog(@"正在呼叫"); -//} -//- (void)P2PClientReject:(nullable NSDictionary*)info{ -// -// _isReject=YES; -// _isOkRenderVideoFrame = NO; -// NSLog(@"视频挂断"); -// while (_isPlaying) { -// usleep(50*1000); -// } -// -// -// if (self.isIntoMonitorFromMonitor) { -// self.isIntoMonitorFromMonitor = NO; -// [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; -// // [self monitorP2PCall]; -// }else{ -// [self hiddenMonitoringUI:NO callWithErrorType:info isReCall:NO]; -// } -// -// -// -//} -//- (void)P2PClientAccept:(nullable NSDictionary*)info{ -// -// NSLog(@"接收数据"); -//} -//- (void)P2PClientReady:(nullable NSDictionary*)info{ -// -// NSLog(@"准备就绪"); -// [[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_READY_P2P]; -// -// if([[P2PClient sharedClient] p2pCallType]==P2PCALL_TYPE_MONITOR){ -// //连接就绪之后就开始启动渲染 -// [self monitorStartRender]; -// } -//} -#pragma mark - 准备渲染监控界面 --(void)monitorStartRender{ - //[self addLogs:@"渲染>>>你可以看到画面了"]; - _isReject = NO; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [self renderView]; - }); -} - - #pragma mark - 监控竖屏时,各控件初始化 #define BOTTOM_BAR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0) @@ -493,8 +427,6 @@ Strong UIImage *screenShotImage;//截图 self.nameTitle.textColor=[UIColor whiteColor]; self.navigationItem.titleView=self.nameTitle; - //右侧下拉菜单 - UIButton*rightButton = [UIButton buttonWithType:UIButtonTypeCustom]; rightButton.frame = CGRectMake(0, 0, 60, 44); [rightButton setImage:[UIImage imageNamed:@"ifishnav_dropview_list"] forState:UIControlStateNormal]; @@ -505,15 +437,7 @@ Strong UIImage *screenShotImage;//截图 UIBarButtonItem*rightItem = [[UIBarButtonItem alloc]initWithCustomView:self.rightPopButton]; self.navigationItem.rightBarButtonItem = rightItem; - - //显示监控画面的载体canvasView - CGFloat canvasView_h = [UIScreen mainScreen].bounds.size.width * 9/16; - UIView *canvasView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, canvasView_h)]; - canvasView.backgroundColor = [UIColor clearColor]; - [self.view addSubview:canvasView]; - self.canvasView = canvasView; - self.canvasframe = canvasView.frame; - + [self.view addSubview:self.canvasView];//添加摄像头的背景view //视频监控连接中的背景图片 NSString *filePath = [Utils getHeaderFilePathWithId:self.contact.cameraId]; UIImage *headImg = [UIImage imageWithContentsOfFile:filePath]; @@ -521,8 +445,15 @@ Strong UIImage *screenShotImage;//截图 headImg = LXImageWithImageName(@"ic_header.png"); } self.canvasView.layer.contents = (id)headImg.CGImage; + //添加播放器VC + self.player = [[GWP2PVideoPlayer alloc] init]; + self.player.delegate = self; + self.player.viewController.view.backgroundColor = [UIColor clearColor]; + [self.canvasView addSubview:self.player.viewController.view]; + [self addChildViewController:self.player.viewController]; - + self.player.viewController.view.frame = self.canvasframe; + self.remoteView = self.player.viewController.view; //视频监控连接中或者连接失败的文字提示,以及旋转或者重连图片 UIButton *promptButton = [UIButton buttonWithType:UIButtonTypeCustom]; promptButton.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); @@ -531,14 +462,9 @@ Strong UIImage *screenShotImage;//截图 [promptButton addTarget:self action:@selector(onVerticalBtnPress:) forControlEvents:UIControlEventTouchUpInside]; [self.canvasView addSubview:promptButton]; self.promptButton = promptButton; - //文字frame - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; - CGFloat labelTip_w = size.width+10.0; - CGFloat labelTip_h = size.height; //图片frame CGFloat progressView_wh = LOADINGPRESSVIEW_WIDTH_HEIGHT; - CGFloat progressView_y = (self.canvasView.frame.size.height-labelTip_h-progressView_wh)/2; + CGFloat progressView_y = (self.canvasView.frame.size.height-progressView_wh)/2; // 旋转或者重连图片 或者开始监控图片 ProgressImageView *progressView = [[ProgressImageView alloc] initWithFrame:CGRectMake((width-progressView_wh)/2, progressView_y, progressView_wh, progressView_wh)]; @@ -547,62 +473,6 @@ Strong UIImage *screenShotImage;//截图 [progressView start]; self.yProgressView = progressView; - //视频监控连接中或者连接失败的文字提示 - UILabel* labelTip = [[UILabel alloc] initWithFrame:CGRectMake((width-labelTip_w)/2, progressView_y+progressView_wh, labelTip_w, labelTip_h)]; - labelTip.backgroundColor = [UIColor clearColor]; - labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)]; - labelTip.textAlignment = NSTextAlignmentCenter; - labelTip.font = XFontBold_16; - labelTip.textColor = XWhite; - //打开可以显示监控连接中或者连接失败的文字提示 - // [self.promptButton addSubview:labelTip]; - self.labelTip = labelTip; - - //显示监控的画布OpenGLView -// OpenGLView *glView = [[OpenGLView alloc] init]; -// glView.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); -// self.remoteView = glView; -// self.remoteView.delegate = self; -// [self.remoteView.layer setMasksToBounds:YES]; -// [self.canvasView addSubview:self.remoteView]; - - self.player = [[GWP2PVideoPlayer alloc] init]; - self.player.delegate = self; - self.remoteView = self.player.viewController.view; - [self.canvasView addSubview:self.player.viewController.view]; - [self addChildViewController:self.player.viewController]; - -// //上划手势 -// UISwipeGestureRecognizer *swipeGestureUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUp:)]; -// [swipeGestureUp setDirection:UISwipeGestureRecognizerDirectionUp]; -// [swipeGestureUp setCancelsTouchesInView:YES]; -// [swipeGestureUp setDelaysTouchesEnded:YES]; -// //[_remoteView addGestureRecognizer:swipeGestureUp]; -// -// //下划手势 -// UISwipeGestureRecognizer *swipeGestureDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDown:)]; -// [swipeGestureDown setDirection:UISwipeGestureRecognizerDirectionDown]; -// -// [swipeGestureDown setCancelsTouchesInView:YES]; -// [swipeGestureDown setDelaysTouchesEnded:YES]; -// // [_remoteView addGestureRecognizer:swipeGestureDown]; -// -// //左划手势 -// UISwipeGestureRecognizer *swipeGestureLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)]; -// [swipeGestureLeft setDirection:UISwipeGestureRecognizerDirectionLeft]; -// [swipeGestureLeft setCancelsTouchesInView:YES]; -// [swipeGestureLeft setDelaysTouchesEnded:YES]; -// //[_remoteView addGestureRecognizer:swipeGestureLeft]; -// -// //右划手势 -// UISwipeGestureRecognizer *swipeGestureRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)]; -// [swipeGestureRight setDirection:UISwipeGestureRecognizerDirectionRight]; -// [swipeGestureRight setCancelsTouchesInView:YES]; -// [swipeGestureRight setDelaysTouchesEnded:YES]; -// //[_remoteView addGestureRecognizer:swipeGestureRight]; - - //左边的按住说话弹出的声音图标 - //进入横屏时,调整frame //退出横屏时,也调整frame UIView *pressView = [[UIView alloc] initWithFrame:CGRectMake(10, self.canvasframe.size.height+NAVIGATION_BAR_HEIGHT-PRESS_LAYOUT_WIDTH_AND_HEIGHT, PRESS_LAYOUT_WIDTH_AND_HEIGHT/2, PRESS_LAYOUT_WIDTH_AND_HEIGHT)]; @@ -655,11 +525,11 @@ Strong UIImage *screenShotImage;//截图 [self.midToolHView addSubview:self.stopBtnH]; //暂停按钮图片 UIImage *stopImageH = LXImageWithImageName(@"monitor_stop_h"); - //self.stopImageViewH = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, (self.stopBtnH.frame.size.height-stopImageH.size.height/SCREEN_SCALE)/2, stopImageH.size.width/SCREEN_SCALE, stopImageH.size.height/SCREEN_SCALE)]; self.stopImageViewH = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, midtH/2, midtH/2)]; self.stopImageViewH.contentMode = UIViewContentModeScaleToFill; self.stopImageViewH.image = stopImageH; + self.stopImageViewH.tag = 10; [self.stopBtnH addSubview:self.stopImageViewH]; @@ -687,31 +557,6 @@ Strong UIImage *screenShotImage;//截图 [self.switchScreenButtonH addSubview:switchScreenImageViewH]; - //选择 - /*CGFloat segMentH=midtH; - CGFloat controlSegY= CGRectGetMaxY(self.canvasView.frame); - NSArray *segArr=[[NSArray alloc] initWithObjects:@"摄像头", @"水族箱", nil]; - self.segmentControl = [[UISegmentedControl alloc] initWithItems:segArr]; - self.segmentControl.frame=CGRectMake(0.0, controlSegY,kScreenSize.width, segMentH); - self.segmentControl.selectedSegmentIndex = 0; - self.segmentControl.tintColor=COLOR_LABEL_TITLE; - self.segmentControl.backgroundColor = SEGMENT_CONTROLBACK; - self.segmentControl.layer.masksToBounds = YES; - self.segmentControl.layer.cornerRadius = 0; - self.segmentControl.layer.borderColor = [UIColor colorWithRed:65.0/256.0 green:65.0/256.0 blue:65.0/256.0 alpha:1].CGColor; - self.segmentControl.layer.borderWidth = 2; - - [self.segmentControl setTitle:@"摄像头" forSegmentAtIndex:0]; - [self.segmentControl setTitle:@"水族箱" forSegmentAtIndex:1]; - NSDictionary *attributesString=@{ NSFontAttributeName:[UIFont systemFontOfSize:18], - NSForegroundColorAttributeName:[UIColor whiteColor], - - }; - //NSBackgroundColorAttributeName:[UIColor redColor] - [self.segmentControl setTitleTextAttributes:attributesString forState:UIControlStateSelected]; - [self.segmentControl addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged]; - [self.view addSubview:self.segmentControl];*/ - CGFloat segMentH=kScreenSize.width*0.13; CGFloat controlSegY= CGRectGetMaxY(self.canvasView.frame); IifshSegmentView *seg = [[IifshSegmentView alloc] initWithFrame:CGRectMake(0.0, controlSegY,kScreenSize.width, segMentH)]; @@ -736,88 +581,84 @@ Strong UIImage *screenShotImage;//截图 [self.view addSubview:bottomHView]; self.bottomFishHView = bottomHView; self.bottomFishHView.hidden = YES; - //截图展示 暂未用 - //CGFloat contentH=200*0.56; - //_shutterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, contentH)]; - //_shutterView.backgroundColor = [UIColor clearColor]; + //右侧下拉菜单 + [self initPopOver]; } #pragma mark - 播放器代理回调 -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; - self.player.viewController.view.frame = self.canvasframe; + self.player.viewController.view.frame = self.canvasView.bounds; } #pragma mark- 下拉菜单 +-(MessageAlertView *)popView{ + if (!_popView) { + _popView = [[MessageAlertView alloc]initWithFrame:RECT(screen_width - kSizeFrom750(220), 0, kSizeFrom750(220), kSizeFrom750(270))]; + WEAK_SELF; + //点击 + _popView.comboxBlock = ^(NSInteger tag) { + if (tag == 0) { + //修改设备名 + [weakSelf sheZhiCameraMing]; + + }else if (tag == 1){ + //删除摄像头 + [weakSelf delectCamera]; + + }else if (tag == 2){ + //检查设备更新 + + if ([weakSelf.player isPlaying]) { + + [weakSelf.view makeToastActivity]; + [[GWP2PClient sharedClient] checkDeviceUpdateWithDeviceID:weakSelf.contact.cameraId devicePassword:weakSelf.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + //检查更新成功之后,处理回调事件 + [weakSelf checkUpdateSuccessWithDictionary:dataDictionary]; + }]; + }else{ + + [weakSelf.view makeToast:@"设备已离线"]; + } + + }else if (tag == 3){ + //解除绑定关系 + + [weakSelf jieBangBtnAction]; + + } + + [weakSelf popAppear];//隐藏弹出框 + }; + } + return _popView; +} + -(void)popAppear{ - - UIImage *image = [UIImage imageNamed:@"popover_background_image_notrangle"]; - + BOOL isHidden = self.popView.hidden; + if (isHidden) { + self.popView.hidden = NO; + } + [UIView animateWithDuration:0.3 animations:^{ + self.popView.transform = CGAffineTransformScale(self.popView.transform,isHidden?100:0.01,isHidden?100:0.01); + + } completion:^(BOOL finished) { + self.popView.hidden = !isHidden; + }]; +} +-(void)initPopOver{ + [self.view addSubview:self.popView]; BOOL isBind=[self testCameraBindDeviceOrNot]; NSArray *titleImgs =nil; NSArray *titles=nil; - CGFloat popRowH=60*(image.size.height/image.size.width); - LXPopView *pop=[[LXPopView alloc] init]; - if (isBind) { - pop.frame = CGRectMake(screen_width-160, 0, 160, popRowH * 4 +12 ); - titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate",@"ifish_jieBang_device"]; - titles=@[@"修改名称",@"删除设备",@"设备升级",@"解除绑定"]; - - }else{ - pop.frame = CGRectMake(screen_width-160, 0, 160, popRowH * 3 +12); - - titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"]; - titles=@[@"修改名称",@"删除设备",@"设备升级"]; - - } - - pop.delegate = self; - pop.backgroundImage =image - ; - pop.titles = titles; - pop.titleImgs =titleImgs; - DXPopover *popover = [DXPopover popover]; - - self.popover = popover; - popover.arrowSize = CGSizeMake(0.0,0.0); - [popover showAtView:self.rightPopButton withContentView:pop]; - -} - - -#pragma mark - pop代理 - --(void)disSelectedPopViewIndex:(NSIndexPath *)Index{ - [self.popover dismiss]; - if (Index.row == 0) { - //修改设备名 - [self sheZhiCameraMing]; - - }else if (Index.row == 1){ - //删除摄像头 - - [self delectCamera]; - - }else if (Index.row == 3){ - //解除绑定关系 - - [self jieBangBtnAction]; - - }else if (Index.row == 2){ - //检查设备更新 - - if (_isOkRenderVideoFrame) { - -// self.progressAlert.dimBackground = YES; -// [self.progressAlert show:YES]; - [self.view makeToastActivity]; - [[P2PClient sharedClient] checkDeviceUpdateWithId:self.contact.cameraId password:self.contact.cameraPass]; - }else{ - - [self.view makeToast:@"设备已离线"]; - } - + if (isBind) { + titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate",@"ifish_jieBang_device"]; + titles=@[@"修改名称",@"删除设备",@"设备升级",@"解除绑定"]; + }else{ + titleImgs = @[@"ifishdropview_edite_device",@"ifishdropview_delect_device",@"equipment_icon_equipmentupdate"]; + titles=@[@"修改名称",@"删除设备",@"设备升级"]; } + [self.popView loadInfoWithTitle:titles Icons:titleImgs]; } //判断摄像头是否有关系设备 @@ -825,7 +666,6 @@ Strong UIImage *screenShotImage;//截图 -(BOOL)testCameraBindDeviceOrNot{ - NSArray *devicCameraArr = [[DataCenter defaultDtacenter] valueForKey:@"devicamerArr"]; @@ -834,17 +674,11 @@ Strong UIImage *screenShotImage;//截图 for (DeviceCameraModel *camera in devicCameraArr) { [camerwIdArr addObject:camera.cameraId]; - - } BOOL exst=[camerwIdArr containsObject:self.contact.cameraId]; - if (exst) { - return YES; - } - return NO; } @@ -864,12 +698,10 @@ Strong UIImage *screenShotImage;//截图 wself.nameTitle.text = nameStr; }; - - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } - [self.navigationController pushViewController:self.setNameVC animated:YES]; self.navigationController.navigationBarHidden = NO; @@ -930,8 +762,7 @@ Strong UIImage *screenShotImage;//截图 NSLog(@"result:%@",resultDic[@"result"]); if ([resultDic[@"result"] isEqualToString:@"100"]) { - if (_isOkRenderVideoFrame) { - + if ([weakSelf.player isPlaying]) { [weakSelf stopGLViewVideo]; } [[Socketsingleton sharedInstance] cutOffSocket]; @@ -1055,6 +886,64 @@ Strong UIImage *screenShotImage;//截图 [self.view makeToast:@"请检查网络连接"]; }]; +} +#pragma mark --更新相关内容 +//检查更新之后,是否更新 +-(void)checkUpdateSuccessWithDictionary:(NSDictionary *)parameter +{ + NSInteger result = [[parameter valueForKey:@"result"] intValue]; + NSString *curVersion = [parameter valueForKey:@"current version"]; + NSString *upgVersion = [parameter valueForKey:@"update version"]; + NSString *updateStatus = [parameter valueForKey:@"can update"];//当前是否为最新版本 + if(result==1){ + //读取到了服务器升级文件 + dispatch_async(dispatch_get_main_queue(), ^{ + [self.view hideToastActivity]; + if ([updateStatus integerValue]==0) {//当前为最新版本,不需要升级 + [CommonUtils showAlerWithTitle:nil withMsg:[NSString stringWithFormat:@"%@:%@,%@",NSLocalizedString(@"cur_version_is", nil),curVersion,NSLocalizedString(@"is_latest_version", nil)]]; + }else{ + NSString *title = [NSString stringWithFormat:@"%@:%@,%@:%@",NSLocalizedString(@"cur_version_is", nil),curVersion,NSLocalizedString(@"can_update_to", nil),upgVersion]; + UIAlertView *deleteAlert = [[UIAlertView alloc] initWithTitle:title message:@"" delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"ok", nil),nil]; + deleteAlert.tag = ALERT_TAG_UPDATE; + [deleteAlert show]; + } + }); + + + }else if(result==72){//sd卡升级文件 + //读取到了sd卡升级文件 + dispatch_async(dispatch_get_main_queue(), ^{ + + [self.view hideToastActivity]; + NSString *title = [NSString stringWithFormat:@"%@:%@,%@",NSLocalizedString(@"cur_version_is", nil),curVersion,NSLocalizedString(@"can_update_sd", nil)]; + UIAlertView *deleteAlert = [[UIAlertView alloc] initWithTitle:title message:@"" delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"ok", nil),nil]; + deleteAlert.tag = ALERT_TAG_UPDATE; + [deleteAlert show]; + + }); + }else if(result==54){ + dispatch_async(dispatch_get_main_queue(), ^{ + + + [self.view hideToastActivity]; + [self.view makeToast:[NSString stringWithFormat:@"%@:%@",NSLocalizedString(@"now_version_is_latest", nil),curVersion]]; + }); + }else if(result==58){ + dispatch_async(dispatch_get_main_queue(), ^{ + + + [self.view hideToastActivity]; + [self.view makeToast:NSLocalizedString(@"other_was_check_device_update", nil)]; + }); + }else{ + dispatch_async(dispatch_get_main_queue(), ^{ + + + [self.view hideToastActivity]; + [self.view makeToast:NSLocalizedString(@"update_failed", nil)]; + }); + } + } #pragma mark- Segment选择事件 with新UI @@ -1156,8 +1045,6 @@ Strong UIImage *screenShotImage;//截图 isfromCameraView = YES; //主动 释放 openGL 内存 以 free buffer [AppDelegate sharedDefault].canFullScreen = NO; -#warning 释放内存 -// [self.remoteView releseromotViewSet]; IfishBindDeviceSelectViewController *connectVC=[[IfishBindDeviceSelectViewController alloc]init]; [self.navigationController pushViewController:connectVC animated:YES]; @@ -1206,39 +1093,32 @@ Strong UIImage *screenShotImage;//截图 // WEAK_SELF; //todo: 不停截图内存升高 [self.player p2pScreenshot:^(UIImage *screenshot, NSTimeInterval timeInterval) { -// dispatch_async(dispatch_get_main_queue(), ^{ -// //weakself.screenShotView.image = nil; -// weakself..image = screenshot; -// weakself.screenShotView.hidden = NO; -// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ -// weakself.screenShotView.hidden = YES; -// }); -// -// }); - self.screenShotImage = screenshot; + dispatch_async(dispatch_get_main_queue(), ^{ + UIImage *tempImage = [[UIImage alloc] initWithCGImage:screenshot.CGImage]; + NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(tempImage)]; + [Utils saveScreenshotFile:imgData]; + [self.view makeToast:@"截图成功,请在图库中查看"]; + }); }]; } -(void)onVerticalBtnPress:(UIButton *)button{ switch(button.tag){ case SOUND_BUTTON_H_TAG://声音 { - if (!_isOkRenderVideoFrame) { + if (![self.player isPlaying]) { //图像渲染出来前,不可以控制声音 return; } } - break; case SWITCH_SCREEN_BUTTON_H_TAG://切换至横屏或者竖屏 { - if (!_isOkFirstRenderVideoFrame) { - //第一次成功渲染图像前,不可以切换至横屏 + if (![self.player isPlaying]) { return; } if (!self.isFullScreen) { - //设置横屏 [AppDelegate sharedDefault].canFullScreen = YES; static int isFullScreen = 3; // 3 == 全屏 1 == 竖屏 @@ -1367,8 +1247,6 @@ Strong UIImage *screenShotImage;//截图 case SCREENSHOT_BUTTON_H_TAG://截图 { [self screenShot];//截屏 -// [self.remoteView setIsScreenShotting:YES]; - } break; case PROMPT_BUTTON_TAG://重新连接监控 @@ -1382,55 +1260,35 @@ Strong UIImage *screenShotImage;//截图 //暂停按钮 case STOPBTN_TAG: { - -// if (!_isOkRenderVideoFrame) { -// //图像渲染出来前,不可以暂停 -// return; -// } - - - UIImageView *stopImageViewH = (UIImageView *)button.subviews[0]; + //获取暂停按钮图 + UIImageView *stopImageViewH = (UIImageView *)[button viewWithTag:10]; //暂停结束,继续播放视频 - if(!_isOkRenderVideoFrame){ + if(![self.player isPlaying]){ + _isStop = NO; [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; [self monitorP2PCall]; stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png"); //横屏,声音打开 - //UIButton *controllerSoundBtn = (UIButton *)[self.controllBar viewWithTag:CONTROLLER_BTN_TAG_SOUND]; - //[controllerSoundBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_sound_on.png") forState:UIControlStateNormal]; }else{ - + _isStop = YES;//点击暂停 [self stopGLViewVideo]; + [self hiddenMonitoringUI:YES callWithErrorType:GWP2PCallErrorNone isReCall:NO]; stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); //横屏,声音关闭 -// UIButton *controllerSoundBtn = (UIButton *)[self.controllBar viewWithTag:CONTROLLER_BTN_TAG_SOUND]; -// [controllerSoundBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_sound_off.png") forState:UIControlStateNormal]; - } - - } break; - //图库 - case SCREENSHOT_BUTTON_FLIE_TAG: - { - - - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } - usleep(50*1000); - ShotScreenImgViewController *shootView=[[ShotScreenImgViewController alloc] init]; - [self.navigationController pushViewController:shootView animated:YES]; NSLog(@"图库"); - } } } @@ -2295,7 +2153,7 @@ Strong UIImage *screenShotImage;//截图 #pragma mark- 横屏暂停按钮事件 -(void)HorizontalStopBtnPress:(UIButton *)btn{ - if(!_isOkRenderVideoFrame){ + if(![self.player isPlaying]){ [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:YES]; [self monitorP2PCall]; @@ -2414,49 +2272,6 @@ Strong UIImage *screenShotImage;//截图 } } -} -#pragma mark --尝试连接摄像头 -//rtsp监控界面弹出修改 --(void)monitorP2PCall{ - - // [self monitorP2PCallWithId:self.contact.cameraId]; -} - -#pragma mark - 开始渲染监控画面 -- (void)renderView -{ - _isPlaying = YES; - - GAVFrame * m_pAVFrame ; - - while (!self.isReject) - { - - if(fgGetVideoFrameToDisplay(&m_pAVFrame)) - { - if (!_isOkRenderVideoFrame) { - _isOkRenderVideoFrame = YES; - _isOkFirstRenderVideoFrame = YES; - dispatch_async(dispatch_get_main_queue(), ^{ - //隐藏监控连接中的UI - [self hiddenMonitoringUI:YES callWithErrorType:100 isReCall:NO]; - [self didHiddenMonitorUIWith:YES]; - - - }); - //设置默认高清 - [self setGaoQingHuoBiaoQing]; - - } -#warning frame -// [self.remoteView render:m_pAVFrame]; - vReleaseVideoFrame(); - } - usleep(10000); - } - - _isPlaying = NO; - } #pragma mark --上送最后一帧截图数据 -(void)getLastImgGoback{ @@ -2472,38 +2287,21 @@ Strong UIImage *screenShotImage;//截图 -(void)btnClickToBack:(UIButton*)btn{ - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self getLastImgGoback]; } if(!_isReject){ _isReject = YES; - while (_isPlaying) { - // usleep() 与sleep()类似,用于延迟挂起进程。进程被挂起放到ready queue - usleep(50*1000); - } - - [[P2PClient sharedClient] p2pHungUp]; - - + [self.player p2pStop]; } - - [self stopGLViewVideo]; [Socketsingleton sharedInstance].communiteDelegate=nil; [[Socketsingleton sharedInstance] cutOffSocket]; - - [AppDelegate sharedDefault].canFullScreen = NO; -// [self.remoteView releseromotViewSet]; //改 tab 栏后新增 [self setAppTabRoot]; - // [self dismissViewControllerAnimated:YES completion:^{ - //主动 释放 openGL 内存 以 free buffer -// [self.remoteView getLastImgGoback]; -// [AppDelegate sharedDefault].canFullScreen = NO; -// [self.remoteView releseromotViewSet]; - // }]; + } @@ -2693,8 +2491,7 @@ Strong UIImage *screenShotImage;//截图 -(UIView*)viewForZoomingInScrollView:(UIScrollView *)scrollView{ //进入全屏时,方可允许操作缩放功能 if (self.isFullScreen) { -// return self.remoteView; - return self.canvasView; + return self.remoteView; } return nil; @@ -2740,19 +2537,16 @@ Strong UIImage *screenShotImage;//截图 -(void)onBegin:(TouchButton *)touchButton widthTouches:(NSSet *)touches withEvent:(UIEvent *)event{ DLog(@"onBegin"); [self.pressView setHidden:NO]; - // [[PAIOUnit sharedUnit] setSpeckState:NO]; } -(void)onCancelled:(TouchButton *)touchButton widthTouches:(NSSet *)touches withEvent:(UIEvent *)event{ DLog(@"onCancelled"); [self.pressView setHidden:YES]; - // [[PAIOUnit sharedUnit] setSpeckState:YES]; } -(void)onEnded:(TouchButton *)touchButton widthTouches:(NSSet *)touches withEvent:(UIEvent *)event{ DLog(@"onEnded"); [self.pressView setHidden:YES]; - // [[PAIOUnit sharedUnit] setSpeckState:YES]; } -(void)onMoved:(TouchButton *)touchButton widthTouches:(NSSet *)touches withEvent:(UIEvent *)event{ @@ -2767,12 +2561,6 @@ Strong UIImage *screenShotImage;//截图 { if(!self.isReject){ self.isReject = !self.isReject; - while (_isPlaying) { - usleep(50*1000); - } -// [[P2PClient sharedClient] p2pHungUp]; -// -// self.remoteView.isQuitMonitorInterface = YES;//rtsp监控界面弹出修改 [self.player p2pStop]; } } @@ -2780,32 +2568,13 @@ Strong UIImage *screenShotImage;//截图 case CONTROLLER_BTN_TAG_SOUND: { - //BOOL isMute = [[PAIOUnit sharedUnit] muteAudio]; - - DLog(@"onControllerBtnPress:CONTROLLER_BTN_TAG_SOUND"); -// if(isMute){ -// [[PAIOUnit sharedUnit] setMuteAudio:NO]; -// [sender setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_sound_on.png"] forState:UIControlStateNormal]; -// //竖屏,声音打开 -// UIButton *soundButtonH = (UIButton *)[self.midToolHView viewWithTag:SOUND_BUTTON_H_TAG]; -// UIImageView *soundImageViewH = (UIImageView *)soundButtonH.subviews[0]; -// soundImageViewH.image = [UIImage imageNamed:@"monitor_sound_on_h.png"]; -// }else{ -// -// [[PAIOUnit sharedUnit] setMuteAudio:YES]; -// [sender setBackgroundImage:[UIImage imageNamed:@"ic_ctl_new_sound_off.png"] forState:UIControlStateNormal]; -// //竖屏,声音关闭 -// UIButton *soundButtonH = (UIButton *)[self.midToolHView viewWithTag:SOUND_BUTTON_H_TAG]; -// UIImageView *soundImageViewH = (UIImageView *)soundButtonH.subviews[0]; -// soundImageViewH.image = [UIImage imageNamed:@"monitor_sound_off_h.png"]; -// } + } break; case CONTROLLER_BTN_TAG_SCREENSHOT: { [self screenShot]; -// [self.remoteView setIsScreenShotting:YES]; } break; case CONTROLLER_BTN_TAG_GPIO1_0: @@ -2829,7 +2598,6 @@ Strong UIImage *screenShotImage;//截图 self.isTalking = NO; [self.pressView setHidden:YES]; - //[[PAIOUnit sharedUnit] setSpeckState:YES]; }else{ UIButton *talkButtonH = (UIButton *)[self.bottomToolHView viewWithTag:TALK_BUTTON_H_TAG]; //竖屏,对讲打开 @@ -2839,7 +2607,6 @@ Strong UIImage *screenShotImage;//截图 self.isTalking = YES; [self.pressView setHidden:NO]; - //[[PAIOUnit sharedUnit] setSpeckState:NO]; } } break; @@ -2857,7 +2624,6 @@ Strong UIImage *screenShotImage;//截图 break; case CONTROLLER_BTN_TAG_HD: { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:7]; [self.player p2pSetDefinition:GWP2PPTZDefinitionHD];//高清 [self updateRightButtonState:CONTROLLER_BTN_TAG_HD]; @@ -2865,14 +2631,12 @@ Strong UIImage *screenShotImage;//截图 break; case CONTROLLER_BTN_TAG_SD: { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:5]; [self.player p2pSetDefinition:GWP2PPTZDefinitionSD];//标清 [self updateRightButtonState:CONTROLLER_BTN_TAG_SD]; } break; case CONTROLLER_BTN_TAG_LD: { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:6]; [self.player p2pSetDefinition:GWP2PPTZDefinitionLD]; [self updateRightButtonState:CONTROLLER_BTN_TAG_LD]; } @@ -2960,11 +2724,33 @@ Strong UIImage *screenShotImage;//截图 alert.tag = ALERT_UPDATE_SURE; [alert show]; - - [[P2PClient sharedClient] doDeviceUpdateWithId:self.contact.cameraId password:self.contact.cameraPass]; + //执行更新 + [[GWP2PClient sharedClient] performUpdateWithDeviceID:self.contact.cameraId devicePassword:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSInteger result = [[dataDictionary valueForKey:@"result"] intValue]; + NSInteger value = [[dataDictionary valueForKey:@"value"] intValue]; + + dispatch_async(dispatch_get_main_queue(), ^{ + + if(result==1){ + self.progressLabel.text = [NSString stringWithFormat:@"%li%%",(long)value];//device update + [self.progressMaskView setHidden:NO]; + + }else if(result==65){ + [self.progressMaskView setHidden:YES]; + [self.view makeToast:@"升级成功"]; + + }else{ + + [self.progressMaskView setHidden:YES]; + [self.view makeToast:NSLocalizedString(@"update_failed", nil)]; + } + }); + }]; }else{ - - [[P2PClient sharedClient] cancelDeviceUpdateWithId:self.contact.cameraId password:self.contact.cameraPass]; + //取消更新 + [[GWP2PClient sharedClient] cancelUpdateWithDeviceID:self.contact.cameraId devicePassword:self.contact.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + + }]; } }else if (alertView.tag == ALERT_TAG_UPDATE){ @@ -2978,15 +2764,11 @@ Strong UIImage *screenShotImage;//截图 UIImage *tempImage = [[UIImage alloc] initWithCGImage:image.CGImage]; NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(tempImage)]; [Utils saveScreenshotFile:imgData]; - //[self popLXAdViewWith:tempImage]; - - dispatch_async(dispatch_get_main_queue(), ^{ + dispatch_async(dispatch_get_main_queue(), ^{ //[self.view makeToast:NSLocalizedString(@"screenshot_success", nil)]; [self.view makeToast:@"截图成功,请在图库中查看"]; - }); - } -(void)popLXAdViewWith:(UIImage*)image{ @@ -3015,7 +2797,6 @@ Strong UIImage *screenShotImage;//截图 [self.yProgressView stop]; [self.yProgressView setHidden:YES]; - [self.labelTip setHidden:YES]; [self.promptButton setEnabled:NO]; [self.promptButton setHidden:YES]; @@ -3027,47 +2808,25 @@ Strong UIImage *screenShotImage;//截图 self.yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png"); [self.yProgressView start]; - - self.labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)]; [self.promptButton setEnabled:NO]; self.stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png"); // 禁用 底部栏暂停按钮 [self.stopBtnH setEnabled:NO]; - - }else{ - - if (_isStop) { - //暂停 - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - self.labelTip.text = [self getCallErrorStringWithErrorType:errorType]; - self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); - - - }else{ - self.yProgressView.angle = 0.0f; - self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); - self.labelTip.text = [self getCallErrorStringWithErrorType:errorType]; - self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); - - } - + self.yProgressView.angle = 0.0f; + self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start"); + self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png"); [self.yProgressView stop]; - self.labelTip.text = [self getCallErrorStringWithErrorType:errorType]; - [self.promptButton setEnabled:YES]; [self.stopBtnH setEnabled:YES]; - } [self.yProgressView setHidden:NO]; - - [self.labelTip setHidden:NO]; - + [self.promptButton setHidden:NO]; + [self.canvasView bringSubviewToFront:self.promptButton]; } } @@ -3256,17 +3015,14 @@ GWP2PCallErrorNotSupport, if (tag == CONTROLLER_BTN_TAG_HD) { UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_HD]; label.textColor = XBlue; - //[rButton setTitle:NSLocalizedString(@"HD", nil) forState:UIControlStateNormal]; [rButton setTitle:NSLocalizedString(@"高清", nil) forState:UIControlStateNormal]; }else if(tag == CONTROLLER_BTN_TAG_SD){ UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_SD]; label.textColor = XBlue; - //[rButton setTitle:NSLocalizedString(@"SD", nil) forState:UIControlStateNormal]; [rButton setTitle:NSLocalizedString(@"标清", nil) forState:UIControlStateNormal]; }else if (tag == CONTROLLER_BTN_TAG_LD){ UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_LD]; label.textColor = XBlue; - //[rButton setTitle:NSLocalizedString(@"LD", nil) forState:UIControlStateNormal]; [rButton setTitle:NSLocalizedString(@"流畅", nil) forState:UIControlStateNormal]; } @@ -3275,29 +3031,25 @@ GWP2PCallErrorNotSupport, //上滑动 - (void)swipeUp:(id)sender { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_PTZ_CTL -// andOption:USR_CMD_OPTION_PTZ_TURN_DOWN]; + [self.player p2pTurnDirection:GWP2PPTZDirectionUp]; } //下滑 - (void)swipeDown:(id)sender { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_PTZ_CTL -// andOption:USR_CMD_OPTION_PTZ_TURN_UP]; + [self.player p2pTurnDirection:GWP2PPTZDirectionDown]; } //左滑 - (void)swipeLeft:(id)sender { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_PTZ_CTL -// andOption:USR_CMD_OPTION_PTZ_TURN_LEFT]; + [self.player p2pTurnDirection:GWP2PPTZDirectionLeft]; } //右滑 - (void)swipeRight:(id)sender { -// [[P2PClient sharedClient] sendCommandType:USR_CMD_PTZ_CTL -// andOption:USR_CMD_OPTION_PTZ_TURN_RIGHT]; + [self.player p2pTurnDirection:GWP2PPTZDirectionRight]; } @@ -3451,18 +3203,7 @@ GWP2PCallErrorNotSupport, #pragma mark- 暂停 挂断 -(void)stopGLViewVideo{ - - if(!self.isReject){ - - self.isReject = !self.isReject; - while (_isPlaying) { - usleep(50*1000); - } -// [[P2PClient sharedClient] p2pHungUp]; - [self.player p2pStop]; -// self.remoteView.isQuitMonitorInterface = NO;//rtsp监控界面弹出修改 - } - + [self.player p2pStop]; } #pragma mark - 计算文本的尺寸 -(CGSize)sizeWithString:(NSString*)string font:(UIFont*)font maxWidth:(CGFloat)maxWidth{ @@ -3542,7 +3283,6 @@ GWP2PCallErrorNotSupport, //开始渲染 self.isReject = NO; - [NSThread detachNewThreadSelector:@selector(renderView) toTarget:self withObject:nil]; //根据访客密码监控、门铃监控来重新布局controllBar上的按钮 [self reLayoutButtonInControlBar]; @@ -3805,15 +3545,10 @@ GWP2PCallErrorNotSupport, self.promptButton.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height); //上面的canvasView重新add了remoteView [self.canvasView bringSubviewToFront:self.promptButton]; - NSString *labelTipText = [NSString stringWithFormat:@"%@",NSLocalizedString(@"玩命加载中...", nil)]; - CGSize size = [labelTipText sizeWithFont:XFontBold_16]; //旋转图片 - CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT; + CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT; self.yProgressView.frame = CGRectMake((self.canvasView.frame.size.width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (self.canvasView.frame.size.height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); - //文字 - self.labelTip.frame = CGRectMake((self.canvasView.frame.size.width-size.width)/2, CGRectGetMaxY(self.yProgressView.frame), size.width+10.0, size.height); - - + //左边的按住说话弹出的声音图标 //退出横屏时,调整frame self.pressView.frame = CGRectMake(10, self.canvasframe.size.height+NAVIGATION_BAR_HEIGHT-PRESS_LAYOUT_WIDTH_AND_HEIGHT, PRESS_LAYOUT_WIDTH_AND_HEIGHT/2, PRESS_LAYOUT_WIDTH_AND_HEIGHT); @@ -3865,9 +3600,6 @@ GWP2PCallErrorNotSupport, //旋转图片 CGFloat tipHeight = size.height + LOADINGPRESSVIEW_WIDTH_HEIGHT; self.yProgressView.frame = CGRectMake((width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT); - //文字 - self.labelTip.frame = CGRectMake((width-size.width)/2, CGRectGetMaxY(self.yProgressView.frame), size.width+10.0, size.height); - //进入横屏,修改remoteView的frame BOOL is16B9 = [[P2PClient sharedClient] is16B9]; @@ -4282,7 +4014,7 @@ GWP2PCallErrorNotSupport, -(void)noCanuserDevicePush{ - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } @@ -4463,24 +4195,11 @@ GWP2PCallErrorNotSupport, -(void)cameraIsNotExit{ - if(!_isReject){ - _isReject = YES; - while (_isPlaying) { - // usleep() 与sleep()类似,用于延迟挂起进程。进程被挂起放到ready queue - usleep(50*1000); - } - - [[P2PClient sharedClient] p2pHungUp]; - - } - - [self stopGLViewVideo]; + [self.player p2pStop]; [Socketsingleton sharedInstance].communiteDelegate=nil; [[Socketsingleton sharedInstance] cutOffSocket]; - [self screenShotImage]; [AppDelegate sharedDefault].canFullScreen = NO; -// [self.remoteView releseromotViewSet]; //改 tab 栏后新增 [self setAppTabRoot]; @@ -4801,7 +4520,7 @@ GWP2PCallErrorNotSupport, // [self.remoteView setIsScreenShotting:YES]; }else if (indexPath.row ==1){ //进入图库 - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } @@ -4826,7 +4545,7 @@ GWP2PCallErrorNotSupport, CertificationShopModel *ShopsInfo2= [[DataCenter defaultDtacenter] valueForKey:@"ShopsInfo2"]; - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } @@ -4847,7 +4566,7 @@ GWP2PCallErrorNotSupport, } }else if (indexPath.row ==3){ - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } @@ -4857,7 +4576,7 @@ GWP2PCallErrorNotSupport, }else if (indexPath.row ==4){ - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } @@ -4867,7 +4586,7 @@ GWP2PCallErrorNotSupport, }else if (indexPath.row ==5){ - if (_isOkRenderVideoFrame) { + if ([self.player isPlaying]) { [self stopGLViewVideo]; } diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm index a4d1234..b37654a 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeControlller/YooseeNextConnectViewController.mm @@ -7,55 +7,34 @@ // #import "YooseeNextConnectViewController.h" -#import "elian.h" #import "WaitingPageView.h" #define WAITING_CONTENT_VIEW_HEIGHT 300 #define NAVIGATION_BAR_HEIGHT ([[[UIDevice currentDevice] systemVersion] floatValue] < 7.0 ? (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 44:44):(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 64:64)) -#import "AppDelegate.h" - -#include -#include #import #import "Toast+UIView.h" #import "ContactDAO.h" -#import "Contact.h" #import "AppDelegate.h" - -#import "Constants.h" -#import "P2PClient.h" -#import "FListManager.h" -#import "Toast+UIView.h" - -#import "MBProgressHUD.h" - #import "UDManager.h" #import "LoginResult.h" #import "Utils.h" -#import #import "RightViewController.h" #import "LeftViewController.h" -#import "ICSDrawerController.h" -#import "UDPManager.h" -#import "YooseeCenterViewController.h" -#import "Socketsingleton.h" - #import "IfishCameraModel.h" #import "FListManager.h" #define GIWEI_INITPASS @"123" #import "IfishP2PMonitorController.h" -#import "LSemTMFSet.h" #import "LXWaveProgressView.h" #import "IfishConnectingView.h" #import "PushMasssageWebViewController.h" #import "IfishUserObsever.h" - +#import typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { lodingViewdissMissSuccsess=0,// default is 0 lodingViewdissMissfail, lodingViewdissMissAlreadyBinded }; -@interface YooseeNextConnectViewController () +@interface YooseeNextConnectViewController () { void *_context; BOOL _bQuit; @@ -84,6 +63,8 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { @property(nonatomic,strong) LXWaveProgressView *waveProgressView;; @property(nonatomic,strong) IfishConnectingView *connectingView; +@property (copy, nonatomic) NSString *deviceID;//设备id +@property (assign, nonatomic) BOOL isDeviceLinkIn;//是否已经连接智能设备 @end @@ -93,18 +74,16 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { [super viewDidLoad]; //智能联机 _initPwSuc = NO; + _isDeviceLinkIn = NO; self.conectType = conectType_Intelligent; self.addresses = [[NSMutableDictionary alloc] initWithCapacity:1]; self.view.backgroundColor = [UIColor whiteColor]; [self addTitleViewWithTitle:@"连接摄像头"]; - [self initComponent]; UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; self.navigationItem.backBarButtonItem = item; - // - [self soundInit]; _canDissMissController = YES; - + //添加警告内容 [self redTipLable]; } @@ -116,29 +95,12 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { _redTipLable.font=[UIFont systemFontOfSize:13]; _redTipLable.textColor=[UIColor redColor]; [_redTipLable sizeToFit]; -// _redTipLable.backgroundColor=[UIColor blackColor]; [self.view addSubview:_redTipLable]; [self.view bringSubviewToFront:_redTipLable]; } return _redTipLable; } - -#pragma mark - 声波SDK初始化 --(void)soundInit{ - [[LSemTMFSet sharedInstance] setDelegate:self]; - - int soundCode=[[LSemTMFSet sharedInstance]initSDK:@"gwelltimes" - client:@"gwelltimes" - productModel:@"gm8135s-8136" - license:@"11625ae8060111e6b5123e1d05defe78"]; - NSLog(@"声波初始化的结果码:%d",soundCode); - _soundInitCode = soundCode; - if (soundCode!=1) {//如果不能正常使用SDK,就不让发送SDK - // - [self.view makeToast:@"声波初始化失败"]; - } -} - +//获取WiFi信息 - (id)fetchSSIDInfo { NSArray *ifs = (id)CFBridgingRelease(CNCopySupportedInterfaces()); @@ -161,401 +123,22 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:RECEIVE_REMOTE_MESSAGE object:nil]; _bQuit = YES; - - if (_context){ - elianStop(_context); - elianDestroy(_context); - _context = NULL; - } - - self.isWaiting = NO;//isWaiting is NO self.isFinish = YES; self.isRun = NO; - - if(self.socket){ - [self.socket close]; - self.socket=nil; - } - - [self soundExit]; - + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; _bQuit = NO; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveRemoteMessage:) name:RECEIVE_REMOTE_MESSAGE object:nil]; - //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wifiviewkeyboradWillShow:) name:UIKeyboardWillChangeFrameNotification object:nil]; - [self setSoket]; - - - } -- (void)receiveRemoteMessage:(NSNotification *)notification{ - - _initPwSuc = YES; - NSDictionary *parameter = [notification userInfo]; - int key = [[parameter valueForKey:@"key"] intValue]; - NSString * contactName = [NSString stringWithFormat:@"Cam%@", self.contactID]; - switch(key){ - - case RET_SET_INIT_PASSWORD: - { - int result = [[parameter valueForKey:@"result"] intValue]; - if(result==0){ - ContactDAO *contactDAO = [[ContactDAO alloc] init]; - Contact *contact = [contactDAO isContact:self.contactID]; - - - if(contact!=nil){ - - contact.contactName = contactName; - - contact.contactPassword = self.lastSetPassword;//updatepwd - - [[FListManager sharedFList] updatee:contact]; - - dispatch_async(dispatch_get_main_queue(), ^{ - - - // [self.view makeToast:NSLocalizedString(@"operator_success", nil)]; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - usleep(800000); - dispatch_async(dispatch_get_main_queue(), ^{ - //不同 - - //设置密码成功后爱鱼奇用户绑定摄像头 - // - [self ifishUserBindcameraIdBy:self.contactID]; - - }); - }); - }); - }else{ - Contact *contact = [[Contact alloc] init]; - contact.contactId = self.contactID; - contact.contactName = contactName; - - contact.contactPassword = self.lastSetPassword; - contact.contactType = CONTACT_TYPE_UNKNOWN; - [[FListManager sharedFList] insert:contact]; - - [[P2PClient sharedClient] getContactsStates:[NSArray arrayWithObject:contact.contactId]]; - [[P2PClient sharedClient] getDefenceState:contact.contactId password:contact.contactPassword]; - //contact 原始数据暂不动 现在摄像头数据 模型用IfishCameraModel - - dispatch_async(dispatch_get_main_queue(), ^{ - - // [self.view makeToast:NSLocalizedString(@"operator_success", nil)]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - usleep(800000); - dispatch_async(dispatch_get_main_queue(), ^{ - - //设置密码成功后爱鱼奇用户绑定摄像头 - [self ifishUserBindcameraIdBy:self.contactID]; - - - }); - }); - }); - } - }else if(result==43){ - - dispatch_async(dispatch_get_main_queue(), ^{ - self.lodviewMissStyle =lodingViewdissMissSuccsess; - [self mmPogressHUDdismiss]; - [self connectNormalView]; - _canDissMissController = YES; - [self.view makeToast:NSLocalizedString(@"device_already_exist_password", nil)]; - }); - }else{ - dispatch_async(dispatch_get_main_queue(), ^{ - //只为做 dissPogress处理并非成功 - self.lodviewMissStyle =lodingViewdissMissSuccsess; - [self mmPogressHUDdismiss]; - [self connectNormalView]; - _canDissMissController = YES; - - [self.view makeToast:NSLocalizedString(@"operator_failure", nil)]; - - }); - } - } - break; - - case RET_SET_DEVICE_PASSWORD: - { - - NSInteger result = [[parameter valueForKey:@"result"] intValue]; - - if(result==0){ - - dispatch_async(dispatch_get_main_queue(), ^{ - //[self.view makeToast:NSLocalizedString(@"operator_success", nil)]; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - usleep(800000); - dispatch_async(dispatch_get_main_queue(), ^{ - - [self ifishUserBindcameraIdBy:self.contactID]; - - }); - }); - }); - - - }else{ - dispatch_async(dispatch_get_main_queue(), ^{ - - self.lodviewMissStyle =lodingViewdissMissSuccsess; - - [self mmPogressHUDdismiss]; - [self connectNormalView]; - _canDissMissController = YES; - - [self.view makeToast:NSLocalizedString(@"operator_failure", nil)]; - - - }); - } - } - break; - - - } - -} - --(void)setWindowRootWith:(IfishCameraModel *)cameraMdel{ - - - Socketsingleton *soket=[Socketsingleton sharedInstance]; - if (soket.clientSocket.isConnected) { - [soket cutOffSocket]; - } - - IfishP2PMonitorController *monitorVC=[[IfishP2PMonitorController alloc] init]; - monitorVC.contact = cameraMdel; - UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:monitorVC]; - - UIApplication*app=[UIApplication sharedApplication]; - AppDelegate*app1=(AppDelegate*)app.delegate; - app1.window.rootViewController=nav; - - //绑定成功 加 经验值 - [[IfishUserObsever sharedInstance] xinZengJingYanZhi:IFISHADDEXP_BIDCAMERA addType:IFISHADDEXPTYPE1]; - -} - -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; } - --(void)setSoket{ - - self.isRun = YES; - self.isPrepared = NO; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - while(self.isRun){//不断广播获取设置好WIFI的设备 - if(!self.isPrepared){ - [self prepareSocket]; - } - usleep(1000000); - } - }); - -} - --(BOOL)prepareSocket{ - - GCDAsyncUdpSocket *socket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)]; - NSError *error = nil; - - - if (![socket bindToPort:9988 error:&error]) - { - //NSLog(@"Error binding: %@", [error localizedDescription]); - return NO; - } - if (![socket beginReceiving:&error]) - { - NSLog(@"Error receiving: %@", [error localizedDescription]); - return NO; - } - - if (![socket enableBroadcast:YES error:&error]) - { - NSLog(@"Error enableBroadcast: %@", [error localizedDescription]); - return NO; - } - - self.socket = socket; - self.isPrepared = YES; - return YES; -} - - - -#pragma mark - 空中发包,给设备设置wifi -- (void)startSetWifiLoop -{ - //ssid - const char *ssid = [self.wifiName cStringUsingEncoding:NSUTF8StringEncoding]; - //authmode - int authmode = 9;//delete - //pwd - const char *password = [self.wifiSecFiled.text cStringUsingEncoding:NSUTF8StringEncoding];//NSASCIIStringEncoding - //target - unsigned char target[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - - - _context = elianNew(NULL, 0, target, ELIAN_SEND_V1 | ELIAN_SEND_V4); - - elianPut(_context, TYPE_ID_AM, (char *)&authmode, 1);//delete - - elianPut(_context, TYPE_ID_SSID, (char *)ssid, strlen(ssid)); - - elianPut(_context, TYPE_ID_PWD, (char *)password, strlen(password)); - - - elianStart(_context); -} - -#pragma mark - 使用90秒来进行空中发包,给设备设置wifi --(void)setWifiAniminte{ - - - self.isWaiting = YES; - __weak typeof(self) weakself= self; - - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - - int index = 0; - while(weakself.isWaiting){ - NSLog(@"%i",index); - index++; - if (weakself.conectType == conectType_Intelligent){ - //startSetWifiLoop - if (index >= 21 && index <= 30) - { - if (index == 21) - { - elianStop(_context); - } - } - else if (index >= 51 && index <= 60) - { - if (index == 51) - { - elianStop(_context); - } - } - else if (index >= 81) - { - if (index == 81) - { - elianStop(_context); - } - } - else - { - if (index==31 || index==61) - { - elianStart(_context); - } - } - if(index>=90) - {//90 - - [weakself soundSendStop]; - - NSLog(@"声波发送时间达上限,停止发送"); - - break; - } - } - else - { - if(index>=60) - {//60 - break; - } - } - sleep(1.0); - } - - - if(!weakself.isFinish){ - if (weakself.conectType == conectType_Intelligent){//startSetWifiLoop - if (_context){ - elianStop(_context); - elianDestroy(_context); - _context = NULL; - - //dispatch_async(, <#^(void)block#>) - [weakself connectNormalView]; - _canDissMissController = YES; - weakself.lodviewMissStyle =lodingViewdissMissfail; - [weakself mmPogressHUDdismiss]; - - NSLog(@"设置WIFI失败,停止"); - }//设置WIFI失败,停止 - } - } - }); -} - -#pragma mark - 声波开始发送 --(void)soundSendStart{ - NSLog(@"开始发送声波"); - NSString* strWiFiName=self.wifiName; - NSString* strWiFiPwd=self.wifiSecFiled.text; - NSLog(@"要发送的WiFi是:%@,其密码是:%@",self.wifiName,self.wifiSecFiled.text); - [[LSemTMFSet sharedInstance] sendWiFiSet:strWiFiName password:strWiFiPwd]; -} - - -#pragma mark - 声波停止发送 --(void)soundSendStop{ - NSLog(@"停止发送声波"); - - [[LSemTMFSet sharedInstance] stopSend]; - [[LSemTMFSet sharedInstance] cancleConnectTimer]; -} - -#pragma mark - 声波SDK退出和释放 --(void)soundExit{ - NSLog(@"退出声波SDK"); - [self soundSendStop]; - [[LSemTMFSet sharedInstance] exitEMTMFSDK]; -} -#pragma mark - 声波的几个协议 -- (void)didSetWifiResultErrcode:(EMTMFErrcodeType*)errcode content:(NSString*)content{ - if (errcode==(EMTMFErrcodeType*)EMTMFErrcodeType_SUCESS){ - NSLog(@"声波配对成功"); - NSLog(@"content%@",content); - [self soundSendStop]; - }else{ - NSLog(@"声波配对失败content%@,重新发送",content); - [self soundSendStart]; - } -} -- (void)didFSKSendingComplete{ - [[LSemTMFSet sharedInstance] startConnectTimeOutListener:1];//暂停1秒,然后继续发送声波 -} --(void)didSDKErrcode:(int) errCode errMsg:(NSString*)errMsg{ - NSLog(@"声波初始化结果码:%d,结果码解释:%@",errCode,errMsg); -} - --(void)dealloc{ - - [self soundExit]; -} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. @@ -704,72 +287,6 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { } - --(void)initMMProgressHUD{ - - NSMutableArray *images = [[NSMutableArray alloc] init]; - - for (int i = 1; i <= 63; i ++) { - - if (i < 10) { - [images addObject:[UIImage imageNamed:[NSString stringWithFormat:@"neves000%d",i]]]; - - }else{ - [images addObject:[UIImage imageNamed:[NSString stringWithFormat:@"neves00%d",i]]]; - } - - } - _autodismiss = YES;//MMProgressHUDWindowOverlayModeLinear - [MMProgressHUD setPresentationStyle:MMProgressHUDPresentationStyleNone]; - - /** - * status: Custom Animated Image - */ - [MMProgressHUD showWithTitle:@"" status:@"" images:images]; - - -} --(void)mmPogressHUDdismiss{ - // if (_autodismiss == YES) { - // double delayInSeconds = 2.0; - // dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); - // dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ - [self setMMProgressHUDMissStayle:self.lodviewMissStyle]; - - // }); - // } -} --(void)setMMProgressHUDMissStayle:(lodingViewdissMissStyle)missStyle{ - - switch (missStyle) { - - case lodingViewdissMissSuccsess: - { - //[MMProgressHUD dismissWithSuccess:@""]; - //[self.view makeToast:NSLocalizedString(@"connect_success", nil)]; - - } - break; - case lodingViewdissMissfail: - { - //[MMProgressHUD dismissWithError:@""]; - - [self.view makeToast:@"再试一下!"]; - } - break; - case lodingViewdissMissAlreadyBinded: - { - - //[MMProgressHUD dismissWithSuccess:@""]; - [self.view makeToast:@"已经绑定过了!"]; - - } - default: - break; - } - -} - -(void)showTitle:(NSString*)title messsage:(NSString*)message{ UIAlertView *alert=[[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil]; NSTimeInterval dismissSeconds=1.0; @@ -806,97 +323,11 @@ typedef NS_ENUM(NSInteger,lodingViewdissMissStyle) { CGSize sizeToFit = [value sizeWithFont:[UIFont systemFontOfSize:fontSize] constrainedToSize:CGSizeMake(width, CGFLOAT_MAX) lineBreakMode:NSLineBreakByCharWrapping];//此处的换行类型(lineBreakMode)可根据自己的实际情况进行设置 return sizeToFit.height; } - -#pragma mark - GCDAsyncUdpSocket -- (void)udpSocket:(GCDAsyncUdpSocket *)sock didSendDataWithTag:(long)tag -{ - NSLog(@"did send"); -} - -- (void)udpSocketDidClose:(GCDAsyncUdpSocket *)sock withError:(NSError *)error -{ - NSLog(@"error %@", error); -} - -#pragma mark 搜索设备 -- (void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data - fromAddress:(NSData *)address -withFilterContext:(id)filterContext -{ - - NSLog(@"data%@",data); - //A buffer into which to copy the receiver's data. The buffer must be at least length bytes. - if (data) { - Byte receiveBuffer[1024]; - //Copies a range of bytes from the receiver’s data into a given buffer. - [data getBytes:receiveBuffer length:1024]; - - if(receiveBuffer[0]==1){ - NSString *host = nil; - uint16_t port = 0; - [GCDAsyncUdpSocket getHost:&host port:&port fromAddress:address]; - - int contactId = *(int*)(&receiveBuffer[16]); - int type = *(int*)(&receiveBuffer[20]); - int flag = *(int*)(&receiveBuffer[24]); - - self.contactID = [NSString stringWithFormat:@"%d",contactId]; - self.type = type; - self.flag = flag; - [self.addresses setObject:host forKey:[NSString stringWithFormat:@"%i",contactId]]; - - - if(self.isWaiting){ - - self.isWaiting = NO;//isWaiting is NO - - dispatch_async(dispatch_get_main_queue(), ^{ - self.isFinish = YES; - - if (self.conectType == conectType_Intelligent){//startSetWifiLoop - if (_context){ - elianStop(_context); - elianDestroy(_context); - _context = NULL; - //设置WIFI成功 - } - } - - if (self.flag == 0){ - //没有初始化过密码 - [self initPaw]; - }else if (self.flag == 1){ - //设备默认已经初始化密码 有设备复位后会如此 - [self modifyPassW]; - } - //声波停止发送 声波SDK退出和释放 - [self soundExit]; - }); - } - } - } -} - -//初始化设备密码 --(void)initPaw{ - - NSString *newPassword = @"123"; - self.lastSetPassword = [Utils GetTreatedPassword:newPassword]; - //很容易设置失败?? 定时重发 - [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword]; - -} - -//已初始化密码修改密码 - --(void)modifyPassW{ +//密码 +-(void)resetPassWord{ NSString *newPassword = @"123"; self.lastSetPassword = [Utils GetTreatedPassword:newPassword]; - //NSString *oldPass= [Utils GetTreatedPassword:@"123"]; - - [[P2PClient sharedClient] setDevicePasswordWithId:self.contactID password:GIWEI_INITPASS newPassword:self.lastSetPassword]; - } #pragma mark - 搜索到设备,弹出添加设备提示 暂不用 @@ -918,7 +349,7 @@ withFilterContext:(id)filterContext NSString *newPassword = GIWEI_INITPASS; self.lastSetPassword = [Utils GetTreatedPassword:newPassword];; - [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword]; +// [[P2PClient sharedClient] setInitPasswordWithId:self.contactID initPassword:self.lastSetPassword]; }else{ @@ -929,51 +360,148 @@ withFilterContext:(id)filterContext if (buttonIndex ==1) { [self.wifiSecFiled resignFirstResponder]; - //NSString *pwdString = self.wifiSecFiled.text; - // if (!pwdString) {//ios<7.0 - // pwdString = @""; - // } if (self.wifiSecFiled.text.length<=0||[self.wifiName isEqualToString:@"无Wi-Fi"]) { - //[self.view makeToast:NSLocalizedString(@"link_wifi", nil)]; [self.view makeToast:@"请保证手机已连接wifi,且wifi密码不能为空"]; return; } -// BOOL isRight =[dataContorl isIncludeSpecialCharact:self.wifiSecFiled.text]; -// -// if (!isRight) { -// [self.view makeToast:@"Wifi密码不能包含特殊字符,只能为数字字母下划线"]; -// -// return; -// } - - if (!self.wifiName) { [self.view makeToast:@"未检测到wifi"]; return; } - //旧连接效果已去 - //[self initMMProgressHUD]; - //最新连接效果 + self.wifiPwd = self.wifiSecFiled.text; + //显示连接中效果 [self connectNotNormalView]; _canDissMissController = NO; - //空中抓包方式 - self.conectType = conectType_Intelligent; [self savePassw]; - [self startSetWifiLoop];//给设备设置wifi - [self setWifiAniminte];//直接调用,不用点击“听到了”按钮 + //声波智能联机 + [self smartLinkConnect]; self.isFinish = NO; - - //声波配置方式 - [self soundSendStart]; - } } } +//智能联机 +-(void)smartLinkConnect{ + WEAK_SELF; + [[GWP2PDeviceLinker shareInstance] p2pSmartLinkDeviceWithWiFiSSID:weakSelf.wifiName password:weakSelf.wifiPwd useSimpleConfig:YES deviceLinkIn:^(NSDictionary *deviceDict) { + NSLog(@"声波配网成功,返回数据:%@",deviceDict); + if (weakSelf.isDeviceLinkIn) { + return; + } + weakSelf.isDeviceLinkIn = YES; + [self.view makeToast:@"声波配网成功"]; + //如果智能联机,设备配网成功,就断开发送智能联机 + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; + + NSString *deviceID = [deviceDict[@"deviceID"] stringValue]; + NSString *deviceIP = deviceDict[@"deviceIP"]; + weakSelf.contactID = [NSString stringWithFormat:@"%d",deviceID]; + if (![deviceDict[@"isInitPassword"] boolValue]) { //设备没有初始化密码,设置密码 + [[GWP2PClient sharedClient] setDeviceInitialPassword:@"123" withDeviceID:deviceIP completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSLog(@"success:%i %@",success,dataDictionary); + [weakSelf resetPassWord];//初始化密码 + if (success) { + [weakSelf initPwdResault:dataDictionary]; + }else{ + dispatch_async(dispatch_get_main_queue(), ^{ + //只为做 dissPogress处理并非成功 + weakSelf.lodviewMissStyle =lodingViewdissMissSuccsess; + [weakSelf connectNormalView]; + _canDissMissController = YES; + [weakSelf.view makeToast:NSLocalizedString(@"operator_failure", nil)]; + }); + } + }]; + } else { //设备已经初始化密码,可以让用户输入正确的密码验证通过后加到本地列表,这里直接使用123 + + [[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:deviceIP password:@"123" completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary *dataDictionary) { + NSLog(@"success:%i %@",success,dataDictionary); + [weakSelf resetPassWord];//更新密码 + if (success) { + dispatch_async(dispatch_get_main_queue(), ^{ + //[self.view makeToast:NSLocalizedString(@"operator_success", nil)]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + usleep(800000); + dispatch_async(dispatch_get_main_queue(), ^{ + + [weakSelf ifishUserBindcameraIdBy:self.contactID]; + + }); + }); + }); + }else{ + dispatch_async(dispatch_get_main_queue(), ^{ + + self.lodviewMissStyle =lodingViewdissMissSuccsess; + [self connectNormalView]; + _canDissMissController = YES; + [self.view makeToast:NSLocalizedString(@"operator_failure", nil)]; + + }); + } + }]; + } + }]; +} +//初始化设备密码回调 +-(void)initPwdResault:(NSDictionary *)parameter{ + + NSString * contactName = [NSString stringWithFormat:@"Cam%@", self.contactID]; + + ContactDAO *contactDAO = [[ContactDAO alloc] init]; + Contact *contact = [contactDAO isContact:self.contactID]; + + if(contact!=nil){ + + contact.contactName = contactName; + + contact.contactPassword = self.lastSetPassword;//updatepwd + + [[FListManager sharedFList] updatee:contact]; + + dispatch_async(dispatch_get_main_queue(), ^{ + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + usleep(800000); + dispatch_async(dispatch_get_main_queue(), ^{ + //设置密码成功后爱鱼奇用户绑定摄像头 + [self ifishUserBindcameraIdBy:self.contactID]; + + }); + }); + }); + }else{ + Contact *contact = [[Contact alloc] init]; + contact.contactId = self.contactID; + contact.contactName = contactName; + + contact.contactPassword = self.lastSetPassword; + contact.contactType = CONTACT_TYPE_UNKNOWN; + [[FListManager sharedFList] insert:contact]; + dispatch_async(dispatch_get_main_queue(), ^{ + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + usleep(800000); + dispatch_async(dispatch_get_main_queue(), ^{ + + //设置密码成功后爱鱼奇用户绑定摄像头 + [self ifishUserBindcameraIdBy:self.contactID]; + + + }); + }); + }); + } + +} + +-(void)dealloc{ + [[GWP2PDeviceLinker shareInstance] p2pStopSmartLink]; +} #pragma mark - UI正常状态 -(void)connectNormalView @@ -1140,7 +668,6 @@ withFilterContext:(id)filterContext if ([resultDic[@"result"] isEqualToString:@"100"]) { self.lodviewMissStyle =lodingViewdissMissSuccsess; _canDissMissController = YES; - [self mmPogressHUDdismiss]; [self connectNormalView]; @@ -1182,7 +709,6 @@ withFilterContext:(id)filterContext }else{ //lodingViewdissMissSuccsess 只做移除loding效果 self.lodviewMissStyle =lodingViewdissMissSuccsess; - [self mmPogressHUDdismiss]; [self connectNormalView]; _canDissMissController = YES; [self.view makeToast:@"绑定失败错误码101"]; @@ -1196,7 +722,19 @@ withFilterContext:(id)filterContext }]; } - - +//绑定成功之后设置 +-(void)setWindowRootWith:(IfishCameraModel *)cameraMdel{ + + IfishP2PMonitorController *monitorVC=[[IfishP2PMonitorController alloc] init]; + monitorVC.contact = cameraMdel; + UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:monitorVC]; + + UIApplication*app=[UIApplication sharedApplication]; + AppDelegate*app1=(AppDelegate*)app.delegate; + app1.window.rootViewController=nav; + //绑定成功 加 经验值 + [[IfishUserObsever sharedInstance] xinZengJingYanZhi:IFISHADDEXP_BIDCAMERA addType:IFISHADDEXPTYPE1]; + +} @end diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/en.lproj/Localizable.strings b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/en.lproj/Localizable.strings index 93750d2..6693d56 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/en.lproj/Localizable.strings +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/en.lproj/Localizable.strings @@ -280,6 +280,7 @@ "cur_version_is" = "Current version is"; "can_update_to" = "Will update to"; +"is_latest_version" = "Is the latest version"; "can_update_sd" = "Will update from SD card"; "start_update" = "Start to update"; "update_failed" = "Update Failed"; diff --git a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/zh-Hans.lproj/Localizable.strings b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/zh-Hans.lproj/Localizable.strings index 43cfb97..6947e94 100644 --- a/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/zh-Hans.lproj/Localizable.strings +++ b/Ifish/controllers/IfishYooseeFile/IfishYooseeSource/zh-Hans.lproj/Localizable.strings @@ -280,6 +280,7 @@ "cur_version_is" = "当前版本为"; "can_update_to" = "可升级至"; +"is_latest_version" = "为最新版本"; "can_update_sd" = "能够从SD卡升级"; "start_update" = "开始更新"; "update_failed" = "更新失败"; diff --git a/Ifish/controllers/message/views/MessageAlertView.h b/Ifish/controllers/message/views/MessageAlertView.h index b37d36a..8ca21be 100644 --- a/Ifish/controllers/message/views/MessageAlertView.h +++ b/Ifish/controllers/message/views/MessageAlertView.h @@ -10,11 +10,12 @@ NS_ASSUME_NONNULL_BEGIN /** - 消息页面下拉框 + 多功能下拉框 */ typedef void (^MessageComboBoxBlock)(NSInteger tag); @interface MessageAlertView : UIView Copy MessageComboBoxBlock comboxBlock; +-(void)loadInfoWithTitle:(NSArray *)titleArray Icons:(NSArray *)iconsArray; @end NS_ASSUME_NONNULL_END diff --git a/Ifish/controllers/message/views/MessageAlertView.m b/Ifish/controllers/message/views/MessageAlertView.m index 93dadd9..5bf7ae3 100644 --- a/Ifish/controllers/message/views/MessageAlertView.m +++ b/Ifish/controllers/message/views/MessageAlertView.m @@ -12,46 +12,85 @@ -(instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { - self.backgroundColor = [UIColor blackColor]; - UIRectCorner rectCorner = UIRectCornerBottomLeft|UIRectCornerBottomRight; - UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:RECT(0, 0, kSizeFrom750(220), kSizeFrom750(90)) byRoundingCorners:rectCorner cornerRadii:CGSizeMake(kSizeFrom750(6), kSizeFrom750(6))]; - - CAShapeLayer *shaperLayer = [CAShapeLayer layer]; - shaperLayer.path = path.CGPath; - self.layer.mask = shaperLayer; - - CAShapeLayer *borderLayer=[CAShapeLayer layer]; - borderLayer.path = path.CGPath; - borderLayer.fillColor = [UIColor clearColor].CGColor; -// borderLayer.strokeColor = [UIColor blackColor].CGColor; -// borderLayer.lineWidth = 1; - borderLayer.frame = self.bounds; - [self initSubViews]; + self.backgroundColor = RGB(40, 40, 40); } return self; } --(void)initSubViews +//-(void)initSubViews +//{ +// +// NSArray *imageArr = @[@"ifishdropview_delect_device"]; +// NSArray *titleArr = @[@"删除"]; +// CGFloat contentHeight = kSizeFrom750(90); +// for (int i=0; i