Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Commit 7232e1b

Browse files
committed
feat(MEDIA_DEVICES): add SSR mock for the new token
1 parent 27775c9 commit 7232e1b

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

package-lock.json

Lines changed: 3 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@angular/platform-browser-dynamic": "^7.2.15",
4949
"@angular/platform-server": "^7.2.15",
5050
"@angular/router": "^7.2.15",
51-
"@ng-web-apis/common": "latest",
51+
"@ng-web-apis/common": "1.13.0",
5252
"@nguniversal/common": "^7.1.1",
5353
"@nguniversal/express-engine": "^7.1.1",
5454
"@nguniversal/module-map-ngfactory-loader": "^7.1.1",

projects/universal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.12.0",
44
"peerDependencies": {
55
"@angular/core": ">=6.0.0",
6-
"@ng-web-apis/common": ">=1.12.0",
6+
"@ng-web-apis/common": ">=1.13.0",
77
"@types/node": ">=10.0.0",
88
"rxjs": ">=6.0.0"
99
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {ValueProvider} from '@angular/core';
2+
import {MEDIA_DEVICES} from '@ng-web-apis/common';
3+
import {NAVIGATOR_MOCK} from './universal-navigator';
4+
5+
export const UNIVERSAL_MEDIA_DEVICES: ValueProvider = {
6+
provide: MEDIA_DEVICES,
7+
useValue: NAVIGATOR_MOCK.mediaDevices,
8+
};

projects/universal/src/constants/universal-providers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {UNIVERSAL_CRYPTO} from './universal-crypto';
55
import {UNIVERSAL_HISTORY} from './universal-history';
66
import {UNIVERSAL_LOCAL_STORAGE} from './universal-local-storage';
77
import {UNIVERSAL_LOCATION} from './universal-location';
8+
import {UNIVERSAL_MEDIA_DEVICES} from './universal-media-devices';
89
import {UNIVERSAL_NAVIGATOR} from './universal-navigator';
910
import {UNIVERSAL_PERFORMANCE} from './universal-performance';
1011
import {UNIVERSAL_SESSION_STORAGE} from './universal-session-storage';
@@ -20,6 +21,7 @@ export const UNIVERSAL_PROVIDERS: Provider[] = [
2021
UNIVERSAL_LOCAL_STORAGE,
2122
UNIVERSAL_SESSION_STORAGE,
2223
UNIVERSAL_LOCATION,
24+
UNIVERSAL_MEDIA_DEVICES,
2325
UNIVERSAL_NAVIGATOR,
2426
UNIVERSAL_PERFORMANCE,
2527
UNIVERSAL_SPEECH_SYNTHESIS,

projects/universal/src/public-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from './constants/universal-crypto';
88
export * from './constants/universal-history';
99
export * from './constants/universal-local-storage';
1010
export * from './constants/universal-location';
11+
export * from './constants/universal-media-devices';
1112
export * from './constants/universal-navigator';
1213
export * from './constants/universal-performance';
1314
export * from './constants/universal-session-storage';

0 commit comments

Comments
 (0)