Selaa lähdekoodia

1.补充功能----剪切板内容发送到云机

huangxiaodong 1 vuosi sitten
vanhempi
commit
e2c16b50d9

+ 1 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+AppDelegate.h

@@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
 }
 @property NSString *nowSSid;
 
+- (void)updateCopydata;
 @end
 
 NS_ASSUME_NONNULL_END

+ 22 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+AppDelegate.m

@@ -12,6 +12,7 @@
 #import <RCCloudPhoneSDK/RCAudioPlayer.h>
 #import "ShortcutManager.h"
 #import <objc/runtime.h>
+#import "RCCommandHelp.h"
 
 @interface PlayerViewController(AppDelegate)
 
@@ -95,6 +96,7 @@
     
     
     [self setShowImgAndVoiceTypeFun:YES];
+    [self updateCopydata];
 }
 
 - (void)applicationWillTerminate:(UIApplication *)application {
@@ -125,4 +127,24 @@
         return currentSSID;
 }
 
+- (void)updateCopydata{
+    UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
+    NSString *str = [pasteboard string];
+    
+    HLog(@"__________%s______%@____",__func__,str);
+    
+    if ([str rangeOfString:@"CVLUSTERS_NOUSE_"].location != NSNotFound)
+    {
+        str = nil;
+    }
+    
+    if (str)
+    {
+        /*发送数据*/
+        NSString *dataStr = [RCCommandHelp commandCuttingWithContent:str];
+        [self.commandChannelManager rc_sendData:dataStr];
+        //pasteboard.string = @"";
+    }
+    
+}
 @end

+ 2 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -1628,6 +1628,8 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
     
     [self fristConnectNeedGiveAMsgFun];
     
+    [self updateCopydata];
+    
     //  报链接失败 后面又连接上了
     if(linkFailAlretVC && linkFailAlretVC.view.tag == 2){
         mainBlock(^{