提交 df7bf942 authored 作者: Anthony Minessale's avatar Anthony Minessale

get firefox working again

上级 cd398673
......@@ -289,7 +289,7 @@
if (self.options.useVideo) {
self.options.useVideo.style.display = 'none';
self.options.useVideo[moz ? 'mozSrcObject' : 'src'] = "";
self.options.useVideo[moz ? 'mozSrcObject' : 'src'] = null;
}
if (self.localStream) {
......@@ -299,7 +299,7 @@
if (self.options.localVideo) {
self.options.localVideo.style.display = 'none';
self.options.localVideo[moz ? 'mozSrcObject' : 'src'] = "";
self.options.localVideo[moz ? 'mozSrcObject' : 'src'] = null;
}
if (self.options.localVideoStream) {
......
......@@ -2150,24 +2150,64 @@
$.FSRTC.getValidRes(obj.camera, function() {
console.info("enumerating devices");
if (MediaStreamTrack.getSources) {
MediaStreamTrack.getSources(function (media_sources) {
for (var i = 0; i < media_sources.length; i++) {
MediaStreamTrack.getSources(function (media_sources) {
for (var i = 0; i < media_sources.length; i++) {
if (media_sources[i].kind == 'video') {
vid.push(media_sources[i]);
} else {
aud.push(media_sources[i]);
if (media_sources[i].kind == 'video') {
vid.push(media_sources[i]);
} else {
aud.push(media_sources[i]);
}
}
}
$.verto.videoDevices = vid;
$.verto.audioDevices = aud;
$.verto.videoDevices = vid;
$.verto.audioDevices = aud;
console.info("Audio Devices", $.verto.audioDevices);
console.info("Video Devices", $.verto.videoDevices);
runtime();
});
} else {
/* of course it's a totally different API CALL with different element names for the same exact thing */
console.info("Audio Devices", $.verto.audioDevices);
console.info("Video Devices", $.verto.videoDevices);
runtime();
});
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
console.log("enumerateDevices() not supported.");
return;
}
// List cameras and microphones.
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
console.log(device);
console.log(device.kind + ": " + device.label +
" id = " + device.deviceId);
if (device.kind === "videoinput") {
vid.push({id: device.deviceId, kind: "video", label: device.label});
} else {
aud.push({id: device.deviceId, kind: "audio", label: device.label});
}
});
$.verto.videoDevices = vid;
$.verto.audioDevices = aud;
console.info("Audio Devices", $.verto.audioDevices);
console.info("Video Devices", $.verto.videoDevices);
runtime();
})
.catch(function(err) {
console.log(err.name + ": " + error.message);
runtime();
});
}
});
}
......
This diff was suppressed by a .gitattributes entry.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论