This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
webrtc config electron #850
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c6262d6
webrtc config electron
t3chguy 110ca22
Merge branch 'develop' into webrtc_settings
t3chguy b944fff
unscrew merge
t3chguy a4b2bac
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy 09d0ab7
attempt to make media selector work everywhere (TM)
t3chguy 8158ec6
touchups
t3chguy 04b86e5
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy dbba1de
i18nize all the things and change show logic
t3chguy 0c36778
fix bad indentation
t3chguy aa90d6b
fix **AMAZING** C&P derp
t3chguy dd4480f
change device data structure to array of objects
t3chguy 4e36c10
only unshift default if there is no deviceId===default
t3chguy 0f2c89d
lets actually make things work, eh?
t3chguy beedeec
copy the arrays so we're not making a mess
t3chguy 3eb519b
this is just endless
t3chguy 46a9326
special case default - CallMediaHandler can figure it out
t3chguy 4976cbb
missed a thing
t3chguy 0bafd64
Revert voodoo
t3chguy 6b4daf0
i18 missed things
t3chguy f4db83a
try empty string as falsey key
t3chguy b1973d7
undefined =/= ''
t3chguy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
Copyright 2017 Michael Telatynski <7t3chguy@gmail.com> | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import UserSettingsStore from './UserSettingsStore'; | ||
import * as Matrix from 'matrix-js-sdk'; | ||
import q from 'q'; | ||
|
||
export default { | ||
getDevices: function() { | ||
// Only needed for Electron atm, though should work in modern browsers | ||
// once permission has been granted to the webapp | ||
return navigator.mediaDevices.enumerateDevices().then(function(devices) { | ||
const audioIn = []; | ||
const videoIn = []; | ||
|
||
if (devices.some((device) => !device.label)) return false; | ||
|
||
devices.forEach((device) => { | ||
switch (device.kind) { | ||
case 'audioinput': audioIn.push(device); break; | ||
case 'videoinput': videoIn.push(device); break; | ||
} | ||
}); | ||
|
||
// console.log("Loaded WebRTC Devices", mediaDevices); | ||
return { | ||
audioinput: audioIn, | ||
videoinput: videoIn, | ||
}; | ||
}, (error) => { console.log('Unable to refresh WebRTC Devices: ', error); }); | ||
}, | ||
|
||
loadDevices: function() { | ||
// this.getDevices().then((devices) => { | ||
const localSettings = UserSettingsStore.getLocalSettings(); | ||
// // if deviceId is not found, automatic fallback is in spec | ||
// // recall previously stored inputs if any | ||
Matrix.setMatrixCallAudioInput(localSettings['webrtc_audioinput']); | ||
Matrix.setMatrixCallVideoInput(localSettings['webrtc_videoinput']); | ||
// }); | ||
}, | ||
|
||
setAudioInput: function(deviceId) { | ||
UserSettingsStore.setLocalSetting('webrtc_audioinput', deviceId); | ||
Matrix.setMatrixCallAudioInput(deviceId); | ||
}, | ||
|
||
setVideoInput: function(deviceId) { | ||
UserSettingsStore.setLocalSetting('webrtc_videoinput', deviceId); | ||
Matrix.setMatrixCallVideoInput(deviceId); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels a bit weird - shouldn't this be operating on a MatrixClient rather than importing the whole js-sdk as
Matrix
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ara4n it's in the same class as createNewMatrixCall is in, which looking at VectorConferenceHandler is used in the same manner. Just following the patterns I see. The other way to do it would be to pass the devices when initiating/answering a call, would you prefer this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, ok. i guess this is ok