Эх сурвалжийг харах

Merge branch 'b_c' of http://git.izouma.com/panhui/mobileCyberGamesApp into b_c

panhui 6 жил өмнө
parent
commit
f9019ee8f3

+ 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=D:\flutter\bin\cache\artifacts\engine\ios"
 export "FLUTTER_BUILD_NAME=1.0.3"
-export "FLUTTER_BUILD_NUMBER=9"
+export "FLUTTER_BUILD_NUMBER=11"

+ 12 - 3
ios/ScreenRecorder/SampleHandler.m

@@ -79,9 +79,18 @@ static void onDarwinPushStop(CFNotificationCenterRef center, void *observer, CFS
     
     s_txLivePublisher = [[TXLivePush alloc] initWithConfig:config];
     
-    NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.long.dianjing"];
-    NSString *rtmpUrl = [userDefaults objectForKey:@"rtmpUrl"];
-//      NSString *rtmpUrl = @"rtmp://202.79.174.56:1935/test/test";
+    //    NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.long.dianjing"];
+    //    NSString *rtmpUrl = [userDefaults objectForKey:@"rtmpUrl"];
+    //      NSString *rtmpUrl = @"rtmp://202.79.174.56:1935/test/test";
+    
+    
+    NSURLRequest * urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8899"]];
+    NSURLResponse * response = nil;
+    NSError * error = nil;
+    NSData * data = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error];
+    NSString *rtmpUrl = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+    
+    
     if (rtmpUrl == nil) {
         [self sendLocalNotificationToHostAppWithTitle:@"比赛未开始" msg:@"开始比赛后才能录屏" userInfo:@{@"id":@"LOCAL_NOTIFY_SCHEDULE_ID"}];
         NSString *domain = @"com.long.dianjing.ScreenRecorder";

+ 13 - 1
lib/pages/RoomInfo.dart

@@ -61,6 +61,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   bool showHelloWord = false;
   bool showWait = false;
   num race = 10;
+  HttpServer server;
 
 //获取房间信息
   Future<void> getRoomInfo(type) async {
@@ -496,6 +497,14 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     if (timer != null) {
       timer.cancel();
     }
+
+    HttpServer.bind(InternetAddress.anyIPv4, 8899).then((s) {
+      server = s;
+      s.listen((HttpRequest request) {
+        request.response.write('rtmp://202.79.174.56:1935/myapp/${playerInfo.id}?playerInfoId=${playerInfo.id}');
+        request.response.close();
+      });
+    });
   }
 
   @override
@@ -505,6 +514,9 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     if (timer != null) {
       timer.cancel();
     }
+    if (server != null) {
+      server.close(force: true);
+    }
   }
 
   @override
@@ -787,7 +799,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                     height: 10,
                                   ),
                                   Text(
-                                    '注:上方显示数值前三名的“当前奖励/最高奖励”',
+                                    '注:上方显示数值���前三名的“当前奖励/最高奖励”',
                                     style: TextStyle(color: Colors.white30, fontSize: 12),
                                   )
                                 ],

+ 1 - 1
pubspec.yaml

@@ -1,7 +1,7 @@
 name: wanna_battle
 description: A new Flutter project.
 
-version: 1.0.3+9
+version: 1.0.3+11
 
 environment:
   sdk: ">=2.1.0 <3.0.0"

+ 5 - 5
screen_stream_plugin/ios/Classes/ScreenStreamPlugin.m

@@ -36,11 +36,11 @@
 
 - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result {
     if ([@"start" isEqualToString:call.method]) {
-        NSString *playerInfoId = call.arguments[@"playerInfoId"];
-        NSString *rtmpUrl = [NSString stringWithFormat:@"rtmp://202.79.174.56:1935/myapp/%@?playerInfoId=%@", playerInfoId, playerInfoId];
-        NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.long.dianjing"];
-        [userDefaults setValue:rtmpUrl forKey:@"rtmpUrl"];
-        [userDefaults synchronize];
+        // NSString *playerInfoId = call.arguments[@"playerInfoId"];
+        // NSString *rtmpUrl = [NSString stringWithFormat:@"rtmp://202.79.174.56:1935/myapp/%@?playerInfoId=%@", playerInfoId, playerInfoId];
+        // NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.long.dianjing"];
+        // [userDefaults setValue:rtmpUrl forKey:@"rtmpUrl"];
+        // [userDefaults synchronize];
         CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("PUSH_START"), NULL, nil, YES);
 
         SCLAlertView *alert = [[SCLAlertView alloc] init];