x1ongzhu il y a 6 ans
Parent
commit
86ded456c6

+ 1 - 1
ios/Flutter/flutter_export_environment.sh

@@ -7,4 +7,4 @@ export "FLUTTER_BUILD_DIR=build"
 export "SYMROOT=${SOURCE_ROOT}/../build/ios"
 export "FLUTTER_FRAMEWORK_DIR=/Users/drew/Library/flutter/bin/cache/artifacts/engine/ios-release"
 export "FLUTTER_BUILD_NAME=1.0.3"
-export "FLUTTER_BUILD_NUMBER=6"
+export "FLUTTER_BUILD_NUMBER=7"

+ 40 - 36
ios/Runner/Info.plist

@@ -2,25 +2,29 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-    <key>NSCameraUsageDescription</key>
-    <string>需要相机权限才能继续使用</string>
-    <key>NSPhotoLibraryUsageDescription</key>
-    <string>需要相册权限才能继续使用</string>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+	<key>NSCameraUsageDescription</key>
+	<string>需要相机权限才能继续使用</string>
+	<key>NSPhotoLibraryUsageDescription</key>
+	<string>需要相册权限才能继续使用</string>
 	<key>NSContactsUsageDescription</key>
 	<string>需要通讯录权限才能继续使用</string>
-    <key>NSCalendarsUsageDescription</key>
-    <string>需要日历权限才能继续使用</string>
-    <key>NSAppleMusicUsageDescription</key>
-    <string>需要媒体资料库权限才能继续使用</string>
-    <key>NSMotionUsageDescription</key>
-    <string>需要运动与健身权限才能继续使用</string>
-    <key>NSLocationAlwaysUsageDescription</key>
-    <string>需要始终获取位置权限才能继续使用</string>
-    <key>NSLocationWhenInUseUsageDescription</key>
-    <string>需要获取位置权限才能继续使用</string>
-    <key>NSSpeechRecognitionUsageDescription</key>
-    <string>需要语音识别权限才能继续使用</string>
-    
+	<key>NSCalendarsUsageDescription</key>
+	<string>需要日历权限才能继续使用</string>
+	<key>NSAppleMusicUsageDescription</key>
+	<string>需要媒体资料库权限才能继续使用</string>
+	<key>NSMotionUsageDescription</key>
+	<string>需要运动与健身权限才能继续使用</string>
+	<key>NSLocationAlwaysUsageDescription</key>
+	<string>需要始终获取位置权限才能继续使用</string>
+	<key>NSLocationWhenInUseUsageDescription</key>
+	<string>需要获取位置权限才能继续使用</string>
+	<key>NSSpeechRecognitionUsageDescription</key>
+	<string>需要语音识别权限才能继续使用</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
@@ -60,24 +64,24 @@
 	</array>
 	<key>UIViewControllerBasedStatusBarAppearance</key>
 	<false/>
-    <key>ITSAppUsesNonExemptEncryption</key>
-    <false/>
-    <key>LSApplicationQueriesSchemes</key>
-    <array>
-        <string>pubgmhd1106467070</string>
-        <string>weixin</string>
-        <string>alipay</string>
-    </array>
-    <key>CFBundleURLTypes</key>
-    <array>
-        <dict>
-            <key>CFBundleTypeRole</key>
-            <string>Editor</string>
-            <key>CFBundleURLSchemes</key>
-            <array>
-                <string>wjt.cmel365.com</string>
-            </array>
-        </dict>
-    </array>
+	<key>ITSAppUsesNonExemptEncryption</key>
+	<false/>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>pubgmhd1106467070</string>
+		<string>weixin</string>
+		<string>alipay</string>
+	</array>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>wjt.cmel365.com</string>
+			</array>
+		</dict>
+	</array>
 </dict>
 </plist>

+ 5 - 0
ios/ScreenRecorder/Info.plist

@@ -29,5 +29,10 @@
 		<key>RPBroadcastProcessMode</key>
 		<string>RPBroadcastProcessModeSampleBuffer</string>
 	</dict>
+    <key>NSAppTransportSecurity</key>
+    <dict>
+        <key>NSAllowsArbitraryLoads</key>
+        <true/>
+    </dict>
 </dict>
 </plist>

+ 15 - 2
ios/ScreenRecorder/SampleHandler.m

@@ -61,14 +61,27 @@ static void onDarwinPushStop(CFNotificationCenterRef center, void *observer, CFS
     
     //config.autoSampleBufferSize = YES;
     config.autoSampleBufferSize = NO;
-    config.sampleBufferSize = CGSizeMake(1280, 720);
+    int width = [UIScreen mainScreen].bounds.size.width;
+    int height = [UIScreen mainScreen].bounds.size.height;
+    if(width < height){
+        int tmp = width;
+        width = height;
+        height = tmp;
+    }
+    float scale = 1.0;
+    if(width / (float)height > 1280 / 720.f){
+        scale = 1280.f / width;
+    } else {
+        scale = 720.f / height;
+    }
+    config.sampleBufferSize = CGSizeMake((int)(width * scale), (int)(height * scale));
     config.homeOrientation = HOME_ORIENTATION_RIGHT;
     
     s_txLivePublisher = [[TXLivePush alloc] initWithConfig:config];
     
     NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.long.dianjing"];
     NSString *rtmpUrl = [userDefaults objectForKey:@"rtmpUrl"];
-    //    rtmpUrl = @"rtmp://202.79.174.56:1935/test/test";
+//      NSString *rtmpUrl = @"rtmp://202.79.174.56:1935/test/test";
     if (rtmpUrl == nil) {
         [self sendLocalNotificationToHostAppWithTitle:@"比赛未开始" msg:@"开始比赛后才能录屏" userInfo:@{@"id":@"LOCAL_NOTIFY_SCHEDULE_ID"}];
         NSString *domain = @"com.long.dianjing.ScreenRecorder";