Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Partly) fix broken demo website #18

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function gotSources(sourceInfos) {

for (var i = 0; i != sourceInfos.length; ++i) {
var sourceInfo = sourceInfos[i];
if (sourceInfo.kind === 'audio') {
if (sourceInfo.kind === 'audioinput') {
var option = document.createElement("option");
option.value = sourceInfo.id;
option.text = sourceInfo.label || 'input ' + (audioSelect.length + 1);
Expand Down Expand Up @@ -213,10 +213,10 @@ function initAudio() {
console.log(e);
});

if ((typeof MediaStreamTrack === 'undefined')||(!MediaStreamTrack.getSources)){
console.log("This browser does not support MediaStreamTrack, so doesn't support selecting sources.\n\nTry Chrome Canary.");
if (!navigator.mediaDevices) {
console.log("This browser does not support mediaDevices, so doesn't support selecting sources.");
} else {
MediaStreamTrack.getSources(gotSources);
navigator.mediaDevices.enumerateDevices().then(gotSources);
}

document.getElementById("effect").onchange=changeEffect;
Expand Down