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

Instructions and correct error message for localhost #32

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ To set an element or class to listen for an init event set `ep_webrtc.listenClas

To enable webrtc with a URL parameter append the following to your pad URL ``?av=YES``

# contributing
# developing and contributing

Please submit bug reports or patches at https://github.com/ether/ep_webrtc/issues
On your browser, you should use `localhost` instead of `0.0.0.0`. This is because webrtc generally requires a secure connection (https), but [an exception is made](https://w3c.github.io/webappsec-secure-contexts/#localhost) specifically for localhost and domains that end in `.localhost`.

Please submit bug reports or patches at https://github.com/ether/ep_webrtc/issues
4 changes: 2 additions & 2 deletions static/js/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ var rtc = (function() {
}
});
})
.catch(function() {
.catch(function(err) {
var reason = "Sorry, we couldnt't find a suitable camera on your device. If you have a camera, make sure it set up correctly and refresh this website to retry.";
if(location.protocol !== "https:") reason = "Sorry, you need to install SSL certificates for your Etherpad instance to use WebRTC";
JohnMcLear marked this conversation as resolved.
Show resolved Hide resolved
if(err.name !== "NotFoundError") reason = "Sorry, you need to install SSL certificates for your Etherpad instance to use WebRTC";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized this has more effectse. Beforehand, any error that was neither NotAllowedError nor NotFoundError would default to the "not found" error message. Now it'll default to the "not allowed" error message.

But, both of those are wrong. Should I just add a generic "unknown error" message?


$("#rtcbox")
.empty()
Expand Down