video无法播window.URL.createObjectURL(stream)生成的视频url

qq_36805761 2017-03-16 03:39:29
我要做一个视频通话,获取本地视频流:
function getUserMedia(){
navigator.webkitGetUserMedia({
"audio" : true,
"video" : true
}, success, error);
}
function onUserMediaSuccess(stream){
vedio.scr=window.URl.createObjectURL(stream)//我能获取到视频流,但是转化的URL,video无法使用,
会出现:

Failed to load resource: the server responded with a status of 404 (OK)这是调试时的报错说明,
HTTP Status 404 - /Text/polaroid.aac
根本就没这个文件
...全文
781 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_36290419 2020-08-21
  • 打赏
  • 举报
回复
video.srcObject = stream; 直接这样就可以
qq_36805761 2020-06-22
  • 打赏
  • 举报
回复
引用 2 楼 nreg 的回复:
2年后依然无法读取 一读程序就闪退 连个错都不报
2年前我是成功了
nreg 2020-05-10
  • 打赏
  • 举报
回复
2年后依然无法读取 一读程序就闪退 连个错都不报
qq_36805761 2017-03-16
  • 打赏
  • 举报
回复
第一次提问,谢谢大家了
网页视频开发 webrtc ;(function () { var logger = { log: function (){}, warn: function (){}, error: function (){} }; // normalize environment var RTCPeerConnection = null, getUserMedia = null, attachMediaStream = null, reattachMediaStream = null, browser = null, webRTCSupport = true; if (navigator.mozGetUserMedia) { logger.log("This appears to be Firefox"); browser = "firefox"; // The RTCPeerConnection object. RTCPeerConnection = mozRTCPeerConnection; // The RTCSessionDescription object. RTCSessionDescription = mozRTCSessionDescription; // The RTCIceCandidate object. RTCIceCandidate = mozRTCIceCandidate; // Get UserMedia (only difference is the prefix). // Code from Adam Barth. getUserMedia = navigator.mozGetUserMedia.bind(navigator); // Attach a media stream to an element. attachMediaStream = function(element, stream) { element.mozSrcObject = stream; element.play(); }; reattachMediaStream = function(to, from) { to.mozSrcObject = from.mozSrcObject; to.play(); }; // Fake get{Video,Audio}Tracks MediaStream.prototype.getVideoTracks = function() { return []; }; MediaStream.prototype.getAudioTracks = function() { return []; }; } else if (navigator.webkitGetUserMedia) { browser = "chrome"; // The RTCPeerConnection object. RTCPeerConnection = webkitRTCPeerConnection; // Get UserMedia (only difference is the prefix). // Code from Adam Barth. getUserMedia = navigator.webkitGetUserMedia.bind(navigator); // Attach a media stream to an element. attachMediaStream = function(element, stream) { element.autoplay = true; element.src = webkitURL.createObjectURL(stream); }; reattachMediaStream = function(to, from) { to.src = from.src; }; // The representation of tracks in a stream is changed in M26. // Unify them for e

4,008

社区成员

发帖
与我相关
我的任务
社区描述
它是一种微软环境下的轻量级的解释型语言,它使用COM组件、WMI、WSH、ADSI访问系统中的元素,对系统进行管理。
社区管理员
  • vbScript社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧