|
1 | 1 | ;(() => { |
2 | 2 |
|
3 | 3 | /** |
4 | | - * obs.js uses the Navigator and Battery APIs to get realtime network and |
| 4 | + * Obs.js uses the Navigator and Battery APIs to get realtime network and |
5 | 5 | * battery status of your user’s device. You can use this information to |
6 | 6 | * adapt to their context, or send the data off to SpeedCurve with |
7 | 7 | * `obs-speedcurve.js`. |
|
30 | 30 | // Grab the `connection` property from `navigator`. |
31 | 31 | const { connection } = navigator; |
32 | 32 |
|
33 | | - // Store state in a global `obs` object for reuse later in your application. |
| 33 | + // Store state in a global `window.obs` object for reuse later in your application. |
34 | 34 | window.obs = window.obs || {}; |
35 | 35 |
|
36 | 36 | const obsConfig = (window.obs && window.obs.config) || {}; |
|
61 | 61 | // Combine network capability (RTT + bandwidth) and user/device preferences |
62 | 62 | // (Save-Data, low battery) into a delivery stance. |
63 | 63 | // |
64 | | - // Exposes: |
65 | | - // - obs.connectionCapability: 'strong'|'moderate'|'weak' |
66 | | - // - obs.conservationPreference: 'conserve'|'neutral' |
67 | | - // - obs.deliveryMode: 'rich'|'cautious'|'lite' |
68 | | - // - obs.canShowRichMedia: boolean |
69 | | - // - obs.shouldAvoidRichMedia: boolean |
| 64 | + // Exposes on `window.obs`: |
| 65 | + // - connectionCapability: 'strong'|'moderate'|'weak' |
| 66 | + // - conservationPreference: 'conserve'|'neutral' |
| 67 | + // - deliveryMode: 'rich'|'cautious'|'lite' |
| 68 | + // - canShowRichMedia: boolean |
| 69 | + // - shouldAvoidRichMedia: boolean |
70 | 70 | const recomputeDelivery = () => { |
71 | 71 | const o = window.obs || {}; |
72 | 72 |
|
|
0 commit comments