From 358981128b92417239d8351143ceb7c94280ff0d Mon Sep 17 00:00:00 2001 From: Siyuan Miao Date: Wed, 24 Sep 2025 20:54:14 +0000 Subject: [PATCH] fix(native): add video init to native start --- internal/native/native.go | 2 ++ internal/native/video.go | 10 ++++++++++ webrtc.go | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/internal/native/native.go b/internal/native/native.go index cf33c1d9..d8b21871 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -77,5 +77,7 @@ func (n *Native) Start() { n.initUI() go n.tickUI() + videoInit() + close(n.ready) } diff --git a/internal/native/video.go b/internal/native/video.go index b3025a87..36e33ecb 100644 --- a/internal/native/video.go +++ b/internal/native/video.go @@ -23,3 +23,13 @@ func (n *Native) VideoSetEDID(edid string) error { func (n *Native) VideoGetEDID() (string, error) { return videoGetEDID() } + +func (n *Native) VideoStop() error { + videoStop() + return nil +} + +func (n *Native) VideoStart() error { + videoStart() + return nil +} diff --git a/webrtc.go b/webrtc.go index dba01b79..a0a8473b 100644 --- a/webrtc.go +++ b/webrtc.go @@ -371,9 +371,9 @@ func onActiveSessionsChanged() { } func onFirstSessionConnected() { - _ = writeCtrlAction("start_video") + _ = nativeInstance.VideoStart() } func onLastSessionDisconnected() { - _ = writeCtrlAction("stop_video") + _ = nativeInstance.VideoStop() }