Skip to content

Commit

Permalink
Added detectrtc@1.2.9 Fixed #21
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Apr 26, 2016
1 parent b1c9d43 commit e745f78
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
14 changes: 8 additions & 6 deletions DetectRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2016-03-29 8:59:02 AM UTC
// Last time updated: 2016-04-26 1:45:40 PM UTC

// Latest file can be found here: https://cdn.webrtc-experiment.com/DetectRTC.js

Expand Down Expand Up @@ -570,11 +570,13 @@
// Firefox 38+ seems having support of enumerateDevices
// Thanks @xdumaine/enumerateDevices
navigator.enumerateDevices = function(callback) {
navigator.mediaDevices.enumerateDevices().then(callback);
navigator.mediaDevices.enumerateDevices().then(callback).catch(function() {
callback([]);
});
};
}

// ---------- Media Devices detection
// Media Devices detection
var canEnumerate = false;

/*global MediaStreamTrack:true */
Expand All @@ -592,14 +594,14 @@
var isWebsiteHasWebcamPermissions = false;

// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediadevices
// todo: switch to enumerateDevices when landed in canary.
function checkDeviceSupport(callback) {
if (!canEnumerate) {
if (callback) {
callback();
}
return;
}

// This method is useful only for Chrome!

if (!navigator.enumerateDevices && window.MediaStreamTrack && window.MediaStreamTrack.getSources) {
navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack);
}
Expand Down
4 changes: 2 additions & 2 deletions DetectRTC.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ http://localhost:9001
You can even link specific versions:

```html
<!-- replace "1.2.8" with latest release/build -->
<script src="https://github.com/muaz-khan/DetectRTC/releases/download/1.2.8/DetectRTC.js"></script>
<script src="https://github.com/muaz-khan/DetectRTC/releases/download/1.2.9/DetectRTC.js"></script>
```

<img src="https://cdn.webrtc-experiment.com/images/DetectRTC.png" style="width:100%;" />
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "detectrtc",
"version": "1.2.8",
"version": "1.2.9",
"authors": [
{
"name": "Muaz Khan",
Expand Down
12 changes: 7 additions & 5 deletions dev/CheckDeviceSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {
// Firefox 38+ seems having support of enumerateDevices
// Thanks @xdumaine/enumerateDevices
navigator.enumerateDevices = function(callback) {
navigator.mediaDevices.enumerateDevices().then(callback);
navigator.mediaDevices.enumerateDevices().then(callback).catch(function() {
callback([]);
});
};
}

// ---------- Media Devices detection
// Media Devices detection
var canEnumerate = false;

/*global MediaStreamTrack:true */
Expand All @@ -30,14 +32,14 @@ var isWebsiteHasMicrophonePermissions = false;
var isWebsiteHasWebcamPermissions = false;

// http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediadevices
// todo: switch to enumerateDevices when landed in canary.
function checkDeviceSupport(callback) {
if (!canEnumerate) {
if (callback) {
callback();
}
return;
}

// This method is useful only for Chrome!

if (!navigator.enumerateDevices && window.MediaStreamTrack && window.MediaStreamTrack.getSources) {
navigator.enumerateDevices = window.MediaStreamTrack.getSources.bind(window.MediaStreamTrack);
}
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "detectrtc",
"preferGlobal": false,
"version": "1.2.8",
"version": "1.2.9",
"author": {
"name": "Muaz Khan",
"email": "muazkh@gmail.com",
Expand Down Expand Up @@ -35,14 +35,14 @@
"_id": "detectrtc@",
"_from": "detectrtc@",
"devDependencies": {
"grunt": "latest",
"grunt-cli": "latest",
"load-grunt-tasks": "latest",
"grunt-contrib-concat": "latest",
"grunt-contrib-csslint": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-uglify": "latest",
"grunt-jsbeautifier": "latest",
"grunt-bump": "latest"
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"load-grunt-tasks": "3.4.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-csslint": "0.5.0",
"grunt-contrib-jshint": "0.11.3",
"grunt-contrib-uglify": "0.11.0",
"grunt-jsbeautifier": "0.2.10",
"grunt-bump": "0.7.0"
}
}

0 comments on commit e745f78

Please sign in to comment.