通过WEBRTC流静态视频文件
我要完成的工作是在我的页面音频和视频文件上放置。然后通过webrtc发送它们。我设法使用像这样的Web Audio API使用音频来执行此操作。 HTML:
<audio id="audio">
<source src="../assets/outfoxing.mp3" />
</audio>
JS:
const audioElement = document.getElementById("audio");
const incomingSource = audioContext.createMediaElementSource(audioElement);
const outgoingStream = audioContext.createMediaStreamDestination();
incomingSource.connect(outgoingStream);
const outgoingTrack = outgoingStream.stream.getAudioTracks()[0];
audioElement.play();
await this.sendTransport.produce({ track: outgoingTrack });
对于WebRTC,我正在使用MediaSoup,
现在我想对视频进行同样的操作。但是没有像网络视频API这样的事情,所以我被卡住了。我该如何完成这项任务。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一些局限性,但是您可以参考此。
它使用。
There are some limitations, but you could refer to this sample implementation.
It uses the
captureStream()
method.