From 2a68a5e4eeaaa34502cdbc679424d8af3c31fd66 Mon Sep 17 00:00:00 2001 From: Zebra North Date: Fri, 10 Oct 2025 20:54:05 +0100 Subject: [PATCH 1/3] Fix initialization of video/stream toggle --- Assets/USharpVideo/Scripts/USharpVideoPlayer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs index e029779..948e3d0 100644 --- a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs +++ b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs @@ -1333,8 +1333,13 @@ public void RegisterControlHandler(VideoControlHandler newControlHandler) VideoPlayerManager manager = GetVideoManager(); newControlHandler.SetVolume(manager.GetVolume()); newControlHandler.SetMuted(manager.IsMuted()); + + if (IsUsingUnityPlayer()) + newControlHandler.SetToVideoPlayerMode(); + else + newControlHandler.SetToStreamPlayerMode(); } - + public void UnregisterControlHandler(VideoControlHandler controlHandler) { if (_registeredControlHandlers == null) From cafbd99c7664300718328b222c10a93fe12032cc Mon Sep 17 00:00:00 2001 From: Zebra North Date: Sun, 19 Oct 2025 15:31:31 +0100 Subject: [PATCH 2/3] Fix enabling screen after play --- Assets/USharpVideo/Scripts/USharpVideoPlayer.cs | 2 ++ Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs index 948e3d0..2feb39b 100644 --- a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs +++ b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs @@ -1447,6 +1447,8 @@ public void RegisterScreenHandler(VideoScreenHandler newScreenHandler) return; } + newScreenHandler.UpdateVideoTexture(_lastAssignedRenderTexture, IsUsingAVProPlayer()); + VideoScreenHandler[] newControlHandlers = new VideoScreenHandler[_registeredScreenHandlers.Length + 1]; _registeredScreenHandlers.CopyTo(newControlHandlers, 0); _registeredScreenHandlers = newControlHandlers; diff --git a/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs b/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs index b5ee91a..109ef4f 100644 --- a/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs +++ b/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs @@ -31,15 +31,9 @@ public class VideoScreenHandler : UdonSharpBehaviour private Renderer targetRenderer; private Texture lastRenderTexture; - private void Start() - { - targetRenderer = GetComponent(); - - OnEnable(); - } - private void OnEnable() { + targetRenderer = GetComponent(); SetSourceVideoPlayer(sourceVideoPlayer); } From 028f06aeb54455c66f9922b23df6ad171453410a Mon Sep 17 00:00:00 2001 From: Zebra North Date: Sun, 19 Oct 2025 15:47:09 +0100 Subject: [PATCH 3/3] Fix the standby texture --- Assets/USharpVideo/Scripts/USharpVideoPlayer.cs | 2 +- Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs index 2feb39b..3b1eec9 100644 --- a/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs +++ b/Assets/USharpVideo/Scripts/USharpVideoPlayer.cs @@ -1497,7 +1497,7 @@ private void UpdateRenderTexture() foreach (VideoScreenHandler handler in _registeredScreenHandlers) { - if (handler) + if (handler && handler.GetVideoTexture() != renderTexture) { handler.UpdateVideoTexture(renderTexture, IsUsingAVProPlayer()); } diff --git a/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs b/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs index 109ef4f..80c2d91 100644 --- a/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs +++ b/Assets/USharpVideo/Scripts/Utility/VideoScreenHandler.cs @@ -51,9 +51,6 @@ public Texture GetVideoTexture() public void UpdateVideoTexture(Texture renderTexture, bool isAVPro) { - if (renderTexture == lastRenderTexture) - return; - if (targetRenderer) { Material rendererMat;