实时播放视频
我想使用 webrtc 在不同网络(公共)上实时广播视频。我正在 github 上检查 TannerGabrriel Broadcast 代码! 这是代码:https://github.com/TannerGabriel/WebRTC-Video-Broadcast 我是 javascript 新手。我通常使用 python php html 但由于某种原因它让我很难理解 javascript。我尝试了屏幕共享,但它占据了整个屏幕!我只想播放视频,我的观众如何观看?
Html 部分
<video preload="auto" autoplay poster="./css/poster.jpg">
<source src="./css/den.mp4" type="video/mp4"></source>
</video>
我从 youtube 获得了 JS,但我想在线播放它。实时...跟踪视频中的每个动作、、、快进、后退暂停!转到 12:21
(function(){
var video = document.getElementById('video'),
vendorUrl = wind.URL || window.webkitURL;
navigator.getMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia;
navigator.getMedia({
video:true,
audio:false
}, function(stream){
video.src =verndorUrl.createObjectURL(stream);
video.play();
}, function(error){
});
})();
Id like to broadcast the video realtime on different network(public) using webrtc. I am checking TannerGabrriel Broadcast code on github!
This is the code :https://github.com/TannerGabriel/WebRTC-Video-Broadcast
Im new in javascript.. I usually use python php html but it make very hard for me to understand javascript for some reason. I tried the screen share but it takes the whole screen! I only want the video to be broadcast, And how do my viewer to watch it?
Html part
<video preload="auto" autoplay poster="./css/poster.jpg">
<source src="./css/den.mp4" type="video/mp4"></source>
</video>
I got the JS from youtube but Id like to stream it online. realtime... tracking each movement on this video,,, fast forward , backward pause! go to 12:21
(function(){
var video = document.getElementById('video'),
vendorUrl = wind.URL || window.webkitURL;
navigator.getMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia;
navigator.getMedia({
video:true,
audio:false
}, function(stream){
video.src =verndorUrl.createObjectURL(stream);
video.play();
}, function(error){
});
})();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只想播放视频,请在后端使用wrtc,通过它单个源可以将视频播放到多个接收端。不太可能
wrtc
是一个 Node js 包,并且不知道你的后端是由什么组成的If you only want to broadcast a video, use
wrtc
on backend, with it single source can broadcast a video to multiple receiving ends. unlikelywrtc
is an node js package and dont know what you're backend is made of