Browse Source

适配雷鸟

胡佳骏 1 year ago
parent
commit
74f7cd3169

+ 30 - 14
Assets/GHZScritps/AgoraRTCManager.cs

@@ -107,32 +107,48 @@ public class AgoraRTCManager : SingletonMono<AgoraRTCManager>
     {
         Debug.Log("  JoinChannel  " + _channelName);
         RtcEngine.EnableAudio();
-    //    RtcEngine.EnableVideo();
+        if(DeviceType.type!="LeiNiao")
+        {
+
+            RtcEngine.EnableVideo();
+        }
 
         // RtcEngine.DisableAudio();
         //  RtcEngine.DisableVideo();
-       // VideoEncoderConfiguration config = new VideoEncoderConfiguration();
-      //  config.dimensions = new VideoDimensions(1280, 720);
-      //  config.frameRate = 15;
-      //  config.bitrate = 0;
-        //    config.orientationMode = ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE;
-       // RtcEngine.SetVideoEncoderConfiguration(config);
+        if (DeviceType.type != "LeiNiao")
+        {
+            VideoEncoderConfiguration config = new VideoEncoderConfiguration();
+            config.dimensions = new VideoDimensions(1280, 720);
+            config.frameRate = 15;
+            config.bitrate = 0;
+            //    config.orientationMode = ORIENTATION_MODE.ORIENTATION_MODE_ADAPTIVE;
+            RtcEngine.SetVideoEncoderConfiguration(config);
+        }
         RtcEngine.SetChannelProfile(CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION);
         RtcEngine.SetClientRole(CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER);
         // _channelName = roomid;
-   //     RtcEngine.SetExternalVideoSource(true, true, EXTERNAL_VIDEO_SOURCE_TYPE.VIDEO_FRAME, new SenderOptions());
-
+        if (DeviceType.type != "LeiNiao")
+        {
+            RtcEngine.SetExternalVideoSource(true, true, EXTERNAL_VIDEO_SOURCE_TYPE.VIDEO_FRAME, new SenderOptions());
+        }
         RtcEngine.JoinChannel(_token, _channelName, "", uid);
-        if (!isSwitchCamera&&(DeviceType.type != "Rhinox"|| DeviceType.type!= "Phone"))
+        if (DeviceType.type != "LeiNiao")
         {
-         //   RtcEngine.SwitchCamera();
-            isSwitchCamera = !isSwitchCamera;
+            if (!isSwitchCamera && (DeviceType.type != "Rhinox" || DeviceType.type != "Phone"))
+            {
+                RtcEngine.SwitchCamera();
+                isSwitchCamera = !isSwitchCamera;
+            }
         }
         StartCoroutine(InitVideoAndAduio(1f));
-        if(!RTCINIT)
+
+        if (!RTCINIT)
         {
             RTCINIT = true;
-          //  StartCoroutine(RenderTexturesScreenCapture());
+            if (DeviceType.type != "LeiNiao")
+            {
+                StartCoroutine(RenderTexturesScreenCapture());
+            }
         }
     }
     static bool RTCINIT;

+ 5 - 1
Assets/GHZScritps/AgoraVideoJo.cs

@@ -9,9 +9,13 @@ public class AgoraVideoJo : MonoBehaviour
     {
         StartCoroutine(JoinChannel(3f));
     }
-
+    static GameObject vgo;
     IEnumerator JoinChannel(float times)
     {
+        if(!vgo)
+            vgo = Resources.Load<GameObject>("VufroiaManager");
+
+        GameObject.Instantiate(vgo);
         yield return new WaitForSeconds(times);
         AgoraRTCManager.Instance.JoinChannel();
 

File diff suppressed because it is too large
+ 436 - 599
Assets/Studio/Scenes/Show/Show.unity


Some files were not shown because too many files changed in this diff