Browse Source

文件显示Bug 和 视频进度条播放bug

DGJ 1 year ago
parent
commit
d56370a840

+ 7 - 5
Assets/LangChaoRTC/Remote/ShowRoom/RemoteVideoControl.cs

@@ -70,14 +70,16 @@ public class RemoteVideoControl : MonoBehaviour
     {
         while (true)
         {
-            yield return new WaitForSeconds(0.5f);
+            yield return new WaitForSeconds(0.05f);
             if (avProVideoPlayer.IsVideoReady()&& !AVideoSlide.isDown)
             {
-                textTotalTime.text = string.Format("{0}:{1}", (avProVideoPlayer.GetMaxTimer() / 60).ToString("00"), (avProVideoPlayer.GetMaxTimer() % 60).ToString("00"));
-                currentTime.text = string.Format("{0}:{1}", (avProVideoPlayer.GetNowTimer() / 60).ToString("00"), (avProVideoPlayer.GetNowTimer() % 60).ToString("00"));
-                slider.value = avProVideoPlayer.GetNowTimer() / avProVideoPlayer.GetMaxTimer();
+                float maxTimer = avProVideoPlayer.GetMaxTimer();
+                float nowTimer = avProVideoPlayer.GetNowTimer();
+                textTotalTime.text = string.Format("{0}:{1}", (maxTimer / 60).ToString("00"), (maxTimer % 60).ToString("00"));
+                currentTime.text = string.Format("{0}:{1}", (nowTimer / 60).ToString("00"), (nowTimer % 60).ToString("00"));
+                slider.value = maxTimer / nowTimer;
 
-                if (slider.value > 0.99)
+                if (textTotalTime.text == currentTime.text)
                 {
                     Icon.SetActive(true);
                     Stop.SetActive(false);

+ 5 - 1
Assets/LangChaoRTC/Remote/ShowRoom/RoomFile.prefab

@@ -821,7 +821,7 @@ MonoBehaviour:
   m_Content: {fileID: 7873290928976605117}
   m_Horizontal: 0
   m_Vertical: 1
-  m_MovementType: 1
+  m_MovementType: 2
   m_Elasticity: 0.1
   m_Inertia: 1
   m_DecelerationRate: 0.135
@@ -1531,6 +1531,10 @@ PrefabInstance:
   m_Modification:
     m_TransformParent: {fileID: 7873290928976605117}
     m_Modifications:
+    - target: {fileID: 119232242693179453, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
+      propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
+      value: UnityEngine.GameObject, UnityEngine
+      objectReference: {fileID: 0}
     - target: {fileID: 2471450907492502192, guid: a5c61b9b0b4aa184cbc1f6ef6eb326fe, type: 3}
       propertyPath: m_AnchorMax.y
       value: 0

+ 2 - 0
Assets/Scripts/UI/MsgItem.cs

@@ -48,6 +48,8 @@ public class MsgItem : MonoBehaviour
 
         nameText.text = fileConfig.From;
 
+        this.fileItem.gameObject.SetActive(true);
+        this.messageItem.SetActive(false);
 
         if (headImage != null)
             this.headImage.sprite = headImage;