1

laravel echo 支持媒体流数据吗?我正在尝试向 laravel echo 发送视频流,但它返回空 {}。如果我控制台记录它,下面是真实的流数据。

在此处输入图像描述

let channel = Echo.join(`consultation`)
.listenForWhisper('connectNewUserEvent',(e)=>{
    console.log(e) //got empty
})

var myPeer = new Peer();
myPeer.on('open', function(peer_id) {
    navigator.mediaDevices.getUserMedia({
        video:true,
        audio:true
    }).then(stream=>{

        addVideoStream(myVideo,stream)
        myPeer.on('call', call => {
            call.answer(stream)
            const video = document.createElement('video')
            call.on('stream', userVideoStream => {
            addVideoStream(video, userVideoStream)
            })
        })
        channel.whisper('connectNewUserEvent',stream)
        console.log(stream) //returning stream
    })
});
4

0 回答 0