]> git.feebdaed.xyz Git - gomehub.git/commitdiff
CCTV stream tested
authorseantywork <seantywork@gmail.com>
Fri, 19 Jul 2024 08:52:59 +0000 (17:52 +0900)
committerseantywork <seantywork@gmail.com>
Fri, 19 Jul 2024 08:52:59 +0000 (17:52 +0900)
pkg/stream/stream_cctv.go
public/js/mypage/index.js

index 818888554723fe5cd5795bb9c4f9b50edfb7e037..637d00e275ac062922b08ad2b5b936457c4c3998 100644 (file)
@@ -174,7 +174,6 @@ func PostCCTVOpen(c *gin.Context) {
 
        }
 
-       cs.StreamingKey = streamingKey
        cs.Description = string(desc_b)
 
        cs_b, err := json.Marshal(cs)
index ecf14a18b340cac146b82f4e20999700925502ad..8c27e433cc002d945d998d401393a46146e8ed71 100644 (file)
@@ -320,6 +320,10 @@ async function initCCTV(){
         el.controls = true
 
         document.getElementById('cctv-reader').appendChild(el)
+
+        let req = "cctv-stream:" + STREAMING_KEY
+
+        ws.send(JSON.stringify({command: 'roundtrip', data: req}))
     }
 
     pc.addTransceiver('video')
@@ -331,9 +335,6 @@ async function initCCTV(){
 
     console.log("init success")
 
-    let req = "cctv:" + "default," + STREAMING_KEY
-
-    ws.send(JSON.stringify({command: 'roundtrip', data: req}))
 }